本文整理汇总了Python中common.OpTestSystem.OpTestSystem.sys_ipmi_boot_system_to_petitboot方法的典型用法代码示例。如果您正苦于以下问题:Python OpTestSystem.sys_ipmi_boot_system_to_petitboot方法的具体用法?Python OpTestSystem.sys_ipmi_boot_system_to_petitboot怎么用?Python OpTestSystem.sys_ipmi_boot_system_to_petitboot使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类common.OpTestSystem.OpTestSystem
的用法示例。
在下文中一共展示了OpTestSystem.sys_ipmi_boot_system_to_petitboot方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: OpTestDropbearSafety
# 需要导入模块: from common.OpTestSystem import OpTestSystem [as 别名]
# 或者: from common.OpTestSystem.OpTestSystem import sys_ipmi_boot_system_to_petitboot [as 别名]
class OpTestDropbearSafety():
## Initialize this object
# @param i_bmcIP The IP address of the BMC
# @param i_bmcUser The userid to log into the BMC with
# @param i_bmcPasswd The password of the userid to log into the BMC with
# @param i_bmcUserIpmi The userid to issue the BMC IPMI commands with
# @param i_bmcPasswdIpmi The password of BMC IPMI userid
# @param i_ffdcDir Optional param to indicate where to write FFDC
#
# "Only required for inband tests" else Default = None
# @param i_hostIP The IP address of the HOST
# @param i_hostuser The userid to log into the HOST
# @param i_hostPasswd The password of the userid to log into the HOST with
#
def __init__(self, i_bmcIP, i_bmcUser, i_bmcPasswd,
i_bmcUserIpmi, i_bmcPasswdIpmi, i_ffdcDir=None, i_hostip=None,
i_hostuser=None, i_hostPasswd=None):
self.cv_BMC = OpTestBMC(i_bmcIP, i_bmcUser, i_bmcPasswd, i_ffdcDir)
self.cv_IPMI = OpTestIPMI(i_bmcIP, i_bmcUserIpmi, i_bmcPasswdIpmi,
i_ffdcDir, i_hostip, i_hostuser, i_hostPasswd)
self.cv_HOST = OpTestHost(i_hostip, i_hostuser, i_hostPasswd, i_bmcIP)
self.cv_SYSTEM = OpTestSystem(i_bmcIP, i_bmcUser, i_bmcPasswd,
i_bmcUserIpmi, i_bmcPasswdIpmi, i_ffdcDir, i_hostip,
i_hostuser, i_hostPasswd)
self.util = OpTestUtil()
##
# @brief This function will tests Dropbear running functionality in skiroot
# 1. Power Off the system
# 2. Power on the system
# 3. Exit to the petitboot shell
# 4. Execute ps command
# 5. test will fail incase dropbear is running and listed out by ps
# 6. At the end of test reboot the system to OS.
#
# @return BMC_CONST.FW_SUCCESS or raise OpTestError
#
def test_dropbear_running(self):
self.cv_SYSTEM.sys_bmc_power_on_validate_host()
print "Test Dropbear running in Petitboot"
print "Performing IPMI Power Off Operation"
self.console = self.cv_SYSTEM.sys_get_ipmi_console()
self.cv_SYSTEM.sys_ipmi_boot_system_to_petitboot(self.console)
self.cv_IPMI.ipmi_host_set_unique_prompt(self.console)
self.cv_IPMI.run_host_cmd_on_ipmi_console("uname -a")
# we don't grep for 'dropbear' so that our naive line.count
# below doesn't hit a false positive.
res = self.cv_IPMI.run_host_cmd_on_ipmi_console("ps|grep drop")
print res
self.cv_IPMI.ipmi_set_boot_to_disk()
for line in res:
if line.count('dropbear'):
raise OpTestError("drobear is running in the skiroot")
return BMC_CONST.FW_SUCCESS
示例2: __init__
# 需要导入模块: from common.OpTestSystem import OpTestSystem [as 别名]
# 或者: from common.OpTestSystem.OpTestSystem import sys_ipmi_boot_system_to_petitboot [as 别名]
class OpTestPCI:
## Initialize this object
# @param i_bmcIP The IP address of the BMC
# @param i_bmcUser The userid to log into the BMC with
# @param i_bmcPasswd The password of the userid to log into the BMC with
# @param i_bmcUserIpmi The userid to issue the BMC IPMI commands with
# @param i_bmcPasswdIpmi The password of BMC IPMI userid
# @param i_ffdcDir Optional param to indicate where to write FFDC
#
# "Only required for inband tests" else Default = None
# @param i_hostIP The IP address of the HOST
# @param i_hostuser The userid to log into the HOST
# @param i_hostPasswd The password of the userid to log into the HOST with
#
def __init__(
self,
i_bmcIP,
i_bmcUser,
i_bmcPasswd,
i_bmcUserIpmi,
i_bmcPasswdIpmi,
i_ffdcDir=None,
i_hostip=None,
i_hostuser=None,
i_hostPasswd=None,
i_hostLspci=None,
):
self.cv_BMC = OpTestBMC(i_bmcIP, i_bmcUser, i_bmcPasswd, i_ffdcDir)
self.cv_IPMI = OpTestIPMI(
i_bmcIP, i_bmcUserIpmi, i_bmcPasswdIpmi, i_ffdcDir, i_hostip, i_hostuser, i_hostPasswd
)
self.cv_HOST = OpTestHost(i_hostip, i_hostuser, i_hostPasswd, i_bmcIP, i_ffdcDir)
self.cv_SYSTEM = OpTestSystem(
i_bmcIP,
i_bmcUser,
i_bmcPasswd,
i_bmcUserIpmi,
i_bmcPasswdIpmi,
i_ffdcDir,
i_hostip,
i_hostuser,
i_hostPasswd,
)
self.util = OpTestUtil()
self.lspci_file = i_hostLspci
##
# @brief This function will get the PCI and USB susbsytem Info
# And also this test compares known good data of
# "lspci -mm -n" which is stored in testcases/data directory
# with the current lspci data.
# User need to specify the corresponding file name into
# machines xml like lspci.txt which contains "lspci -mm -n"
# command output in a working good state of system.
# tools used are lspci and lsusb
#
# @return BMC_CONST.FW_SUCCESS or BMC_CONST.FW_FAILED
#
def test_host_pci_devices_info(self):
if self.lspci_file == "empty.txt":
print "Skipping the pci devices comparision as missing the lspci data file name in machines xml"
return BMC_CONST.FW_SUCCESS
filename = os.path.join(os.path.dirname(__file__).split("testcases")[0], self.lspci_file)
if not os.path.isfile(filename):
raise OpTestError("lspci file %s not found in top level directory" % filename)
self.pci_good_data_file = filename
self.test_skiroot_pci_devices()
self.cv_IPMI.ipmi_set_boot_to_disk()
self.cv_IPMI.ipmi_power_off()
self.cv_IPMI.ipmi_power_on()
self.cv_IPMI.ipl_wait_for_working_state()
self.test_host_pci_devices()
##
# @brief This function will get the "lspci -mm -n" output from the petitboot
# and compares it with known good lspci data
#
# @return BMC_CONST.FW_SUCCESS or BMC_CONST.FW_FAILED
#
def test_skiroot_pci_devices(self):
cmd = "lspci -mm -n"
self.console = self.cv_SYSTEM.sys_get_ipmi_console()
self.cv_SYSTEM.sys_ipmi_boot_system_to_petitboot(self.console)
self.cv_IPMI.ipmi_host_set_unique_prompt(self.console)
self.cv_IPMI.run_host_cmd_on_ipmi_console("uname -a")
self.cv_IPMI.run_host_cmd_on_ipmi_console("cat /etc/os-release")
res = self.cv_IPMI.run_host_cmd_on_ipmi_console(cmd)
self.cv_SYSTEM.sys_ipmi_close_console(self.console)
self.pci_data_petitboot = "\n".join(res[1:])
diff_process = subprocess.Popen(["diff", "-u", self.pci_good_data_file, "-"], stdin=subprocess.PIPE)
diff_stdout, diff_stderr = diff_process.communicate(self.pci_data_petitboot + "\n")
r = diff_process.wait()
if r == 0:
print "All the pci devices are detected at petitboot"
else:
print diff_stdout
raise OpTestError("There is a mismatch b/w known good output and tested petitboot lspci output")
##
# @brief This function will get the "lspci -mm -n" output from the host OS
#.........这里部分代码省略.........
示例3: OpTestNVRAM
# 需要导入模块: from common.OpTestSystem import OpTestSystem [as 别名]
# 或者: from common.OpTestSystem.OpTestSystem import sys_ipmi_boot_system_to_petitboot [as 别名]
class OpTestNVRAM():
## Initialize this object
# @param i_bmcIP The IP address of the BMC
# @param i_bmcUser The userid to log into the BMC with
# @param i_bmcPasswd The password of the userid to log into the BMC with
# @param i_bmcUserIpmi The userid to issue the BMC IPMI commands with
# @param i_bmcPasswdIpmi The password of BMC IPMI userid
# @param i_ffdcDir Optional param to indicate where to write FFDC
#
# "Only required for inband tests" else Default = None
# @param i_hostIP The IP address of the HOST
# @param i_hostuser The userid to log into the HOST
# @param i_hostPasswd The password of the userid to log into the HOST with
#
def __init__(self, i_bmcIP, i_bmcUser, i_bmcPasswd,
i_bmcUserIpmi, i_bmcPasswdIpmi, i_ffdcDir=None, i_hostip=None,
i_hostuser=None, i_hostPasswd=None):
self.cv_BMC = OpTestBMC(i_bmcIP, i_bmcUser, i_bmcPasswd, i_ffdcDir)
self.cv_IPMI = OpTestIPMI(i_bmcIP, i_bmcUserIpmi, i_bmcPasswdIpmi,
i_ffdcDir, i_hostip, i_hostuser, i_hostPasswd)
self.cv_HOST = OpTestHost(i_hostip, i_hostuser, i_hostPasswd, i_bmcIP)
self.cv_SYSTEM = OpTestSystem(i_bmcIP, i_bmcUser, i_bmcPasswd,
i_bmcUserIpmi, i_bmcPasswdIpmi, i_ffdcDir, i_hostip,
i_hostuser, i_hostPasswd)
self.util = OpTestUtil()
##
# @brief This function tests nvram partition access, print/update
# the config data and dumping the partition's data. All
# these operations are done on supported partitions in both
# host OS and Petitboot.
#
# @return BMC_CONST.FW_SUCCESS or BMC_CONST.FW_FAILED
#
def test_nvram_configuration(self):
# Execute these tests in host OS
self.cv_SYSTEM.sys_bmc_power_on_validate_host()
self.cv_HOST.host_run_command("uname -a")
self.cv_HOST.host_run_command("cat /etc/os-release")
self.cv_HOST.host_run_command("nvram -v")
self.cv_HOST.host_run_command("nvram --print-config -p ibm,skiboot")
self.cv_HOST.host_run_command("nvram --print-config -p common")
self.cv_HOST.host_run_command("nvram --print-config -p lnx,oops-log")
self.cv_HOST.host_run_command("nvram --print-config -p wwwwwwwwwwww")
self.cv_HOST.host_run_command("nvram --print-vpd")
self.cv_HOST.host_run_command("nvram --print-all-vpd")
self.cv_HOST.host_run_command("nvram --print-err-log")
self.cv_HOST.host_run_command("nvram --print-event-scan")
self.cv_HOST.host_run_command("nvram --partitions")
self.cv_HOST.host_run_command("nvram --dump common")
self.cv_HOST.host_run_command("nvram --dump ibm,skiboot")
self.cv_HOST.host_run_command("nvram --dump lnx,oops-log")
self.cv_HOST.host_run_command("nvram --dump wwwwwwwwwwww")
self.cv_HOST.host_run_command("nvram --ascii common")
self.cv_HOST.host_run_command("nvram --ascii ibm,skiboot")
self.cv_HOST.host_run_command("nvram --ascii lnx,oops-log")
self.cv_HOST.host_run_command("nvram --ascii wwwwwwwwwwww")
try:
self.test_nvram_update_part_config_in_host("common")
self.test_nvram_update_part_config_in_host("ibm,skiboot")
self.test_nvram_update_part_config_in_host("lnx,oops-log")
self.test_nvram_update_part_config_in_host("wwwwwwwwwwww")
except OpTestError:
print "There is a failure in updating one of NVRAM partitions"
# Execute these tests in petitboot
self.console = self.cv_SYSTEM.sys_get_ipmi_console()
try:
self.cv_SYSTEM.sys_ipmi_boot_system_to_petitboot(self.console)
self.cv_IPMI.ipmi_host_set_unique_prompt(self.console)
self.cv_IPMI.run_host_cmd_on_ipmi_console("uname -a")
self.cv_IPMI.run_host_cmd_on_ipmi_console("cat /etc/os-release")
self.cv_IPMI.run_host_cmd_on_ipmi_console("nvram -v")
self.cv_IPMI.run_host_cmd_on_ipmi_console("nvram --print-config -p ibm,skiboot")
self.cv_IPMI.run_host_cmd_on_ipmi_console("nvram --print-config -p common")
self.cv_IPMI.run_host_cmd_on_ipmi_console("nvram --print-config -p lnx,oops-log")
self.cv_IPMI.run_host_cmd_on_ipmi_console("nvram --print-config -p wwwwwwwwwwww")
self.cv_IPMI.run_host_cmd_on_ipmi_console("nvram --print-vpd")
self.cv_IPMI.run_host_cmd_on_ipmi_console("nvram --print-all-vpd")
self.cv_IPMI.run_host_cmd_on_ipmi_console("nvram --print-err-log")
self.cv_IPMI.run_host_cmd_on_ipmi_console("nvram --print-event-scan")
self.cv_IPMI.run_host_cmd_on_ipmi_console("nvram --partitions")
self.cv_IPMI.run_host_cmd_on_ipmi_console("nvram --dump common")
self.cv_IPMI.run_host_cmd_on_ipmi_console("nvram --dump ibm,skiboot")
self.cv_IPMI.run_host_cmd_on_ipmi_console("nvram --dump lnx,oops-log")
self.cv_IPMI.run_host_cmd_on_ipmi_console("nvram --dump wwwwwwwwwwww")
self.cv_IPMI.run_host_cmd_on_ipmi_console("nvram --ascii common")
self.cv_IPMI.run_host_cmd_on_ipmi_console("nvram --ascii ibm,skiboot")
self.cv_IPMI.run_host_cmd_on_ipmi_console("nvram --ascii lnx,oops-log")
self.cv_IPMI.run_host_cmd_on_ipmi_console("nvram --ascii wwwwwwwwwwww")
try:
self.test_nvram_update_part_config_in_petitboot("common")
self.test_nvram_update_part_config_in_petitboot("ibm,skiboot")
self.test_nvram_update_part_config_in_petitboot("lnx,oops-log")
self.test_nvram_update_part_config_in_petitboot("wwwwwwwwwwww")
except OpTestError:
print "There is a failure in updating one of NVRAM partitions"
except:
self.cv_IPMI.ipmi_set_boot_to_disk()
self.cv_IPMI.ipmi_set_boot_to_disk()
#.........这里部分代码省略.........