1
0
mirror of https://git.yoctoproject.org/poky synced 2026-06-01 00:59:48 +00:00

oeqa/runtime/cases: Improve dependencies of kernel/gcc/build tests

Mark up these tests as needing a compiler, make and kernel source code
as appropriate, the image feature requirements can then be retired.

(From OE-Core rev: 9f64e6c25abdf494fb511e9cd401f8dcaa08be2a)

(From OE-Core rev: 544c56b6950f0598d5eaf62d9ae9d9de5fcb7eaf)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie
2018-11-09 09:55:40 +00:00
parent d853fa2680
commit e1b97539c8
6 changed files with 31 additions and 30 deletions
+5 -4
View File
@@ -1,7 +1,7 @@
from oeqa.runtime.case import OERuntimeTestCase from oeqa.runtime.case import OERuntimeTestCase
from oeqa.core.decorator.depends import OETestDepends from oeqa.core.decorator.depends import OETestDepends
from oeqa.core.decorator.oeid import OETestID 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 from oeqa.runtime.utils.targetbuildproject import TargetBuildProject
@@ -13,17 +13,18 @@ class BuildCpioTest(OERuntimeTestCase):
cls.project = TargetBuildProject(cls.tc.target, cls.project = TargetBuildProject(cls.tc.target,
uri, uri,
dl_dir = cls.tc.td['DL_DIR']) dl_dir = cls.tc.td['DL_DIR'])
cls.project.download_archive()
@classmethod @classmethod
def tearDownClass(cls): def tearDownClass(cls):
cls.project.clean() cls.project.clean()
@OETestID(205) @OETestID(205)
@skipIfNotFeature('tools-sdk',
'Test requires tools-sdk to be in IMAGE_FEATURES')
@OETestDepends(['ssh.SSHTest.test_ssh']) @OETestDepends(['ssh.SSHTest.test_ssh'])
@OEHasPackage(['gcc'])
@OEHasPackage(['make'])
@OEHasPackage(['autoconf'])
def test_cpio(self): def test_cpio(self):
self.project.download_archive()
self.project.run_configure() self.project.run_configure()
self.project.run_make() self.project.run_make()
self.project.run_install() self.project.run_install()
@@ -1,7 +1,7 @@
from oeqa.runtime.case import OERuntimeTestCase from oeqa.runtime.case import OERuntimeTestCase
from oeqa.core.decorator.depends import OETestDepends from oeqa.core.decorator.depends import OETestDepends
from oeqa.core.decorator.oeid import OETestID 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 from oeqa.runtime.utils.targetbuildproject import TargetBuildProject
@@ -13,16 +13,17 @@ class GalculatorTest(OERuntimeTestCase):
cls.project = TargetBuildProject(cls.tc.target, cls.project = TargetBuildProject(cls.tc.target,
uri, uri,
dl_dir = cls.tc.td['DL_DIR']) dl_dir = cls.tc.td['DL_DIR'])
cls.project.download_archive()
@classmethod @classmethod
def tearDownClass(cls): def tearDownClass(cls):
cls.project.clean() cls.project.clean()
@OETestID(1526) @OETestID(1526)
@skipIfNotFeature('tools-sdk',
'Test requires tools-sdk to be in IMAGE_FEATURES')
@OETestDepends(['ssh.SSHTest.test_ssh']) @OETestDepends(['ssh.SSHTest.test_ssh'])
@OEHasPackage(['gcc'])
@OEHasPackage(['make'])
@OEHasPackage(['autoconf'])
def test_galculator(self): def test_galculator(self):
self.project.download_archive()
self.project.run_configure() self.project.run_configure()
self.project.run_make() self.project.run_make()
+5 -7
View File
@@ -1,7 +1,7 @@
from oeqa.runtime.case import OERuntimeTestCase from oeqa.runtime.case import OERuntimeTestCase
from oeqa.core.decorator.depends import OETestDepends from oeqa.core.decorator.depends import OETestDepends
from oeqa.core.decorator.oeid import OETestID 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 from oeqa.runtime.utils.targetbuildproject import TargetBuildProject
@@ -14,21 +14,19 @@ class BuildLzipTest(OERuntimeTestCase):
cls.project = TargetBuildProject(cls.tc.target, cls.project = TargetBuildProject(cls.tc.target,
uri, uri,
dl_dir = cls.tc.td['DL_DIR']) dl_dir = cls.tc.td['DL_DIR'])
cls.project.download_archive()
@classmethod @classmethod
def tearDownClass(cls): def tearDownClass(cls):
cls.project.clean() cls.project.clean()
@OETestID(206) @OETestID(206)
@skipIfNotFeature('tools-sdk',
'Test requires tools-sdk to be in IMAGE_FEATURES')
@OETestDepends(['ssh.SSHTest.test_ssh']) @OETestDepends(['ssh.SSHTest.test_ssh'])
@OEHasPackage(['gcc'])
@OEHasPackage(['make'])
@OEHasPackage(['autoconf'])
def test_lzip(self): def test_lzip(self):
self.project.download_archive()
self.project.run_configure() self.project.run_configure()
self.project.run_make() self.project.run_make()
self.project.run_install() self.project.run_install()
@classmethod
def tearDownClass(self):
self.project.clean()
+8 -11
View File
@@ -3,12 +3,12 @@ import os
from oeqa.runtime.case import OERuntimeTestCase from oeqa.runtime.case import OERuntimeTestCase
from oeqa.core.decorator.depends import OETestDepends from oeqa.core.decorator.depends import OETestDepends
from oeqa.core.decorator.oeid import OETestID from oeqa.core.decorator.oeid import OETestID
from oeqa.core.decorator.data import skipIfNotFeature from oeqa.runtime.decorator.package import OEHasPackage
class GccCompileTest(OERuntimeTestCase): class GccCompileTest(OERuntimeTestCase):
@classmethod @classmethod
def setUpClass(cls): def setUp(cls):
dst = '/tmp/' dst = '/tmp/'
src = os.path.join(cls.tc.files_dir, 'test.c') src = os.path.join(cls.tc.files_dir, 'test.c')
cls.tc.target.copyTo(src, dst) cls.tc.target.copyTo(src, dst)
@@ -20,14 +20,13 @@ class GccCompileTest(OERuntimeTestCase):
cls.tc.target.copyTo(src, dst) cls.tc.target.copyTo(src, dst)
@classmethod @classmethod
def tearDownClass(cls): def tearDown(cls):
files = '/tmp/test.c /tmp/test.o /tmp/test /tmp/testmakefile' files = '/tmp/test.c /tmp/test.o /tmp/test /tmp/testmakefile'
cls.tc.target.run('rm %s' % files) cls.tc.target.run('rm %s' % files)
@OETestID(203) @OETestID(203)
@skipIfNotFeature('tools-sdk',
'Test requires tools-sdk to be in IMAGE_FEATURES')
@OETestDepends(['ssh.SSHTest.test_ssh']) @OETestDepends(['ssh.SSHTest.test_ssh'])
@OEHasPackage(['gcc'])
def test_gcc_compile(self): def test_gcc_compile(self):
status, output = self.target.run('gcc /tmp/test.c -o /tmp/test -lm') status, output = self.target.run('gcc /tmp/test.c -o /tmp/test -lm')
msg = 'gcc compile failed, output: %s' % output msg = 'gcc compile failed, output: %s' % output
@@ -38,9 +37,8 @@ class GccCompileTest(OERuntimeTestCase):
self.assertEqual(status, 0, msg=msg) self.assertEqual(status, 0, msg=msg)
@OETestID(200) @OETestID(200)
@skipIfNotFeature('tools-sdk',
'Test requires tools-sdk to be in IMAGE_FEATURES')
@OETestDepends(['ssh.SSHTest.test_ssh']) @OETestDepends(['ssh.SSHTest.test_ssh'])
@OEHasPackage(['g++'])
def test_gpp_compile(self): def test_gpp_compile(self):
status, output = self.target.run('g++ /tmp/test.c -o /tmp/test -lm') status, output = self.target.run('g++ /tmp/test.c -o /tmp/test -lm')
msg = 'g++ compile failed, output: %s' % output msg = 'g++ compile failed, output: %s' % output
@@ -51,9 +49,8 @@ class GccCompileTest(OERuntimeTestCase):
self.assertEqual(status, 0, msg=msg) self.assertEqual(status, 0, msg=msg)
@OETestID(1142) @OETestID(1142)
@skipIfNotFeature('tools-sdk',
'Test requires tools-sdk to be in IMAGE_FEATURES')
@OETestDepends(['ssh.SSHTest.test_ssh']) @OETestDepends(['ssh.SSHTest.test_ssh'])
@OEHasPackage(['g++'])
def test_gpp2_compile(self): def test_gpp2_compile(self):
status, output = self.target.run('g++ /tmp/test.cpp -o /tmp/test -lm') status, output = self.target.run('g++ /tmp/test.cpp -o /tmp/test -lm')
msg = 'g++ compile failed, output: %s' % output msg = 'g++ compile failed, output: %s' % output
@@ -64,9 +61,9 @@ class GccCompileTest(OERuntimeTestCase):
self.assertEqual(status, 0, msg=msg) self.assertEqual(status, 0, msg=msg)
@OETestID(204) @OETestID(204)
@skipIfNotFeature('tools-sdk',
'Test requires tools-sdk to be in IMAGE_FEATURES')
@OETestDepends(['ssh.SSHTest.test_ssh']) @OETestDepends(['ssh.SSHTest.test_ssh'])
@OEHasPackage(['gcc'])
@OEHasPackage(['make'])
def test_make(self): def test_make(self):
status, output = self.target.run('cd /tmp; make -f testmakefile') status, output = self.target.run('cd /tmp; make -f testmakefile')
msg = 'running make failed, output %s' % output msg = 'running make failed, output %s' % output
+6 -2
View File
@@ -4,11 +4,12 @@ from oeqa.runtime.case import OERuntimeTestCase
from oeqa.core.decorator.depends import OETestDepends from oeqa.core.decorator.depends import OETestDepends
from oeqa.core.decorator.oeid import OETestID from oeqa.core.decorator.oeid import OETestID
from oeqa.core.decorator.data import skipIfNotFeature from oeqa.core.decorator.data import skipIfNotFeature
from oeqa.runtime.decorator.package import OEHasPackage
class KernelModuleTest(OERuntimeTestCase): class KernelModuleTest(OERuntimeTestCase):
@classmethod @classmethod
def setUpClass(cls): def setUp(cls):
src = os.path.join(cls.tc.runtime_files_dir, 'hellomod.c') src = os.path.join(cls.tc.runtime_files_dir, 'hellomod.c')
dst = '/tmp/hellomod.c' dst = '/tmp/hellomod.c'
cls.tc.target.copyTo(src, dst) cls.tc.target.copyTo(src, dst)
@@ -18,7 +19,7 @@ class KernelModuleTest(OERuntimeTestCase):
cls.tc.target.copyTo(src, dst) cls.tc.target.copyTo(src, dst)
@classmethod @classmethod
def tearDownClass(cls): def tearDown(cls):
files = '/tmp/Makefile /tmp/hellomod.c' files = '/tmp/Makefile /tmp/hellomod.c'
cls.tc.target.run('rm %s' % files) cls.tc.target.run('rm %s' % files)
@@ -26,6 +27,9 @@ class KernelModuleTest(OERuntimeTestCase):
@skipIfNotFeature('tools-sdk', @skipIfNotFeature('tools-sdk',
'Test requires tools-sdk to be in IMAGE_FEATURES') 'Test requires tools-sdk to be in IMAGE_FEATURES')
@OETestDepends(['gcc.GccCompileTest.test_gcc_compile']) @OETestDepends(['gcc.GccCompileTest.test_gcc_compile'])
@OEHasPackage(['kernel-devsrc'])
@OEHasPackage(['make'])
@OEHasPackage(['gcc'])
def test_kernel_module(self): def test_kernel_module(self):
cmds = [ cmds = [
'cd /usr/src/kernel && make scripts prepare', 'cd /usr/src/kernel && make scripts prepare',
+2 -2
View File
@@ -9,13 +9,13 @@ from oeqa.runtime.decorator.package import OEHasPackage
class StapTest(OERuntimeTestCase): class StapTest(OERuntimeTestCase):
@classmethod @classmethod
def setUpClass(cls): def setUp(cls):
src = os.path.join(cls.tc.runtime_files_dir, 'hello.stp') src = os.path.join(cls.tc.runtime_files_dir, 'hello.stp')
dst = '/tmp/hello.stp' dst = '/tmp/hello.stp'
cls.tc.target.copyTo(src, dst) cls.tc.target.copyTo(src, dst)
@classmethod @classmethod
def tearDownClass(cls): def tearDown(cls):
files = '/tmp/hello.stp' files = '/tmp/hello.stp'
cls.tc.target.run('rm %s' % files) cls.tc.target.run('rm %s' % files)