Skip to content

Commit fba3096

Browse files
authored
Merge pull request #536 from hegdevasant/mpipl-rework
[MPIPL] Rework for new Device Tree format
2 parents 7c3dadf + be374ff commit fba3096

File tree

2 files changed

+154
-61
lines changed

2 files changed

+154
-61
lines changed

common/OpTestHost.py

+30
Original file line numberDiff line numberDiff line change
@@ -634,6 +634,36 @@ def host_clear_all_dumps(self, console=0):
634634
(BMC_CONST.OPAL_DUMP_SYSFS_DIR, entry), console=console)
635635
return True
636636

637+
def host_check_pkg_installed(self, i_oslevel, package, console=0):
638+
'''
639+
This function will check whether particular package is installed or not
640+
The `i_oslevel` is used to determine if we should use `dpkg` or `rpm` to
641+
search for the package name.
642+
'''
643+
l_cmd = ""
644+
if 'Ubuntu' in i_oslevel:
645+
l_cmd = "dpkg -l %s" % package
646+
else:
647+
l_cmd = "rpm -q %s" % package
648+
649+
try:
650+
self.host_run_command(l_cmd, timeout=60, console=console)
651+
return True
652+
except CommandFailed:
653+
return False
654+
655+
def host_check_pkg_kdump(self, i_oslevel, console=0):
656+
'''
657+
This function will check whether kdump package is installed or not
658+
'''
659+
l_pkg = ""
660+
if 'Ubuntu' in i_oslevel:
661+
l_pkg = "kdump-tools"
662+
else:
663+
l_pkg = "kexec-tools"
664+
665+
return self.host_check_pkg_installed(i_oslevel, l_pkg, console)
666+
637667
def host_disable_kdump_service(self, os_level, console=0):
638668
'''
639669
This function disables kdump service. Needs the OS version (from `/etc/os-release`) to

0 commit comments

Comments
 (0)