diff options
Diffstat (limited to 'poky/meta/lib/oeqa/runtime/cases')
-rw-r--r-- | poky/meta/lib/oeqa/runtime/cases/buildcpio.py | 9 | ||||
-rw-r--r-- | poky/meta/lib/oeqa/runtime/cases/buildgalculator.py | 9 | ||||
-rw-r--r-- | poky/meta/lib/oeqa/runtime/cases/buildlzip.py | 12 | ||||
-rw-r--r-- | poky/meta/lib/oeqa/runtime/cases/date.py | 2 | ||||
-rw-r--r-- | poky/meta/lib/oeqa/runtime/cases/df.py | 2 | ||||
-rw-r--r-- | poky/meta/lib/oeqa/runtime/cases/gcc.py | 19 | ||||
-rw-r--r-- | poky/meta/lib/oeqa/runtime/cases/kernelmodule.py | 8 | ||||
-rw-r--r-- | poky/meta/lib/oeqa/runtime/cases/opkg.py | 4 | ||||
-rw-r--r-- | poky/meta/lib/oeqa/runtime/cases/ptest.py | 2 | ||||
-rw-r--r-- | poky/meta/lib/oeqa/runtime/cases/python.py | 8 | ||||
-rw-r--r-- | poky/meta/lib/oeqa/runtime/cases/rpm.py | 31 | ||||
-rw-r--r-- | poky/meta/lib/oeqa/runtime/cases/scp.py | 2 | ||||
-rw-r--r-- | poky/meta/lib/oeqa/runtime/cases/ssh.py | 2 | ||||
-rw-r--r-- | poky/meta/lib/oeqa/runtime/cases/stap.py | 6 | ||||
-rw-r--r-- | poky/meta/lib/oeqa/runtime/cases/xorg.py | 2 |
15 files changed, 63 insertions, 55 deletions
diff --git a/poky/meta/lib/oeqa/runtime/cases/buildcpio.py b/poky/meta/lib/oeqa/runtime/cases/buildcpio.py index 79b22d04d..a61d1e030 100644 --- a/poky/meta/lib/oeqa/runtime/cases/buildcpio.py +++ b/poky/meta/lib/oeqa/runtime/cases/buildcpio.py @@ -1,7 +1,7 @@ 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 +from oeqa.runtime.decorator.package import OEHasPackage from oeqa.runtime.utils.targetbuildproject import TargetBuildProject @@ -13,17 +13,18 @@ class BuildCpioTest(OERuntimeTestCase): cls.project = TargetBuildProject(cls.tc.target, uri, dl_dir = cls.tc.td['DL_DIR']) - cls.project.download_archive() @classmethod def tearDownClass(cls): cls.project.clean() @OETestID(205) - @skipIfNotFeature('tools-sdk', - 'Test requires tools-sdk to be in IMAGE_FEATURES') @OETestDepends(['ssh.SSHTest.test_ssh']) + @OEHasPackage(['gcc']) + @OEHasPackage(['make']) + @OEHasPackage(['autoconf']) def test_cpio(self): + self.project.download_archive() self.project.run_configure() self.project.run_make() self.project.run_install() diff --git a/poky/meta/lib/oeqa/runtime/cases/buildgalculator.py b/poky/meta/lib/oeqa/runtime/cases/buildgalculator.py index 7c9d4a392..a0a003208 100644 --- a/poky/meta/lib/oeqa/runtime/cases/buildgalculator.py +++ b/poky/meta/lib/oeqa/runtime/cases/buildgalculator.py @@ -1,7 +1,7 @@ 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 +from oeqa.runtime.decorator.package import OEHasPackage from oeqa.runtime.utils.targetbuildproject import TargetBuildProject @@ -13,16 +13,17 @@ class GalculatorTest(OERuntimeTestCase): cls.project = TargetBuildProject(cls.tc.target, uri, dl_dir = cls.tc.td['DL_DIR']) - cls.project.download_archive() @classmethod def tearDownClass(cls): cls.project.clean() @OETestID(1526) - @skipIfNotFeature('tools-sdk', - 'Test requires tools-sdk to be in IMAGE_FEATURES') @OETestDepends(['ssh.SSHTest.test_ssh']) + @OEHasPackage(['gcc']) + @OEHasPackage(['make']) + @OEHasPackage(['autoconf']) def test_galculator(self): + self.project.download_archive() self.project.run_configure() self.project.run_make() diff --git a/poky/meta/lib/oeqa/runtime/cases/buildlzip.py b/poky/meta/lib/oeqa/runtime/cases/buildlzip.py index ca3fead2e..5b455a079 100644 --- a/poky/meta/lib/oeqa/runtime/cases/buildlzip.py +++ b/poky/meta/lib/oeqa/runtime/cases/buildlzip.py @@ -1,7 +1,7 @@ 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 +from oeqa.runtime.decorator.package import OEHasPackage from oeqa.runtime.utils.targetbuildproject import TargetBuildProject @@ -14,21 +14,19 @@ class BuildLzipTest(OERuntimeTestCase): cls.project = TargetBuildProject(cls.tc.target, uri, dl_dir = cls.tc.td['DL_DIR']) - cls.project.download_archive() @classmethod def tearDownClass(cls): cls.project.clean() @OETestID(206) - @skipIfNotFeature('tools-sdk', - 'Test requires tools-sdk to be in IMAGE_FEATURES') @OETestDepends(['ssh.SSHTest.test_ssh']) + @OEHasPackage(['gcc']) + @OEHasPackage(['make']) + @OEHasPackage(['autoconf']) def test_lzip(self): + self.project.download_archive() self.project.run_configure() self.project.run_make() self.project.run_install() - @classmethod - def tearDownClass(self): - self.project.clean() diff --git a/poky/meta/lib/oeqa/runtime/cases/date.py b/poky/meta/lib/oeqa/runtime/cases/date.py index ece7338de..0887b831f 100644 --- a/poky/meta/lib/oeqa/runtime/cases/date.py +++ b/poky/meta/lib/oeqa/runtime/cases/date.py @@ -3,6 +3,7 @@ import re from oeqa.runtime.case import OERuntimeTestCase from oeqa.core.decorator.depends import OETestDepends from oeqa.core.decorator.oeid import OETestID +from oeqa.runtime.decorator.package import OEHasPackage class DateTest(OERuntimeTestCase): @@ -18,6 +19,7 @@ class DateTest(OERuntimeTestCase): @OETestID(211) @OETestDepends(['ssh.SSHTest.test_ssh']) + @OEHasPackage(['coreutils', 'busybox']) def test_date(self): (status, output) = self.target.run('date +"%Y-%m-%d %T"') msg = 'Failed to get initial date, output: %s' % output diff --git a/poky/meta/lib/oeqa/runtime/cases/df.py b/poky/meta/lib/oeqa/runtime/cases/df.py index aecc32d7c..e0b6bb839 100644 --- a/poky/meta/lib/oeqa/runtime/cases/df.py +++ b/poky/meta/lib/oeqa/runtime/cases/df.py @@ -1,11 +1,13 @@ from oeqa.runtime.case import OERuntimeTestCase from oeqa.core.decorator.depends import OETestDepends from oeqa.core.decorator.oeid import OETestID +from oeqa.runtime.decorator.package import OEHasPackage class DfTest(OERuntimeTestCase): @OETestID(234) @OETestDepends(['ssh.SSHTest.test_ssh']) + @OEHasPackage(['coreutils', 'busybox']) def test_df(self): cmd = "df / | sed -n '2p' | awk '{print $4}'" (status,output) = self.target.run(cmd) diff --git a/poky/meta/lib/oeqa/runtime/cases/gcc.py b/poky/meta/lib/oeqa/runtime/cases/gcc.py index 911083156..8265c59f2 100644 --- a/poky/meta/lib/oeqa/runtime/cases/gcc.py +++ b/poky/meta/lib/oeqa/runtime/cases/gcc.py @@ -3,12 +3,12 @@ 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 +from oeqa.runtime.decorator.package import OEHasPackage class GccCompileTest(OERuntimeTestCase): @classmethod - def setUpClass(cls): + def setUp(cls): dst = '/tmp/' src = os.path.join(cls.tc.files_dir, 'test.c') cls.tc.target.copyTo(src, dst) @@ -20,14 +20,13 @@ class GccCompileTest(OERuntimeTestCase): cls.tc.target.copyTo(src, dst) @classmethod - def tearDownClass(cls): + def tearDown(cls): files = '/tmp/test.c /tmp/test.o /tmp/test /tmp/testmakefile' cls.tc.target.run('rm %s' % files) @OETestID(203) - @skipIfNotFeature('tools-sdk', - 'Test requires tools-sdk to be in IMAGE_FEATURES') @OETestDepends(['ssh.SSHTest.test_ssh']) + @OEHasPackage(['gcc']) def test_gcc_compile(self): status, output = self.target.run('gcc /tmp/test.c -o /tmp/test -lm') msg = 'gcc compile failed, output: %s' % output @@ -38,9 +37,8 @@ class GccCompileTest(OERuntimeTestCase): self.assertEqual(status, 0, msg=msg) @OETestID(200) - @skipIfNotFeature('tools-sdk', - 'Test requires tools-sdk to be in IMAGE_FEATURES') @OETestDepends(['ssh.SSHTest.test_ssh']) + @OEHasPackage(['g++']) def test_gpp_compile(self): status, output = self.target.run('g++ /tmp/test.c -o /tmp/test -lm') msg = 'g++ compile failed, output: %s' % output @@ -51,9 +49,8 @@ class GccCompileTest(OERuntimeTestCase): self.assertEqual(status, 0, msg=msg) @OETestID(1142) - @skipIfNotFeature('tools-sdk', - 'Test requires tools-sdk to be in IMAGE_FEATURES') @OETestDepends(['ssh.SSHTest.test_ssh']) + @OEHasPackage(['g++']) def test_gpp2_compile(self): status, output = self.target.run('g++ /tmp/test.cpp -o /tmp/test -lm') msg = 'g++ compile failed, output: %s' % output @@ -64,9 +61,9 @@ class GccCompileTest(OERuntimeTestCase): self.assertEqual(status, 0, msg=msg) @OETestID(204) - @skipIfNotFeature('tools-sdk', - 'Test requires tools-sdk to be in IMAGE_FEATURES') @OETestDepends(['ssh.SSHTest.test_ssh']) + @OEHasPackage(['gcc']) + @OEHasPackage(['make']) def test_make(self): status, output = self.target.run('cd /tmp; make -f testmakefile') msg = 'running make failed, output %s' % output diff --git a/poky/meta/lib/oeqa/runtime/cases/kernelmodule.py b/poky/meta/lib/oeqa/runtime/cases/kernelmodule.py index de1a5aa44..27a2c35b7 100644 --- a/poky/meta/lib/oeqa/runtime/cases/kernelmodule.py +++ b/poky/meta/lib/oeqa/runtime/cases/kernelmodule.py @@ -4,11 +4,12 @@ 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 +from oeqa.runtime.decorator.package import OEHasPackage class KernelModuleTest(OERuntimeTestCase): @classmethod - def setUpClass(cls): + def setUp(cls): src = os.path.join(cls.tc.runtime_files_dir, 'hellomod.c') dst = '/tmp/hellomod.c' cls.tc.target.copyTo(src, dst) @@ -18,7 +19,7 @@ class KernelModuleTest(OERuntimeTestCase): cls.tc.target.copyTo(src, dst) @classmethod - def tearDownClass(cls): + def tearDown(cls): files = '/tmp/Makefile /tmp/hellomod.c' cls.tc.target.run('rm %s' % files) @@ -26,6 +27,9 @@ class KernelModuleTest(OERuntimeTestCase): @skipIfNotFeature('tools-sdk', 'Test requires tools-sdk to be in IMAGE_FEATURES') @OETestDepends(['gcc.GccCompileTest.test_gcc_compile']) + @OEHasPackage(['kernel-devsrc']) + @OEHasPackage(['make']) + @OEHasPackage(['gcc']) def test_kernel_module(self): cmds = [ 'cd /usr/src/kernel && make scripts prepare', diff --git a/poky/meta/lib/oeqa/runtime/cases/opkg.py b/poky/meta/lib/oeqa/runtime/cases/opkg.py index 29e990269..693f5d68c 100644 --- a/poky/meta/lib/oeqa/runtime/cases/opkg.py +++ b/poky/meta/lib/oeqa/runtime/cases/opkg.py @@ -16,7 +16,7 @@ class OpkgTest(OERuntimeTestCase): class OpkgRepoTest(OpkgTest): @classmethod - def setUpClass(cls): + def setUp(cls): allarchfeed = 'all' if cls.tc.td["MULTILIB_VARIANTS"]: allarchfeed = cls.tc.td["TUNE_PKGARCH"] @@ -25,7 +25,7 @@ class OpkgRepoTest(OpkgTest): cls.repo_server.start() @classmethod - def tearDownClass(cls): + def tearDown(cls): cls.repo_server.stop() def setup_source_config_for_package_install(self): diff --git a/poky/meta/lib/oeqa/runtime/cases/ptest.py b/poky/meta/lib/oeqa/runtime/cases/ptest.py index 77ae7b6b8..0972a583e 100644 --- a/poky/meta/lib/oeqa/runtime/cases/ptest.py +++ b/poky/meta/lib/oeqa/runtime/cases/ptest.py @@ -5,6 +5,7 @@ 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 +from oeqa.runtime.decorator.package import OEHasPackage from oeqa.utils.logparser import Lparser, Result class PtestRunnerTest(OERuntimeTestCase): @@ -52,6 +53,7 @@ class PtestRunnerTest(OERuntimeTestCase): @OETestID(1600) @skipIfNotFeature('ptest', 'Test requires ptest to be in DISTRO_FEATURES') @OETestDepends(['ssh.SSHTest.test_ssh']) + @OEHasPackage(['ptest-runner']) @unittest.expectedFailure def test_ptestrunner(self): status, output = self.target.run('which ptest-runner', 0) diff --git a/poky/meta/lib/oeqa/runtime/cases/python.py b/poky/meta/lib/oeqa/runtime/cases/python.py index 4419a9f63..66ab4d25f 100644 --- a/poky/meta/lib/oeqa/runtime/cases/python.py +++ b/poky/meta/lib/oeqa/runtime/cases/python.py @@ -1,16 +1,12 @@ from oeqa.runtime.case import OERuntimeTestCase from oeqa.core.decorator.depends import OETestDepends from oeqa.core.decorator.oeid import OETestID +from oeqa.runtime.decorator.package import OEHasPackage class PythonTest(OERuntimeTestCase): - @classmethod - def setUpClass(cls): - import unittest - if "python3-core" not in cls.tc.image_packages: - raise unittest.SkipTest("Python3 not on target") - @OETestID(965) @OETestDepends(['ssh.SSHTest.test_ssh']) + @OEHasPackage(['python3-core']) def test_python3(self): cmd = "python3 -c \"import codecs; print(codecs.encode('Uryyb, jbeyq', 'rot13'))\"" status, output = self.target.run(cmd) diff --git a/poky/meta/lib/oeqa/runtime/cases/rpm.py b/poky/meta/lib/oeqa/runtime/cases/rpm.py index 1e5e4631d..de92157c5 100644 --- a/poky/meta/lib/oeqa/runtime/cases/rpm.py +++ b/poky/meta/lib/oeqa/runtime/cases/rpm.py @@ -10,11 +10,6 @@ from oeqa.core.utils.path import findFile class RpmBasicTest(OERuntimeTestCase): - @classmethod - def setUpClass(cls): - if cls.tc.td['PACKAGE_CLASSES'].split()[0] != 'package_rpm': - cls.skipTest('Tests require image to be build from rpm') - @OETestID(960) @OEHasPackage(['rpm']) @OETestDepends(['ssh.SSHTest.test_ssh']) @@ -26,6 +21,9 @@ class RpmBasicTest(OERuntimeTestCase): @OETestID(191) @OETestDepends(['rpm.RpmBasicTest.test_rpm_help']) def test_rpm_query(self): + status, output = self.target.run('ls /var/lib/rpm/') + if status != 0: + self.skipTest('No /var/lib/rpm on target') status, output = self.target.run('rpm -q rpm') msg = 'status and output: %s and %s' % (status, output) self.assertEqual(status, 0, msg=msg) @@ -34,30 +32,25 @@ class RpmInstallRemoveTest(OERuntimeTestCase): @classmethod def setUpClass(cls): - if cls.tc.td['PACKAGE_CLASSES'].split()[0] != 'package_rpm': - cls.skipTest('Tests require image to be build from rpm') - pkgarch = cls.td['TUNE_PKGARCH'].replace('-', '_') rpmdir = os.path.join(cls.tc.td['DEPLOY_DIR'], 'rpm', pkgarch) # Pick base-passwd-doc as a test file to get installed, because it's small # and it will always be built for standard targets rpm_doc = 'base-passwd-doc-*.%s.rpm' % pkgarch + if not os.path.exists(rpmdir): + return for f in fnmatch.filter(os.listdir(rpmdir), rpm_doc): - test_file = os.path.join(rpmdir, f) - dst = '/tmp/base-passwd-doc.rpm' - cls.tc.target.copyTo(test_file, dst) - - @classmethod - def tearDownClass(cls): - dst = '/tmp/base-passwd-doc.rpm' - cls.tc.target.run('rm -f %s' % dst) + cls.test_file = os.path.join(rpmdir, f) + cls.dst = '/tmp/base-passwd-doc.rpm' @OETestID(192) - @OETestDepends(['rpm.RpmBasicTest.test_rpm_help']) + @OETestDepends(['rpm.RpmBasicTest.test_rpm_query']) def test_rpm_install(self): + self.tc.target.copyTo(self.test_file, self.dst) status, output = self.target.run('rpm -ivh /tmp/base-passwd-doc.rpm') msg = 'Failed to install base-passwd-doc package: %s' % output self.assertEqual(status, 0, msg=msg) + self.tc.target.run('rm -f %s' % self.dst) @OETestID(194) @OETestDepends(['rpm.RpmInstallRemoveTest.test_rpm_install']) @@ -118,6 +111,8 @@ class RpmInstallRemoveTest(OERuntimeTestCase): msg = 'Failed to find database files under /var/lib/rpm/ as __db.xxx' self.assertEqual(0, status, msg=msg) + self.tc.target.copyTo(self.test_file, self.dst) + # Remove the package just in case self.target.run('rpm -e base-passwd-doc') @@ -131,6 +126,8 @@ class RpmInstallRemoveTest(OERuntimeTestCase): msg = 'Failed to remove base-passwd-doc package. Reason: {}'.format(output) self.assertEqual(0, status, msg=msg) + self.tc.target.run('rm -f %s' % self.dst) + # if using systemd this should ensure all entries are flushed to /var status, output = self.target.run("journalctl --sync") # Get the amount of entries in the log file diff --git a/poky/meta/lib/oeqa/runtime/cases/scp.py b/poky/meta/lib/oeqa/runtime/cases/scp.py index f488a6175..8f895da95 100644 --- a/poky/meta/lib/oeqa/runtime/cases/scp.py +++ b/poky/meta/lib/oeqa/runtime/cases/scp.py @@ -4,6 +4,7 @@ from tempfile import mkstemp from oeqa.runtime.case import OERuntimeTestCase from oeqa.core.decorator.depends import OETestDepends from oeqa.core.decorator.oeid import OETestID +from oeqa.runtime.decorator.package import OEHasPackage class ScpTest(OERuntimeTestCase): @@ -20,6 +21,7 @@ class ScpTest(OERuntimeTestCase): @OETestID(220) @OETestDepends(['ssh.SSHTest.test_ssh']) + @OEHasPackage(['openssh-scp', 'dropbear']) def test_scp_file(self): dst = '/tmp/test_scp_file' diff --git a/poky/meta/lib/oeqa/runtime/cases/ssh.py b/poky/meta/lib/oeqa/runtime/cases/ssh.py index eca167969..0b1ea7bcc 100644 --- a/poky/meta/lib/oeqa/runtime/cases/ssh.py +++ b/poky/meta/lib/oeqa/runtime/cases/ssh.py @@ -1,11 +1,13 @@ from oeqa.runtime.case import OERuntimeTestCase from oeqa.core.decorator.depends import OETestDepends from oeqa.core.decorator.oeid import OETestID +from oeqa.runtime.decorator.package import OEHasPackage class SSHTest(OERuntimeTestCase): @OETestID(224) @OETestDepends(['ping.PingTest.test_ping']) + @OEHasPackage(['dropbear', 'openssh-sshd']) def test_ssh(self): (status, output) = self.target.run('uname -a') self.assertEqual(status, 0, msg='SSH Test failed: %s' % output) diff --git a/poky/meta/lib/oeqa/runtime/cases/stap.py b/poky/meta/lib/oeqa/runtime/cases/stap.py index 96e197a2d..c492caffd 100644 --- a/poky/meta/lib/oeqa/runtime/cases/stap.py +++ b/poky/meta/lib/oeqa/runtime/cases/stap.py @@ -4,17 +4,18 @@ 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 +from oeqa.runtime.decorator.package import OEHasPackage class StapTest(OERuntimeTestCase): @classmethod - def setUpClass(cls): + def setUp(cls): src = os.path.join(cls.tc.runtime_files_dir, 'hello.stp') dst = '/tmp/hello.stp' cls.tc.target.copyTo(src, dst) @classmethod - def tearDownClass(cls): + def tearDown(cls): files = '/tmp/hello.stp' cls.tc.target.run('rm %s' % files) @@ -22,6 +23,7 @@ class StapTest(OERuntimeTestCase): @skipIfNotFeature('tools-profile', 'Test requires tools-profile to be in IMAGE_FEATURES') @OETestDepends(['kernelmodule.KernelModuleTest.test_kernel_module']) + @OEHasPackage(['systemtap']) def test_stap(self): cmds = [ 'cd /usr/src/kernel && make scripts prepare', diff --git a/poky/meta/lib/oeqa/runtime/cases/xorg.py b/poky/meta/lib/oeqa/runtime/cases/xorg.py index 2124813e3..82521c69a 100644 --- a/poky/meta/lib/oeqa/runtime/cases/xorg.py +++ b/poky/meta/lib/oeqa/runtime/cases/xorg.py @@ -2,6 +2,7 @@ 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 +from oeqa.runtime.decorator.package import OEHasPackage class XorgTest(OERuntimeTestCase): @@ -9,6 +10,7 @@ class XorgTest(OERuntimeTestCase): @skipIfNotFeature('x11-base', 'Test requires x11 to be in IMAGE_FEATURES') @OETestDepends(['ssh.SSHTest.test_ssh']) + @OEHasPackage(['xserver-nodm-init']) def test_xorg_running(self): cmd ='%s | grep -v xinit | grep [X]org' % self.tc.target_cmds['ps'] status, output = self.target.run(cmd) |