diff options
author | Tudor Florea <tudor.florea@enea.com> | 2014-10-16 03:05:19 +0200 |
---|---|---|
committer | Tudor Florea <tudor.florea@enea.com> | 2014-10-16 03:05:19 +0200 |
commit | c527fd1f14c27855a37f2e8ac5346ce8d940ced2 (patch) | |
tree | bb002c1fdf011c41dbd2f0927bed23ecb5f83c97 /meta/lib/oeqa/runtime/kernelmodule.py | |
download | poky-daisy-140929.tar.gz |
initial commit for Enea Linux 4.0-140929daisy-140929
Migrated from the internal git server on the daisy-enea-point-release branch
Signed-off-by: Tudor Florea <tudor.florea@enea.com>
Diffstat (limited to 'meta/lib/oeqa/runtime/kernelmodule.py')
-rw-r--r-- | meta/lib/oeqa/runtime/kernelmodule.py | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/meta/lib/oeqa/runtime/kernelmodule.py b/meta/lib/oeqa/runtime/kernelmodule.py new file mode 100644 index 0000000000..cbc5742eff --- /dev/null +++ b/meta/lib/oeqa/runtime/kernelmodule.py | |||
@@ -0,0 +1,33 @@ | |||
1 | import unittest | ||
2 | import os | ||
3 | from oeqa.oetest import oeRuntimeTest, skipModule | ||
4 | from oeqa.utils.decorators import * | ||
5 | |||
6 | def setUpModule(): | ||
7 | if not oeRuntimeTest.hasFeature("tools-sdk"): | ||
8 | skipModule("Image doesn't have tools-sdk in IMAGE_FEATURES") | ||
9 | |||
10 | |||
11 | class KernelModuleTest(oeRuntimeTest): | ||
12 | |||
13 | def setUp(self): | ||
14 | self.target.copy_to(os.path.join(oeRuntimeTest.tc.filesdir, "hellomod.c"), "/tmp/hellomod.c") | ||
15 | self.target.copy_to(os.path.join(oeRuntimeTest.tc.filesdir, "hellomod_makefile"), "/tmp/Makefile") | ||
16 | |||
17 | @skipUnlessPassed('test_ssh') | ||
18 | @skipUnlessPassed('test_gcc_compile') | ||
19 | def test_kernel_module(self): | ||
20 | cmds = [ | ||
21 | 'cd /usr/src/kernel && make scripts', | ||
22 | 'cd /tmp && make', | ||
23 | 'cd /tmp && insmod hellomod.ko', | ||
24 | 'lsmod | grep hellomod', | ||
25 | 'dmesg | grep Hello', | ||
26 | 'rmmod hellomod', 'dmesg | grep "Cleaning up hellomod"' | ||
27 | ] | ||
28 | for cmd in cmds: | ||
29 | (status, output) = self.target.run(cmd, 900) | ||
30 | self.assertEqual(status, 0, msg="\n".join([cmd, output])) | ||
31 | |||
32 | def tearDown(self): | ||
33 | self.target.run('rm -f /tmp/Makefile /tmp/hellomod.c') | ||