]> code.ossystems Code Review - openembedded-core.git/commitdiff
oeqa/rutime: Added testcase decorators for automated runtime tests. Also added LogRes...
authorLucian Musat <georgex.l.musat@intel.com>
Fri, 25 Jul 2014 09:02:30 +0000 (12:02 +0300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 25 Jul 2014 15:54:27 +0000 (16:54 +0100)
Signed-off-by: Lucian Musat <georgex.l.musat@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
27 files changed:
meta/lib/oeqa/oetest.py
meta/lib/oeqa/runtime/buildcvs.py
meta/lib/oeqa/runtime/buildiptables.py
meta/lib/oeqa/runtime/buildsudoku.py
meta/lib/oeqa/runtime/connman.py
meta/lib/oeqa/runtime/date.py
meta/lib/oeqa/runtime/df.py
meta/lib/oeqa/runtime/dmesg.py
meta/lib/oeqa/runtime/gcc.py
meta/lib/oeqa/runtime/kernelmodule.py
meta/lib/oeqa/runtime/ldd.py
meta/lib/oeqa/runtime/logrotate.py
meta/lib/oeqa/runtime/multilib.py
meta/lib/oeqa/runtime/pam.py
meta/lib/oeqa/runtime/perl.py
meta/lib/oeqa/runtime/python.py
meta/lib/oeqa/runtime/rpm.py
meta/lib/oeqa/runtime/scanelf.py
meta/lib/oeqa/runtime/scp.py
meta/lib/oeqa/runtime/skeletoninit.py
meta/lib/oeqa/runtime/smart.py
meta/lib/oeqa/runtime/ssh.py
meta/lib/oeqa/runtime/syslog.py
meta/lib/oeqa/runtime/systemd.py
meta/lib/oeqa/runtime/vnc.py
meta/lib/oeqa/runtime/x32lib.py
meta/lib/oeqa/runtime/xorg.py

index ecb8e5370582ff974da16a5e5e7a35fb2eed1213..dcbd498fca3f8f56d845878d47ae4b790c493a34 100644 (file)
@@ -10,6 +10,7 @@
 import os, re, mmap
 import unittest
 import inspect
+from oeqa.utils.decorators import LogResults
 
 def loadTests(tc):
 
@@ -35,6 +36,7 @@ def runTests(tc):
 
     return result
 
+@LogResults
 class oeTest(unittest.TestCase):
 
     longMessage = True
index 6201ed1a431f7879c7b1b56d7437abac4aef3d21..fe6cbfbcd5bf3bfd0e30a2393e61524be03d744a 100644 (file)
@@ -14,6 +14,7 @@ class BuildCvsTest(oeRuntimeTest):
                         "http://ftp.gnu.org/non-gnu/cvs/source/feature/1.12.13/cvs-1.12.13.tar.bz2")
         self.project.download_archive()
 
+    @testcase(205)
     @skipUnlessPassed("test_ssh")
     def test_cvs(self):
         self.assertEqual(self.project.run_configure(), 0,
index c77b11452c47df12fb399cfcc85017968cc95097..09e252df8c4f0979afb28f8b7c2ff8324fb0ade4 100644 (file)
@@ -14,6 +14,7 @@ class BuildIptablesTest(oeRuntimeTest):
                         "http://netfilter.org/projects/iptables/files/iptables-1.4.13.tar.bz2")
         self.project.download_archive()
 
+    @testcase(206)
     @skipUnlessPassed("test_ssh")
     def test_iptables(self):
         self.assertEqual(self.project.run_configure(), 0,
index f51af92ec62b35999cdb53bab909334391b9a7f1..802b060010c6f2e05eb840ba869c204c2ab97055 100644 (file)
@@ -14,6 +14,7 @@ class SudokuTest(oeRuntimeTest):
                         "http://downloads.sourceforge.net/project/sudoku-savant/sudoku-savant/sudoku-savant-1.3/sudoku-savant-1.3.tar.bz2")
         self.project.download_archive()
 
