summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAníbal Limón <anibal.limon@linux.intel.com>2016-11-30 15:12:15 -0600
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-01-23 12:05:19 +0000
commit260741847a2070a507a8a504bebd457eac99da5f (patch)
tree0243db29652083264ed55c175903bba02e54219f
parent03d175f1fae52428da8ff43fd3de336dcd761362 (diff)
downloadpoky-260741847a2070a507a8a504bebd457eac99da5f.tar.gz
oeqa/sdkext/cases: Migrate test case to new OEQA framework
Summary, - Changes base case class to OESDKExtTest. - Changes decorator classes to new ones. - Chnages variable names sdktestdir -> sdk_dir. - Added missing license to MIT. (From OE-Core rev: 49568055df0a64e4228f27130b13ccafbba2a460) Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/lib/oeqa/sdk/cases/buildgalculator.py2
-rw-r--r--meta/lib/oeqa/sdk/cases/gcc.py3
-rw-r--r--meta/lib/oeqa/sdkext/cases/devtool.py49
-rw-r--r--meta/lib/oeqa/sdkext/cases/sdk_update.py17
4 files changed, 38 insertions, 33 deletions
diff --git a/meta/lib/oeqa/sdk/cases/buildgalculator.py b/meta/lib/oeqa/sdk/cases/buildgalculator.py
index bdc8b6ac87..42e8ddb185 100644
--- a/meta/lib/oeqa/sdk/cases/buildgalculator.py
+++ b/meta/lib/oeqa/sdk/cases/buildgalculator.py
@@ -10,7 +10,7 @@ class GalculatorTest(OESDKTestCase):
10 def setUpClass(self): 10 def setUpClass(self):
11 if not (self.tc.hasTargetPackage("gtk+3") or\ 11 if not (self.tc.hasTargetPackage("gtk+3") or\
12 self.tc.hasTargetPackage("libgtk-3.0")): 12 self.tc.hasTargetPackage("libgtk-3.0")):
13 raise unittest.SkipTest("%s class: SDK don't support gtk+3" % self.__name__) 13 raise unittest.SkipTest("GalculatorTest class: SDK don't support gtk+3")
14 14
15 def test_galculator(self): 15 def test_galculator(self):
16 dl_dir = self.td.get('DL_DIR', None) 16 dl_dir = self.td.get('DL_DIR', None)
diff --git a/meta/lib/oeqa/sdk/cases/gcc.py b/meta/lib/oeqa/sdk/cases/gcc.py
index e06af4c247..74ad2a2f2b 100644
--- a/meta/lib/oeqa/sdk/cases/gcc.py
+++ b/meta/lib/oeqa/sdk/cases/gcc.py
@@ -19,8 +19,7 @@ class GccCompileTest(OESDKTestCase):
19 def setUp(self): 19 def setUp(self):
20 machine = self.td.get("MACHINE") 20 machine = self.td.get("MACHINE")
21 if not self.tc.hasHostPackage("packagegroup-cross-canadian-%s" % machine): 21 if not self.tc.hasHostPackage("packagegroup-cross-canadian-%s" % machine):
22 raise unittest.SkipTest("%s class: SDK doesn't contain a cross-canadian toolchain", 22 raise unittest.SkipTest("GccCompileTest class: SDK doesn't contain a cross-canadian toolchain")
23 self.__name__)
24 23
25 def test_gcc_compile(self): 24 def test_gcc_compile(self):
26 self._run('$CC %s/test.c -o %s/test -lm' % (self.tc.sdk_dir, self.tc.sdk_dir)) 25 self._run('$CC %s/test.c -o %s/test -lm' % (self.tc.sdk_dir, self.tc.sdk_dir))
diff --git a/meta/lib/oeqa/sdkext/cases/devtool.py b/meta/lib/oeqa/sdkext/cases/devtool.py
index 65f41f6875..da0050c606 100644
--- a/meta/lib/oeqa/sdkext/cases/devtool.py
+++ b/meta/lib/oeqa/sdkext/cases/devtool.py
@@ -1,18 +1,22 @@
1# Copyright (C) 2016 Intel Corporation
2# Released under the MIT license (see COPYING.MIT)
3
1import shutil 4import shutil
2import subprocess 5import subprocess
3import urllib.request
4from oeqa.oetest import oeSDKExtTest
5from oeqa.utils.decorators import *
6 6
7class DevtoolTest(oeSDKExtTest): 7from oeqa.sdkext.case import OESDKExtTestCase
8from oeqa.core.decorator.depends import OETestDepends
9from oeqa.core.decorator.oeid import OETestID
10
11class DevtoolTest(OESDKExtTestCase):
8 @classmethod 12 @classmethod
9 def setUpClass(self): 13 def setUpClass(self):
10 self.myapp_src = os.path.join(self.tc.sdkextfilesdir, "myapp") 14 self.myapp_src = os.path.join(self.tc.esdk_files_dir, "myapp")
11 self.myapp_dst = os.path.join(self.tc.sdktestdir, "myapp") 15 self.myapp_dst = os.path.join(self.tc.sdk_dir, "myapp")
12 shutil.copytree(self.myapp_src, self.myapp_dst) 16 shutil.copytree(self.myapp_src, self.myapp_dst)
13 17
14 self.myapp_cmake_src = os.path.join(self.tc.sdkextfilesdir, "myapp_cmake") 18 self.myapp_cmake_src = os.path.join(self.tc.esdk_files_dir, "myapp_cmake")
15 self.myapp_cmake_dst = os.path.join(self.tc.sdktestdir, "myapp_cmake") 19 self.myapp_cmake_dst = os.path.join(self.tc.sdk_dir, "myapp_cmake")
16 shutil.copytree(self.myapp_cmake_src, self.myapp_cmake_dst) 20 shutil.copytree(self.myapp_cmake_src, self.myapp_cmake_dst)
17 21
18 def _test_devtool_build(self, directory): 22 def _test_devtool_build(self, directory):
@@ -37,31 +41,31 @@ class DevtoolTest(oeSDKExtTest):
37 41
38 def test_devtool_location(self): 42 def test_devtool_location(self):
39 output = self._run('which devtool') 43 output = self._run('which devtool')
40 self.assertEqual(output.startswith(self.tc.sdktestdir), True, \ 44 self.assertEqual(output.startswith(self.tc.sdk_dir), True, \
41 msg="Seems that devtool isn't the eSDK one: %s" % output) 45 msg="Seems that devtool isn't the eSDK one: %s" % output)
42 46
43 @skipUnlessPassed('test_devtool_location') 47 @OETestDepends(['test_devtool_location'])
44 def test_devtool_add_reset(self): 48 def test_devtool_add_reset(self):
45 self._run('devtool add myapp %s' % self.myapp_dst) 49 self._run('devtool add myapp %s' % self.myapp_dst)
46 self._run('devtool reset myapp') 50 self._run('devtool reset myapp')
47 51
48 @testcase(1473) 52 @OETestID(1473)
49 @skipUnlessPassed('test_devtool_location') 53 @OETestDepends(['test_devtool_location'])
50 def test_devtool_build_make(self): 54 def test_devtool_build_make(self):
51 self._test_devtool_build(self.myapp_dst) 55 self._test_devtool_build(self.myapp_dst)
52 56
53 @testcase(1474) 57 @OETestID(1474)
54 @skipUnlessPassed('test_devtool_location') 58 @OETestDepends(['test_devtool_location'])
55 def test_devtool_build_esdk_package(self): 59 def test_devtool_build_esdk_package(self):
56 self._test_devtool_build_package(self.myapp_dst) 60 self._test_devtool_build_package(self.myapp_dst)
57 61
58 @testcase(1479) 62 @OETestID(1479)
59 @skipUnlessPassed('test_devtool_location') 63 @OETestDepends(['test_devtool_location'])
60 def test_devtool_build_cmake(self): 64 def test_devtool_build_cmake(self):
61 self._test_devtool_build(self.myapp_cmake_dst) 65 self._test_devtool_build(self.myapp_cmake_dst)
62 66
63 @testcase(1482) 67 @OETestID(1482)
64 @skipUnlessPassed('test_devtool_location') 68 @OETestDepends(['test_devtool_location'])
65 def test_extend_autotools_recipe_creation(self): 69 def test_extend_autotools_recipe_creation(self):
66 req = 'https://github.com/rdfa/librdfa' 70 req = 'https://github.com/rdfa/librdfa'
67 recipe = "bbexample" 71 recipe = "bbexample"
@@ -74,8 +78,8 @@ class DevtoolTest(oeSDKExtTest):
74 raise e 78 raise e
75 self._run('devtool reset %s' % recipe) 79 self._run('devtool reset %s' % recipe)
76 80
77 @testcase(1484) 81 @OETestID(1484)
78 @skipUnlessPassed('test_devtool_location') 82 @OETestDepends(['test_devtool_location'])
79 def test_devtool_kernelmodule(self): 83 def test_devtool_kernelmodule(self):
80 docfile = 'https://github.com/umlaeute/v4l2loopback.git' 84 docfile = 'https://github.com/umlaeute/v4l2loopback.git'
81 recipe = 'v4l2loopback-driver' 85 recipe = 'v4l2loopback-driver'
@@ -88,8 +92,8 @@ class DevtoolTest(oeSDKExtTest):
88 raise e 92 raise e
89 self._run('devtool reset %s' % recipe) 93 self._run('devtool reset %s' % recipe)
90 94
91 @testcase(1478) 95 @OETestID(1478)
92 @skipUnlessPassed('test_devtool_location') 96 @OETestDepends(['test_devtool_location'])
93 def test_recipes_for_nodejs(self): 97 def test_recipes_for_nodejs(self):
94 package_nodejs = "npm://registry.npmjs.org;name=winston;version=2.2.0" 98 package_nodejs = "npm://registry.npmjs.org;name=winston;version=2.2.0"
95 self._run('devtool add %s ' % package_nodejs) 99 self._run('devtool add %s ' % package_nodejs)
@@ -101,7 +105,6 @@ class DevtoolTest(oeSDKExtTest):
101 raise e 105 raise e
102 self._run('devtool reset %s '% package_nodejs) 106 self._run('devtool reset %s '% package_nodejs)
103 107
104
105 @classmethod 108 @classmethod
106 def tearDownClass(self): 109 def tearDownClass(self):
107 shutil.rmtree(self.myapp_dst) 110 shutil.rmtree(self.myapp_dst)
diff --git a/meta/lib/oeqa/sdkext/cases/sdk_update.py b/meta/lib/oeqa/sdkext/cases/sdk_update.py
index 2ade839c05..2f8598bbe5 100644
--- a/meta/lib/oeqa/sdkext/cases/sdk_update.py
+++ b/meta/lib/oeqa/sdkext/cases/sdk_update.py
@@ -1,23 +1,26 @@
1# Copyright (C) 2016 Intel Corporation
2# Released under the MIT license (see COPYING.MIT)
3
1import os 4import os
2import shutil 5import shutil
3import subprocess 6import subprocess
4 7
5from oeqa.oetest import oeSDKExtTest 8from oeqa.sdkext.case import OESDKExtTestCase
6from oeqa.utils.httpserver import HTTPService 9from oeqa.utils.httpserver import HTTPService
7 10
8class SdkUpdateTest(oeSDKExtTest): 11class SdkUpdateTest(OESDKExtTestCase):
9
10 @classmethod 12 @classmethod
11 def setUpClass(self): 13 def setUpClass(self):
12 self.publish_dir = os.path.join(self.tc.sdktestdir, 'esdk_publish') 14 self.publish_dir = os.path.join(self.tc.sdk_dir, 'esdk_publish')
13 if os.path.exists(self.publish_dir): 15 if os.path.exists(self.publish_dir):
14 shutil.rmtree(self.publish_dir) 16 shutil.rmtree(self.publish_dir)
15 os.mkdir(self.publish_dir) 17 os.mkdir(self.publish_dir)
16 18
17 tcname_new = self.tc.d.expand( 19 base_tcname = "%s/%s" % (self.td.get("SDK_DEPLOY", ''),
18 "${SDK_DEPLOY}/${TOOLCHAINEXT_OUTPUTNAME}-new.sh") 20 self.td.get("TOOLCHAINEXT_OUTPUTNAME", ''))
21 tcname_new = "%s-new.sh" % base_tcname
19 if not os.path.exists(tcname_new): 22 if not os.path.exists(tcname_new):
20 tcname_new = self.tc.tcname 23 tcname_new = "%s.sh" % base_tcname
21 24
22 cmd = 'oe-publish-sdk %s %s' % (tcname_new, self.publish_dir) 25 cmd = 'oe-publish-sdk %s %s' % (tcname_new, self.publish_dir)
23 subprocess.check_output(cmd, shell=True) 26 subprocess.check_output(cmd, shell=True)