aboutsummaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/runtime/kernelmodule.py
diff options
context:
space:
mode:
authorStefan Stanacar <stefanx.stanacar@intel.com>2013-10-18 10:23:44 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-10-18 15:58:16 +0100
commitd3cb36936521b69c826f2a6da4ccdf2b278b529d (patch)
tree31dca9d76e4362a8149fe453212f7156e073adbe /meta/lib/oeqa/runtime/kernelmodule.py
parent67378fbcbe8a418c81ef42589fb6fba704c36bdf (diff)
downloadopenembedded-core-contrib-d3cb36936521b69c826f2a6da4ccdf2b278b529d.tar.gz
lib/oeqa/runtime: build kernel module on target test
Builds a simple Hello World module on target. Added to the defaults for core-image-sato-sdk. (From OE-Core rev: c61c3dee162aa1f5bf31b2a09d8b916dc1712056) Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/runtime/kernelmodule.py')
-rw-r--r--meta/lib/oeqa/runtime/kernelmodule.py33
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 @@
+import unittest
+import os
+from oeqa.oetest import oeRuntimeTest, skipModule
+from oeqa.utils.decorators import *
+
+def setUpModule():
+ if not oeRuntimeTest.hasFeature("tools-sdk"):
+ skipModule("Image doesn't have tools-sdk in IMAGE_FEATURES")
+
+
+class KernelModuleTest(oeRuntimeTest):
+
+ def setUp(self):
+ self.target.copy_to(os.path.join(oeRuntimeTest.tc.filesdir, "hellomod.c"), "/tmp/hellomod.c")
+ self.target.copy_to(os.path.join(oeRuntimeTest.tc.filesdir, "hellomod_makefile"), "/tmp/Makefile")
+
+ @skipUnlessPassed('test_ssh')
+ @skipUnlessPassed('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]))
+
+ def tearDown(self):
+ self.target.run('rm -f /tmp/Makefile /tmp/hellomod.c')