From b39c61f2d442c79d03b73e8ffd104996fcb2177e Mon Sep 17 00:00:00 2001 From: Mariano Lopez Date: Tue, 1 Nov 2016 07:48:16 +0000 Subject: oeqa/runtime/cases: Migrate runtime tests. This migrates current runtime test suite to be used with the new framework. [YOCTO #10234] Signed-off-by: Mariano Lopez --- meta/lib/oeqa/runtime/cases/kernelmodule.py | 40 +++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 meta/lib/oeqa/runtime/cases/kernelmodule.py (limited to 'meta/lib/oeqa/runtime/cases/kernelmodule.py') diff --git a/meta/lib/oeqa/runtime/cases/kernelmodule.py b/meta/lib/oeqa/runtime/cases/kernelmodule.py new file mode 100644 index 0000000000..11ad7b7f01 --- /dev/null +++ b/meta/lib/oeqa/runtime/cases/kernelmodule.py @@ -0,0 +1,40 @@ +import os + +from oeqa.runtime.case import OERuntimeTestCase +from oeqa.core.decorator.depends import OETestDepends +from oeqa.core.decorator.oeid import OETestID +from oeqa.core.decorator.data import skipIfNotFeature + +class KernelModuleTest(OERuntimeTestCase): + + @classmethod + def setUpClass(cls): + src = os.path.join(cls.tc.runtime_files_dir, 'hellomod.c') + dst = '/tmp/hellomod.c' + cls.tc.target.copyTo(src, dst) + + src = os.path.join(cls.tc.runtime_files_dir, 'hellomod_makefile') + dst = '/tmp/Makefile' + cls.tc.target.copyTo(src, dst) + + @classmethod + def tearDownClass(cls): + files = '/tmp/Makefile /tmp/hellomod.c' + cls.tc.target.run('rm %s' % files) + + @OETestID(1541) + @skipIfNotFeature('tools-sdk', + 'Test requires tools-sdk to be in IMAGE_FEATURES') + @OETestDepends(['gcc.GccCompileTest.test_gcc_compile']) + def test_kernel_module(self): + cmds = [ + 'cd /usr/src/kernel && make scripts', + 'cd /tmp && make', + 'cd /tmp && insmod hellomod.ko', + 'lsmod | grep hellomod', + 'dmesg | grep Hello', + 'rmmod hellomod', 'dmesg | grep "Cleaning up hellomod"' + ] + for cmd in cmds: + status, output = self.target.run(cmd, 900) + self.assertEqual(status, 0, msg='\n'.join([cmd, output])) -- cgit 1.2.3-korg