Skip to content

Commit 77dc5cb

Browse files
Merge pull request #918 from yeswanth6096/optest-sysinfo-enhance
Optest sysinfo enhancement
2 parents bf363f5 + 68bfb97 commit 77dc5cb

File tree

3 files changed

+34
-11
lines changed

3 files changed

+34
-11
lines changed

CONFIG.YAML

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,22 @@
11
LINUX:
2-
COMMANDS:
3-
- "date"
2+
COMMANDS:
43
- "hostname"
54
- "cat /etc/os-release | grep PRETTY_NAME"
65
- "uname -r"
6+
- "lsmcode" #Firmware
7+
- "tail /proc/cpuinfo | grep cpu" # will give info whether its P8/P9,P10 or P11
8+
#kvm commands
9+
- "arch" # Architecture
10+
- "lscpu | grep 'Model name' | cut -f 2 -d ':' | awk '{$1=$1}1'" # Processor
11+
- "nproc" # No-of-CPUs
12+
- "free -mh" # RAM
13+
#VIOS Commands
14+
- "lscfg" # Display hardware configuration information.
15+
- "vmstat" # Copy: Report virtual memory statistics.
16+
#FS Commands
17+
- "mkfs.ext4 -V"
18+
- "mkfs.xfs -V"
19+
720
HMC:
821
COMMANDS:
922
- "lshmc -V" #HMC software version, release, service pack, and build level
@@ -15,3 +28,10 @@ HMC:
1528
- "lshwres -r virtualio --rsubtype eth -m SYS --level lpar" #Virtual Ethernet Adapter (VEA) Info
1629
- "lshwres -r virtualio --rsubtype scsi -m SYS --level lpar" #scsi Adapter Info
1730
- "lshwres -r virtualio --rsubtype fc -m SYS --level lpar" #fc Adapter Info
31+
- "lssyscfg -r lpar -m SYS -F name,kvm_capable" #To check KVM capable lpars
32+
- "lssysconn -r all" # This command lists system connections and includes the FSP/BMC IP address.
33+
#IO Commands
34+
- "lshwres -r io -m SYS --rsubtype slot --filter 'lpar_names=LPAR_NAME'" # List physical IO
35+
- "lshwres -r virtualio --rsubtype fc --level lpar -m SYS -F adapter_type,lpar_name,slot_num,remote_lpar_name,remote_slot_num,wwpns" # List virtual IOs
36+
37+

common/OpTestHMC.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1140,7 +1140,7 @@ def set_system(self, system):
11401140
log.info("Collecting OS sysinfo")
11411141
self.sysinfo.get_OSconfig(self.pty, self.expect_prompt)
11421142
log.info("Collecting HMC details")
1143-
self.sysinfo.get_HMCconfig(self.ssh, self.expect_prompt,self.mg_system)
1143+
self.sysinfo.get_HMCconfig(self.ssh, self.expect_prompt,self.mg_system,self.lpar_name)
11441144

11451145
def get_host_console(self):
11461146
'''
@@ -1392,4 +1392,4 @@ def run_command(self, i_cmd, timeout=15):
13921392
'''
13931393
Wrapper command for run_command from util
13941394
'''
1395-
return self.util.run_command(self, i_cmd, timeout)
1395+
return self.util.run_command(self, i_cmd, timeout)

common/OpTestSysinfo.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,20 +54,23 @@ def get_OSconfig(self, pty, prompt):
5454
except CommandFailed as cf:
5555
raise cf
5656

57-
def get_HMCconfig(self, pty, prompt,CEC_name):
57+
def get_HMCconfig(self, pty, prompt,CEC_name,LPAR):
5858
# Collect config data from HMC
5959
################ HMC INFO ####################
6060
get_HMCconfig_cmds = self.config_actions["HMC"]["COMMANDS"]
61+
print("########### HMC Sysinfo ########")
6162
for index, each_cmd in enumerate(get_HMCconfig_cmds, start=0):
62-
if re.search('SYS', each_cmd):
63-
new_cmd=re.sub('SYS',CEC_name,each_cmd)
64-
try:
63+
if re.search(r'SYS|LPAR_NAME', each_cmd):
64+
new_cmd=each_cmd
65+
# Replace placeholders
66+
new_cmd = re.sub(r'SYS', CEC_name, new_cmd)
67+
new_cmd = re.sub(r'LPAR_NAME', LPAR, new_cmd)
68+
try:
6569
output = pty.run_command(new_cmd)
66-
except Exception as e:
70+
except Exception as e:
6771
print('command failed due to system error')
68-
else:
72+
else:
6973
try:
7074
output = pty.run_command(each_cmd)
7175
except Exception as e:
7276
print('command failed due to system error')
73-

0 commit comments

Comments
 (0)