Fairly basic tests. They work so far with FC18, and I'm working on testing with RHEL & SLES.
Signed-off-by: Nishanth Aravamudan <[email protected]> --- Not requesting inclusion yet. diff --git a/kdump/control b/kdump/control new file mode 100644 index 0000000..41a5f11 --- /dev/null +++ b/kdump/control @@ -0,0 +1,18 @@ +NAME = 'Kdump Test' +AUTHOR = '[email protected] (Nish Aravamudan)' +TIME = 'SHORT' +TEST_CLASS = 'Software' +TEST_CATEGORY = 'Functional' +TEST_TYPE = 'server' +RUN_VERIFY = False + +DOC = """ +Runs a simple kdump of the existing kernel and initrd. +""" + +def run(machine): + host = hosts.create_host(machine, initialize=False) + job.run_test('kdump', host=host, disable_sysinfo=True) + +job.parallel_simple(run, machines) + diff --git a/kdump/kdump.py b/kdump/kdump.py new file mode 100644 index 0000000..0a626f5 --- /dev/null +++ b/kdump/kdump.py @@ -0,0 +1,25 @@ +from autotest.server import test, autotest_remote +from autotest.client.shared import error, software_manager + +client_control_file = """from autotest.client.shared import software_manager +s = software_manager.SoftwareManager() +if not s.check_installed('kexec-tools'): + s.install('kexec-tools') +""" + +class kdump(test.test): + version = 1 + + def execute(self, host): + try: + at = autotest_remote.Autotest() + at.run(client_control_file, host=host) + host.reboot(kernel_args='crashkernel=512M-2G:64M,2G-8G:128M,8G-:256M') + # assumes you have built a kernel first and are running that kernel + host.run('ln -s /boot/vmlinux-autotest /boot/vmlinuz-`uname -r`') + host.run('service kdump start') + host.run('echo c > /proc/sysrq-trigger', ignore_status=True) + + host.wait_up(timeout=600) + except Exception, e: + raise error.TestError("Verify failed: " + str(e)) diff --git a/kexec/control b/kexec/control new file mode 100644 index 0000000..a770d0d --- /dev/null +++ b/kexec/control @@ -0,0 +1,18 @@ +NAME = 'Kexec Test' +AUTHOR = '[email protected] (Nish Aravamudan)' +TIME = 'SHORT' +TEST_CLASS = 'Software' +TEST_CATEGORY = 'Functional' +TEST_TYPE = 'server' +RUN_VERIFY = False + +DOC = """ +Runs a simple kexec of the existing kernel and initrd. +""" + +def run(machine): + host = hosts.create_host(machine, initialize=False) + job.run_test('kexec', host=host, disable_sysinfo=True) + +job.parallel_simple(run, machines) + diff --git a/kexec/kexec.py b/kexec/kexec.py new file mode 100644 index 0000000..83eed91 --- /dev/null +++ b/kexec/kexec.py @@ -0,0 +1,23 @@ +from autotest.server import test, autotest_remote +from autotest.client.shared import error, software_manager + +client_control_file = """from autotest.client.shared import software_manager +s = software_manager.SoftwareManager() +if not s.check_installed('kexec-tools'): + s.install('kexec-tools') +""" + +class kexec(test.test): + version = 1 + + def execute(self, host): + try: + at = autotest_remote.Autotest() + at.run(client_control_file, host=host) + # assumes you have built a kernel first + host.run('kexec -l --initrd=/boot/initrd-autotest /boot/vmlinux-autotest --append=`cat /proc/cmdline`') + host.run('kexec -e', ignore_status=True) + + host.wait_up(timeout=300) + except Exception, e: + raise error.TestError("Verify failed: " + str(e)) _______________________________________________ Autotest-kernel mailing list [email protected] https://www.redhat.com/mailman/listinfo/autotest-kernel
