On 20.02.2013 [11:51:32 -0300], Lucas Meneghel Rodrigues wrote:
> On 02/19/2013 05:58 PM, Nishanth Aravamudan wrote:
> >Fairly basic tests. They work so far with FC18, and I'm working on
> >testing with RHEL & SLES.
>
> Nice, great start! Minor comments follow:
>
> >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')
> >+"""
>
> ^ Great - what you can do here, in case the package name differs
> among distros, is to have a mapping distro/package names, get the os
> vendor with autotest.client.utils.get_os_vendor(), then select the
> package name based on it.
Yep, I saw Cleber's patch from a while back that did something similar.
I'll use that as my basis.
I think that could also be an extension later, right? And I could fail
for non-Fedora. Or something :)
> >+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:
>
> I'd say error.AutoservError here is better than the catch all.
Good call, I was mimicking the other server tests ;) They may need
updates too.
> >+ 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')
> >+"""
>
> Same comment about distro mapping applies.
Yep.
> >+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
>
> What about providing a test that can (optionally) build a kernel
> from git and then use kexec?
Yeah, that was going to be my next fix. I need to figure out what the
best way to funnel that change in, as I want to make it as easy to run,
as possible from the website. But I can easily make it part of the
description.
Thanks for the feedback!
Nish
_______________________________________________
Autotest-kernel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/autotest-kernel