diff options
author | Adrian Lane <adrian.lane@canonical.com> | 2020-04-15 13:59:05 -0700 |
---|---|---|
committer | Adrian Lane <adrian.lane@canonical.com> | 2020-04-15 13:59:05 -0700 |
commit | 3173090c23e56cdf7a78415f1f2726734d85b40f (patch) | |
tree | 09050e152e5470c4651d9138b21025718cb6a2f9 /bin | |
parent | 6008bcbd72e8e5ba17d8086710aca2580f71641a (diff) |
Updated ipmi_channel_hlpr().
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/ipmi_test.py | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/bin/ipmi_test.py b/bin/ipmi_test.py index 68d19db6..0f7b6456 100755 --- a/bin/ipmi_test.py +++ b/bin/ipmi_test.py @@ -57,7 +57,7 @@ class IpmiTest(object): 'sudo', self.path_ipmi_chassis, '--get-status'] self.cmd_ipmi_channel = [ 'sudo', self.path_ipmi_config, '--checkout', - '--lan-channel-number', 0] + '--lan-channel-number'] self.cmd_bmc_info = [ 'sudo', self.path_bmc_info] self.cmd_ipmi_locate = [ @@ -114,6 +114,19 @@ class IpmiTest(object): else: logging.info(f'Error calling {subtest}!\n') + # initialize kernel modules and run ipmi tests + def run_test(self): + # load/val kernel modules + self.kernel_mods() + # tally results + results = [self.impi_chassis(), + self.pwr_status(), + self.ipmi_channel(), + self.bmc_info(), + self.ipmi_version(), + self.ipmi_locate()] + return results + # kernel_mods() helper function to call modprobe def modprobe_hlpr(self, module): try: @@ -128,19 +141,6 @@ class IpmiTest(object): else: logging.info(f'- Successfully loaded module {module}') - # initialize kernel modules and run ipmi tests - def run_test(self): - # load/val kernel modules - self.kernel_mods() - # tally results - results = [self.impi_chassis(), - self.pwr_status(), - self.ipmi_channel(), - self.bmc_info(), - self.ipmi_version(), - self.ipmi_locate()] - return results - # check (and load) kernel modules def kernel_mods(self): logging.info('-----------------------') @@ -193,7 +193,8 @@ class IpmiTest(object): def ipmi_channel_hlpr(self, i, matches, channel): regex = re.compile('Section User') cmd = self.cmd_ipmi_channel - cmd.pop(len(cmd) - 1) + if (len(cmd)) > 4: + cmd.pop(len(cmd) - 1) cmd.append(str(i)) output = self.subproc_logging(cmd) for line in output.rstrip().split('\n'): |