+    @testcase(207)
     @skipUnlessPassed("test_ssh")
     def test_sudoku(self):
         self.assertEqual(self.project.run_configure(), 0,
index c03688206f6d91b1fbb95629269b8c82612fb55f..cc537f7766bea8e0fc58d8f593cd1d452fe7e54e 100644 (file)
@@ -21,7 +21,7 @@ class ConnmanTest(oeRuntimeTest):
         (status, output) = self.target.run('/usr/sbin/connmand --help')
         self.assertEqual(status, 0, msg="status and output: %s and %s" % (status,output))
 
-
+    @testcase(221)
     @skipUnlessPassed('test_connmand_help')
     def test_connmand_running(self):
         (status, output) = self.target.run(oeRuntimeTest.pscmd + ' | grep [c]onnmand')
index a208e29ada018ad728955dd70cd484c507553c86..97e8ee42ad049d9b65cc28e2ef68f2016cd298a0 100644 (file)
@@ -4,6 +4,7 @@ import re
 
 class DateTest(oeRuntimeTest):
 
+    @testcase(211)
     @skipUnlessPassed("test_ssh")
     def test_date(self):
         (status, output) = self.target.run('date +"%Y-%m-%d %T"')
index b6da35027c1216a70db4760f6b45950105594781..09569d5ff60a9187ccaf7d08ed2a81db3a3f8de7 100644 (file)
@@ -5,6 +5,7 @@ from oeqa.utils.decorators import *
 
 class DfTest(oeRuntimeTest):
 
+    @testcase(234)
     @skipUnlessPassed("test_ssh")
     def test_df(self):
         (status,output) = self.target.run("df / | sed -n '2p' | awk '{print $4}'")
index 64247ea704c68783169400575a46a46d0ac2503b..43e16c3f7938df8c9182e7b1f6aa984936130507 100644 (file)
@@ -5,6 +5,7 @@ from oeqa.utils.decorators import *
 
 class DmesgTest(oeRuntimeTest):
 
+    @testcase(215)
     @skipUnlessPassed('test_ssh')
     def test_dmesg(self):
         (status, output) = self.target.run('dmesg | grep -v mmci-pl18x | grep -v "error changing net interface name" | grep -iv "dma timeout" | grep -i error')
index b63badd3e4680c0ec7617e5d284f04b7d2912fa6..08b3cf1230d179448590ea6b4c472d04787e522b 100644 (file)
@@ -15,18 +15,21 @@ class GccCompileTest(oeRuntimeTest):
         oeRuntimeTest.tc.target.copy_to(os.path.join(oeRuntimeTest.tc.filesdir, "test.c"), "/tmp/test.c")
         oeRuntimeTest.tc.target.copy_to(os.path.join(oeRuntimeTest.tc.filesdir, "testmakefile"), "/tmp/testmakefile")
 
+    @testcase(203)
     def test_gcc_compile(self):
         (status, output) = self.target.run('gcc /tmp/test.c -o /tmp/test -lm')
         self.assertEqual(status, 0, msg="gcc compile failed, output: %s" % output)
         (status, output) = self.target.run('/tmp/test')
         self.assertEqual(status, 0, msg="running compiled file failed, output %s" % output)
 
+    @testcase(200)
     def test_gpp_compile(self):
         (status, output) = self.target.run('g++ /tmp/test.c -o /tmp/test -lm')
         self.assertEqual(status, 0, msg="g++ compile failed, output: %s" % output)
         (status, output) = self.target.run('/tmp/test')
         self.assertEqual(status, 0, msg="running compiled file failed, output %s" % output)
 
+    @testcase(204)
     def test_make(self):
         (status, output) = self.target.run('cd /tmp; make -f testmakefile')
         self.assertEqual(status, 0, msg="running make failed, output %s" % output)
index cbc5742effa8a96431dc5168dda95e3f233e67a0..2e81720327eb7692ed58094d8d70335f05342918 100644 (file)
@@ -14,6 +14,7 @@ class KernelModuleTest(oeRuntimeTest):
         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")
 
+    @testcase('316')
     @skipUnlessPassed('test_ssh')
     @skipUnlessPassed('test_gcc_compile')
     def test_kernel_module(self):
index 079130f8334d606698954d31fb695857e0ffb8ee..bce56c42702046f71ddc3e0362cad7a844293e58 100644 (file)
@@ -13,6 +13,7 @@ class LddTest(oeRuntimeTest):
         (status, output) = self.target.run('which ldd')
         self.assertEqual(status, 0, msg = "ldd does not exist in PATH: which ldd: %s" % output)
 
+    @testcase(239)
     @skipUnlessPassed('test_ldd_exists')
     def test_ldd_rtldlist_check(self):
         (status, output) = self.target.run('for i in $(which ldd | xargs cat | grep "^RTLDLIST"|cut -d\'=\' -f2|tr -d \'"\'); do test -f $i && echo $i && break; done')
index 80489a32671fb07d4103e976b8667282edb9e71d..86d791c300a608309e793166a2adba9054c2b3b4 100644 (file)
@@ -19,6 +19,7 @@ class LogrotateTest(oeRuntimeTest):
         (status, output) = self.target.run("sed -i 's#wtmp {#wtmp {\\n    olddir /home/root/logrotate_dir#' /etc/logrotate.conf")
         self.assertEqual(status, 0, msg = "Could not write to logrotate.conf file. Status and output: %s and %s)" % (status, output))
 
+    @testcase(289)
     @skipUnlessPassed("test_1_logrotate_setup")
     def test_2_logrotate(self):
         (status, output) = self.target.run('logrotate -f /etc/logrotate.conf')
index 13a3b54b184683d8e60b5328152c7dc4d7d837c9..ab0a6ccd6911279e50c5081f58483eba9968c315 100644 (file)
@@ -10,6 +10,7 @@ def setUpModule():
 
 class MultilibTest(oeRuntimeTest):
 
+    @testcase('279')
     @skipUnlessPassed('test_ssh')
     def test_file_connman(self):
         self.assertTrue(oeRuntimeTest.hasPackage('connman-gnome'), msg="This test assumes connman-gnome is installed")
index c26e6ea849e792b2fb3b15ee4a885fd802fc77c1..ae50f7906170acd692a3797ef3708b886e016ea7 100644 (file)
@@ -12,6 +12,7 @@ def setUpModule():
 
 class PamBasicTest(oeRuntimeTest):
 
+    @testcase(287)
     @skipUnlessPassed('test_ssh')
     def test_pam(self):
         (status, output) = self.target.run('login --help')
index c9bb684c11b1c4c120f6afceb097fc5354b2d650..65da028d4ba0227a2057305eed40ca56a6cb5f20 100644 (file)
@@ -18,6 +18,7 @@ class PerlTest(oeRuntimeTest):
         (status, output) = self.target.run('which perl')
         self.assertEqual(status, 0, msg="Perl binary not in PATH or not on target.")
 
+    @testcase(208)
     def test_perl_works(self):
         (status, output) = self.target.run('perl /tmp/test.pl')
         self.assertEqual(status, 0, msg="Exit status was not 0. Output: %s" % output)
index c037ab2c1858a363bf9c7b3896b0fa6ef9899863..0387b9a03e50b21ead988e11c14269c4a11f8928 100644 (file)
@@ -18,6 +18,7 @@ class PythonTest(oeRuntimeTest):
         (status, output) = self.target.run('which python')
         self.assertEqual(status, 0, msg="Python binary not in PATH or not on target.")
 
+    @testcase(965)
     def test_python_stdout(self):
         (status, output) = self.target.run('python /tmp/test.py')
         self.assertEqual(status, 0, msg="Exit status was not 0. Output: %s" % output)
index 084d22f96bb5d57fcd8df739a0d33cbc6d00b1dc..b17e8b46a8f669d3f0af7a59bbed4a7f729095c9 100644 (file)
@@ -18,6 +18,7 @@ class RpmBasicTest(oeRuntimeTest):
         (status, output) = self.target.run('rpm --help')
         self.assertEqual(status, 0, msg="status and output: %s and %s" % (status,output))
 
+    @testcase(191)
     @skipUnlessPassed('test_rpm_help')
     def test_rpm_query(self):
         (status, output) = self.target.run('rpm -q rpm')
@@ -34,11 +35,13 @@ class RpmInstallRemoveTest(oeRuntimeTest):
             testrpmfile = f
         oeRuntimeTest.tc.target.copy_to(os.path.join(rpmdir,testrpmfile), "/tmp/rpm-doc.rpm")
 
+    @testcase(192)
     @skipUnlessPassed('test_rpm_help')
     def test_rpm_install(self):
         (status, output) = self.target.run('rpm -ivh /tmp/rpm-doc.rpm')
         self.assertEqual(status, 0, msg="Failed to install rpm-doc package: %s" % output)
 
+    @testcase(194)
     @skipUnlessPassed('test_rpm_install')
     def test_rpm_remove(self):
         (status,output) = self.target.run('rpm -e rpm-doc')
index b9abf24640ff22ac7e1b69a3d5d0e9fac53b58bd..43a024ab9a3471b7e49a73b0cf43bc89d65ad121 100644 (file)
@@ -11,6 +11,7 @@ class ScanelfTest(oeRuntimeTest):
     def setUp(self):
         self.scancmd = 'scanelf --quiet --recursive --mount --ldpath --path'
 
+    @testcase(966)
     @skipUnlessPassed('test_ssh')
     def test_scanelf_textrel(self):
         # print TEXTREL information
@@ -18,6 +19,7 @@ class ScanelfTest(oeRuntimeTest):
         (status, output) = self.target.run(self.scancmd)
         self.assertEqual(output.strip(), "", "\n".join([self.scancmd, output]))
 
+    @testcase(967)
     @skipUnlessPassed('test_ssh')
     def test_scanelf_rpath(self):
         # print RPATH information
index 03095bf966d10a5e481011bc7ce653fde56204e9..48e87d2d0bba5f8bc057266f0ebd7422efb9b87d 100644 (file)
@@ -1,6 +1,6 @@
 import os
 from oeqa.oetest import oeRuntimeTest, skipModule
-from oeqa.utils.decorators import skipUnlessPassed
+from oeqa.utils.decorators import skipUnlessPassed, testcase
 
 def setUpModule():
     if not (oeRuntimeTest.hasPackage("dropbear") or oeRuntimeTest.hasPackage("openssh-sshd")):
@@ -8,6 +8,7 @@ def setUpModule():
 
 class ScpTest(oeRuntimeTest):
 
+    @testcase(220)
     @skipUnlessPassed('test_ssh')
     def test_scp_file(self):
         test_log_dir = oeRuntimeTest.tc.d.getVar("TEST_LOG_DIR", True)
index ddcad203d971b9795e729abc3ebd7e27ff650bd0..7c7f402e5d6e0e5c5487641c93ebf70bda77f818 100644 (file)
@@ -20,6 +20,7 @@ class SkeletonBasicTest(oeRuntimeTest):
         (status, output) =  self.target.run('ls /usr/sbin/skeleton-test')
         self.assertEqual(status, 0, msg = "skeleton-test not found. Output:\n%s" % output)
 
+    @testcase(284)
     @skipUnlessPassed('test_skeleton_availability')
     @unittest.skipIf("systemd" == oeRuntimeTest.tc.d.getVar("VIRTUAL-RUNTIME_init_manager"), "Not appropiate for systemd image")
     def test_skeleton_script(self):
index 3130373f4bb331800580a84e11df4e56b735433c..3b49314df706afe5bfbe3a240f0687f6ff60deef 100644 (file)
@@ -25,6 +25,7 @@ class SmartTest(oeRuntimeTest):
 
 class SmartBasicTest(SmartTest):
 
+    @testcase(716)
     @skipUnlessPassed('test_ssh')
     def test_smart_help(self):
         self.smart('--help')
@@ -32,15 +33,19 @@ class SmartBasicTest(SmartTest):
     def test_smart_version(self):
         self.smart('--version')
 
+    @testcase(721)
     def test_smart_info(self):
         self.smart('info python-smartpm')
 
+    @testcase(421)
     def test_smart_query(self):
         self.smart('query python-smartpm')
 
+    @testcase(720)
     def test_smart_search(self):
         self.smart('search python-smartpm')
 
+    @testcase(722)
     def test_smart_stats(self):
         self.smart('stats')
 
@@ -58,6 +63,7 @@ class SmartRepoTest(SmartTest):
     def test_smart_channel(self):
         self.smart('channel', 1)
 
+    @testcase(719)
     def test_smart_channel_add(self):
         image_pkgtype = self.tc.d.getVar('IMAGE_PKGTYPE', True)
         deploy_url = 'http://%s:%s/%s' %(self.target.server_ip, self.repo_server.port, image_pkgtype)
@@ -76,6 +82,7 @@ class SmartRepoTest(SmartTest):
     def test_smart_channel_show(self):
         self.smart('channel --show')
 
+    @testcase(717)
     def test_smart_channel_rpmsys(self):
         self.smart('channel --show rpmsys')
         self.smart('channel --disable rpmsys')
@@ -86,17 +93,20 @@ class SmartRepoTest(SmartTest):
         self.smart('remove -y psplash-default')
         self.smart('install -y psplash-default')
 
+    @testcase(728)
     @skipUnlessPassed('test_smart_install')
     def test_smart_install_dependency(self):
         self.smart('remove -y psplash')
         self.smart('install -y psplash-default')
 
+    @testcase(723)
     @skipUnlessPassed('test_smart_channel_add')
     def test_smart_install_from_disk(self):
         self.smart('remove -y psplash-default')
         self.smart('download psplash-default')
         self.smart('install -y ./psplash-default*')
 
+    @testcase(725)
     @skipUnlessPassed('test_smart_channel_add')
     def test_smart_install_from_http(self):
         output = self.smart('download --urls psplash-default')
@@ -105,6 +115,7 @@ class SmartRepoTest(SmartTest):
         self.smart('remove -y psplash-default')
         self.smart('install -y %s' % url.group(0))
 
+    @testcase(729)
     @skipUnlessPassed('test_smart_install')
     def test_smart_reinstall(self):
         self.smart('reinstall -y psplash-default')
index e64866019f95e9775f37b000dd87ed5f56468bee..0e76d5d512409c5ef79935cc6fb2dc6e887ad5a0 100644 (file)
@@ -10,6 +10,7 @@ def setUpModule():
 
 class SshTest(oeRuntimeTest):
 
+    @testcase(224)
     @skipUnlessPassed('test_ping')
     def test_ssh(self):
         (status, output) = self.target.run('uname -a')
index b95b36175a46218c717a9f4bb16c7e6b1ca88551..7fa018e97fcad95328c305b0fcf6150bc2a449f7 100644 (file)
@@ -13,6 +13,7 @@ class SyslogTest(oeRuntimeTest):
         (status,output) = self.target.run('/sbin/syslogd --help')
         self.assertEqual(status, 0, msg="status and output: %s and %s" % (status,output))
 
+    @testcase(201)
     @skipUnlessPassed("test_syslog_help")
     def test_syslog_running(self):
         (status,output) = self.target.run(oeRuntimeTest.pscmd + ' | grep -i [s]yslogd')
@@ -33,6 +34,7 @@ class SyslogTestConfig(oeRuntimeTest):
         else:
             (status,output) = self.target.run('systemctl restart syslog.service')
 
+    @testcase(202)
     @skipUnlessPassed("test_syslog_restart")
     @skipUnlessPassed("test_syslog_logger")
     @unittest.skipIf("systemd" == oeRuntimeTest.tc.d.getVar("VIRTUAL-RUNTIME_init_manager"), "Not appropiate for systemd image")
index 6de84f891bbb34cba5d34001b9f24af34e73a001..1451698bb39a2ae31ee49757560ea7d99cb7d256 100644 (file)
@@ -28,6 +28,7 @@ class SystemdBasicTests(SystemdTest):
     def test_systemd_basic(self):
         self.systemctl('--version')
 
+    @testcase(551)
     @skipUnlessPassed('test_system_basic')
     def test_systemd_list(self):
         self.systemctl('list-unit-files')
@@ -51,6 +52,7 @@ class SystemdBasicTests(SystemdTest):
                 return (False, output)
             time.sleep(10)
 
+    @testcase(550)
     @skipUnlessPassed('test_systemd_basic')
     def test_systemd_failed(self):
         settled, output = self.settle()
@@ -69,6 +71,7 @@ class SystemdServiceTests(SystemdTest):
     def test_systemd_status(self):
         self.systemctl('status --full', 'avahi-daemon.service')
 
+    @testcase(695)
     @skipUnlessPassed('test_systemd_status')
     def test_systemd_stop_start(self):
         self.systemctl('stop', 'avahi-daemon.service')
@@ -76,6 +79,7 @@ class SystemdServiceTests(SystemdTest):
         self.systemctl('start','avahi-daemon.service')
         self.systemctl('is-active', 'avahi-daemon.service', verbose=True)
 
+    @testcase(696)
     @skipUnlessPassed('test_systemd_basic')
     def test_systemd_disable_enable(self):
         self.systemctl('disable', 'avahi-daemon.service')
index 1b4652b939440dbd6e0c2cba34b8ea96cf3e0caa..f31deff3062d8576d9ea6deae2be0677d41720a6 100644 (file)
@@ -7,6 +7,7 @@ def setUpModule():
 
 class VNCTest(oeRuntimeTest):
 
+    @testcase(213)
     @skipUnlessPassed('test_ssh')
     def test_vnc(self):
         (status, output) = self.target.run('x11vnc -display :0 -bg -o x11vnc.log')
index 6bad201b12bfbe685575551a61f4c85f3f4ed532..ce5e2140355970be5c9076a7b5a80fad61e936a4 100644 (file)
@@ -10,6 +10,7 @@ def setUpModule():
 
 class X32libTest(oeRuntimeTest):
 
+    @testcase(281)
     @skipUnlessPassed("test_ssh")
     def test_x32_file(self):
         status1 = self.target.run("readelf -h /bin/ls | grep Class | grep ELF32")[0]
index 12dccd81983df6a03b49133262ad82e4d2a6d05b..7aa61ad6aba06283b06206abf247e19be9ba921a 100644 (file)
@@ -14,6 +14,7 @@ class XorgTest(oeRuntimeTest):
         (status, output) = self.target.run(oeRuntimeTest.pscmd + ' |  grep -v xinit | grep [X]org')
         self.assertEqual(status, 0, msg="Xorg does not appear to be running %s" % self.target.run(oeRuntimeTest.pscmd)[1])
 
+    @testcase(972)
     @skipUnlessPassed('test_ssh')
     def test_xorg_error(self):
         (status, output) = self.target.run('cat /var/log/Xorg.0.log | grep -v "(EE) error," | grep -v "PreInit" | grep -v "evdev:" | grep -v "glx" | grep "(EE)"')