diff options
Diffstat (limited to 'meta/lib/oeqa')
-rw-r--r-- | meta/lib/oeqa/buildtools-docs/cases/README (renamed from meta/lib/oeqa/sdk/buildtools-docs-cases/README) | 0 | ||||
-rw-r--r-- | meta/lib/oeqa/buildtools-docs/cases/build.py (renamed from meta/lib/oeqa/sdk/buildtools-docs-cases/build.py) | 0 | ||||
-rw-r--r-- | meta/lib/oeqa/buildtools/cases/README (renamed from meta/lib/oeqa/sdk/buildtools-cases/README) | 0 | ||||
-rw-r--r-- | meta/lib/oeqa/buildtools/cases/build.py (renamed from meta/lib/oeqa/sdk/buildtools-cases/build.py) | 0 | ||||
-rw-r--r-- | meta/lib/oeqa/buildtools/cases/gcc.py (renamed from meta/lib/oeqa/sdk/buildtools-cases/gcc.py) | 0 | ||||
-rw-r--r-- | meta/lib/oeqa/buildtools/cases/https.py (renamed from meta/lib/oeqa/sdk/buildtools-cases/https.py) | 0 | ||||
-rw-r--r-- | meta/lib/oeqa/buildtools/cases/sanity.py (renamed from meta/lib/oeqa/sdk/buildtools-cases/sanity.py) | 0 | ||||
-rw-r--r-- | meta/lib/oeqa/core/context.py | 7 | ||||
-rw-r--r-- | meta/lib/oeqa/core/target/__init__.py | 1 | ||||
-rw-r--r-- | meta/lib/oeqa/runtime/case.py | 2 | ||||
-rw-r--r-- | meta/lib/oeqa/sdk/testsdk.py | 24 | ||||
-rw-r--r-- | meta/lib/oeqa/selftest/cases/devtool.py | 2 | ||||
-rw-r--r-- | meta/lib/oeqa/selftest/cases/recipetool.py | 33 |
13 files changed, 44 insertions, 25 deletions
diff --git a/meta/lib/oeqa/sdk/buildtools-docs-cases/README b/meta/lib/oeqa/buildtools-docs/cases/README index f8edbc7dad..f8edbc7dad 100644 --- a/meta/lib/oeqa/sdk/buildtools-docs-cases/README +++ b/meta/lib/oeqa/buildtools-docs/cases/README | |||
diff --git a/meta/lib/oeqa/sdk/buildtools-docs-cases/build.py b/meta/lib/oeqa/buildtools-docs/cases/build.py index 6e3ee94292..6e3ee94292 100644 --- a/meta/lib/oeqa/sdk/buildtools-docs-cases/build.py +++ b/meta/lib/oeqa/buildtools-docs/cases/build.py | |||
diff --git a/meta/lib/oeqa/sdk/buildtools-cases/README b/meta/lib/oeqa/buildtools/cases/README index d4f20faa9f..d4f20faa9f 100644 --- a/meta/lib/oeqa/sdk/buildtools-cases/README +++ b/meta/lib/oeqa/buildtools/cases/README | |||
diff --git a/meta/lib/oeqa/sdk/buildtools-cases/build.py b/meta/lib/oeqa/buildtools/cases/build.py index c85c32496b..c85c32496b 100644 --- a/meta/lib/oeqa/sdk/buildtools-cases/build.py +++ b/meta/lib/oeqa/buildtools/cases/build.py | |||
diff --git a/meta/lib/oeqa/sdk/buildtools-cases/gcc.py b/meta/lib/oeqa/buildtools/cases/gcc.py index a62c4d0bc4..a62c4d0bc4 100644 --- a/meta/lib/oeqa/sdk/buildtools-cases/gcc.py +++ b/meta/lib/oeqa/buildtools/cases/gcc.py | |||
diff --git a/meta/lib/oeqa/sdk/buildtools-cases/https.py b/meta/lib/oeqa/buildtools/cases/https.py index 4525e3d758..4525e3d758 100644 --- a/meta/lib/oeqa/sdk/buildtools-cases/https.py +++ b/meta/lib/oeqa/buildtools/cases/https.py | |||
diff --git a/meta/lib/oeqa/sdk/buildtools-cases/sanity.py b/meta/lib/oeqa/buildtools/cases/sanity.py index a55d456656..a55d456656 100644 --- a/meta/lib/oeqa/sdk/buildtools-cases/sanity.py +++ b/meta/lib/oeqa/buildtools/cases/sanity.py | |||
diff --git a/meta/lib/oeqa/core/context.py b/meta/lib/oeqa/core/context.py index 9313271f58..46de9135c1 100644 --- a/meta/lib/oeqa/core/context.py +++ b/meta/lib/oeqa/core/context.py | |||
@@ -179,9 +179,16 @@ class OETestContextExecutor(object): | |||
179 | else: | 179 | else: |
180 | self.tc_kwargs['init']['td'] = {} | 180 | self.tc_kwargs['init']['td'] = {} |
181 | 181 | ||
182 | # Run image specific TEST_SUITE like testimage.bbclass by default | ||
183 | test_suites = self.tc_kwargs['init']['td'].get("TEST_SUITES") | ||
184 | if test_suites: | ||
185 | test_suites = test_suites.split() | ||
186 | |||
182 | if args.run_tests: | 187 | if args.run_tests: |
183 | self.tc_kwargs['load']['modules'] = args.run_tests | 188 | self.tc_kwargs['load']['modules'] = args.run_tests |
184 | self.tc_kwargs['load']['modules_required'] = args.run_tests | 189 | self.tc_kwargs['load']['modules_required'] = args.run_tests |
190 | elif test_suites: | ||
191 | self.tc_kwargs['load']['modules'] = test_suites | ||
185 | else: | 192 | else: |
186 | self.tc_kwargs['load']['modules'] = [] | 193 | self.tc_kwargs['load']['modules'] = [] |
187 | 194 | ||
diff --git a/meta/lib/oeqa/core/target/__init__.py b/meta/lib/oeqa/core/target/__init__.py index 1382aa9b52..177f648fe3 100644 --- a/meta/lib/oeqa/core/target/__init__.py +++ b/meta/lib/oeqa/core/target/__init__.py | |||
@@ -10,6 +10,7 @@ class OETarget(object): | |||
10 | 10 | ||
11 | def __init__(self, logger, *args, **kwargs): | 11 | def __init__(self, logger, *args, **kwargs): |
12 | self.logger = logger | 12 | self.logger = logger |
13 | self.runner = None | ||
13 | 14 | ||
14 | @abstractmethod | 15 | @abstractmethod |
15 | def start(self): | 16 | def start(self): |
diff --git a/meta/lib/oeqa/runtime/case.py b/meta/lib/oeqa/runtime/case.py index 9515ca2f3d..2a47771a3d 100644 --- a/meta/lib/oeqa/runtime/case.py +++ b/meta/lib/oeqa/runtime/case.py | |||
@@ -23,6 +23,8 @@ class OERuntimeTestCase(OETestCase): | |||
23 | uninstall_package(self) | 23 | uninstall_package(self) |
24 | 24 | ||
25 | def run_network_serialdebug(runner): | 25 | def run_network_serialdebug(runner): |
26 | if not runner: | ||
27 | return | ||
26 | status, output = runner.run_serial("ip addr") | 28 | status, output = runner.run_serial("ip addr") |
27 | print("ip addr on target: %s %s" % (output, status)) | 29 | print("ip addr on target: %s %s" % (output, status)) |
28 | status, output = runner.run_serial("ping -c 1 %s" % self.target.server_ip) | 30 | status, output = runner.run_serial("ping -c 1 %s" % self.target.server_ip) |
diff --git a/meta/lib/oeqa/sdk/testsdk.py b/meta/lib/oeqa/sdk/testsdk.py index 52b702b6a2..cffcf9f49a 100644 --- a/meta/lib/oeqa/sdk/testsdk.py +++ b/meta/lib/oeqa/sdk/testsdk.py | |||
@@ -31,6 +31,28 @@ class TestSDK(TestSDKBase): | |||
31 | context_class = OESDKTestContext | 31 | context_class = OESDKTestContext |
32 | test_type = 'sdk' | 32 | test_type = 'sdk' |
33 | 33 | ||
34 | def sdk_dir_names(self, d): | ||
35 | """Return list from TESTSDK_CASE_DIRS.""" | ||
36 | testdirs = d.getVar("TESTSDK_CASE_DIRS") | ||
37 | if testdirs: | ||
38 | return testdirs.split() | ||
39 | |||
40 | bb.fatal("TESTSDK_CASE_DIRS unset, can't find SDK test directories.") | ||
41 | |||
42 | def get_sdk_paths(self, d): | ||
43 | """ | ||
44 | Return a list of paths where SDK test cases reside. | ||
45 | |||
46 | SDK tests are expected in <LAYER_DIR>/lib/oeqa/<dirname>/cases | ||
47 | """ | ||
48 | paths = [] | ||
49 | for layer in d.getVar("BBLAYERS").split(): | ||
50 | for dirname in self.sdk_dir_names(d): | ||
51 | case_path = os.path.join(layer, "lib", "oeqa", dirname, "cases") | ||
52 | if os.path.isdir(case_path): | ||
53 | paths.append(case_path) | ||
54 | return paths | ||
55 | |||
34 | def get_tcname(self, d): | 56 | def get_tcname(self, d): |
35 | """ | 57 | """ |
36 | Get the name of the SDK file | 58 | Get the name of the SDK file |
@@ -115,7 +137,7 @@ class TestSDK(TestSDKBase): | |||
115 | 137 | ||
116 | try: | 138 | try: |
117 | modules = (d.getVar("TESTSDK_SUITES") or "").split() | 139 | modules = (d.getVar("TESTSDK_SUITES") or "").split() |
118 | tc.loadTests(self.context_executor_class.default_cases, modules) | 140 | tc.loadTests(self.get_sdk_paths(d), modules) |
119 | except Exception as e: | 141 | except Exception as e: |
120 | import traceback | 142 | import traceback |
121 | bb.fatal("Loading tests failed:\n%s" % traceback.format_exc()) | 143 | bb.fatal("Loading tests failed:\n%s" % traceback.format_exc()) |
diff --git a/meta/lib/oeqa/selftest/cases/devtool.py b/meta/lib/oeqa/selftest/cases/devtool.py index 74a7727cc0..05f228f03e 100644 --- a/meta/lib/oeqa/selftest/cases/devtool.py +++ b/meta/lib/oeqa/selftest/cases/devtool.py | |||
@@ -154,7 +154,7 @@ class DevtoolTestCase(OESelftestTestCase): | |||
154 | value = invalue | 154 | value = invalue |
155 | invar = None | 155 | invar = None |
156 | elif '=' in line: | 156 | elif '=' in line: |
157 | splitline = line.split('=', 1) | 157 | splitline = re.split(r"[?+:]*=[+]?", line, 1) |
158 | var = splitline[0].rstrip() | 158 | var = splitline[0].rstrip() |
159 | value = splitline[1].strip().strip('"') | 159 | value = splitline[1].strip().strip('"') |
160 | if value.endswith('\\'): | 160 | if value.endswith('\\'): |
diff --git a/meta/lib/oeqa/selftest/cases/recipetool.py b/meta/lib/oeqa/selftest/cases/recipetool.py index 2a91f6c7ae..0bd724c8ee 100644 --- a/meta/lib/oeqa/selftest/cases/recipetool.py +++ b/meta/lib/oeqa/selftest/cases/recipetool.py | |||
@@ -757,13 +757,12 @@ class RecipetoolCreateTests(RecipetoolBase): | |||
757 | 757 | ||
758 | def test_recipetool_create_go(self): | 758 | def test_recipetool_create_go(self): |
759 | # Basic test to check go recipe generation | 759 | # Basic test to check go recipe generation |
760 | self.maxDiff = None | ||
761 | |||
760 | temprecipe = os.path.join(self.tempdir, 'recipe') | 762 | temprecipe = os.path.join(self.tempdir, 'recipe') |
761 | os.makedirs(temprecipe) | 763 | os.makedirs(temprecipe) |
762 | 764 | ||
763 | recipefile = os.path.join(temprecipe, 'recipetool-go-test_git.bb') | 765 | recipefile = os.path.join(temprecipe, 'recipetool-go-test_git.bb') |
764 | deps_require_file = os.path.join(temprecipe, 'recipetool-go-test', 'recipetool-go-test-modules.inc') | ||
765 | lics_require_file = os.path.join(temprecipe, 'recipetool-go-test', 'recipetool-go-test-licenses.inc') | ||
766 | modules_txt_file = os.path.join(temprecipe, 'recipetool-go-test', 'modules.txt') | ||
767 | 766 | ||
768 | srcuri = 'https://git.yoctoproject.org/recipetool-go-test.git' | 767 | srcuri = 'https://git.yoctoproject.org/recipetool-go-test.git' |
769 | srcrev = "c3e213c01b6c1406b430df03ef0d1ae77de5d2f7" | 768 | srcrev = "c3e213c01b6c1406b430df03ef0d1ae77de5d2f7" |
@@ -771,13 +770,11 @@ class RecipetoolCreateTests(RecipetoolBase): | |||
771 | 770 | ||
772 | result = runCmd('recipetool create -o %s %s -S %s -B %s' % (temprecipe, srcuri, srcrev, srcbranch)) | 771 | result = runCmd('recipetool create -o %s %s -S %s -B %s' % (temprecipe, srcuri, srcrev, srcbranch)) |
773 | 772 | ||
774 | self.maxDiff = None | 773 | inherits = ['go-mod', 'go-mod-update-modules'] |
775 | inherits = ['go-vendor'] | ||
776 | 774 | ||
777 | checkvars = {} | 775 | checkvars = {} |
778 | checkvars['GO_IMPORT'] = "git.yoctoproject.org/recipetool-go-test" | 776 | checkvars['GO_IMPORT'] = "git.yoctoproject.org/recipetool-go-test" |
779 | checkvars['SRC_URI'] = {'git://${GO_IMPORT};destsuffix=git/src/${GO_IMPORT};nobranch=1;name=${BPN};protocol=https', | 777 | checkvars['SRC_URI'] = {'git://${GO_IMPORT};protocol=https;nobranch=1;destsuffix=${GO_SRCURI_DESTSUFFIX}'} |
780 | 'file://modules.txt'} | ||
781 | checkvars['LIC_FILES_CHKSUM'] = { | 778 | checkvars['LIC_FILES_CHKSUM'] = { |
782 | 'file://src/${GO_IMPORT}/LICENSE;md5=4e3933dd47afbf115e484d11385fb3bd', | 779 | 'file://src/${GO_IMPORT}/LICENSE;md5=4e3933dd47afbf115e484d11385fb3bd', |
783 | 'file://src/${GO_IMPORT}/is/LICENSE;md5=62beaee5a116dd1e80161667b1df39ab' | 780 | 'file://src/${GO_IMPORT}/is/LICENSE;md5=62beaee5a116dd1e80161667b1df39ab' |
@@ -786,26 +783,16 @@ class RecipetoolCreateTests(RecipetoolBase): | |||
786 | self._test_recipe_contents(recipefile, checkvars, inherits) | 783 | self._test_recipe_contents(recipefile, checkvars, inherits) |
787 | self.assertNotIn('Traceback', result.output) | 784 | self.assertNotIn('Traceback', result.output) |
788 | 785 | ||
786 | lics_require_file = os.path.join(temprecipe, 'recipetool-go-test-licenses.inc') | ||
787 | self.assertFileExists(lics_require_file) | ||
789 | checkvars = {} | 788 | checkvars = {} |
790 | checkvars['VENDORED_LIC_FILES_CHKSUM'] = set( | 789 | checkvars['LIC_FILES_CHKSUM'] = {'file://pkg/mod/github.com/godbus/dbus/v5@v5.1.0/LICENSE;md5=09042bd5c6c96a2b9e45ddf1bc517eed;spdx=BSD-2-Clause'} |
791 | ['file://src/${GO_IMPORT}/vendor/github.com/godbus/dbus/v5/LICENSE;md5=09042bd5c6c96a2b9e45ddf1bc517eed', | ||
792 | 'file://src/${GO_IMPORT}/vendor/github.com/matryer/is/LICENSE;md5=62beaee5a116dd1e80161667b1df39ab']) | ||
793 | self.assertTrue(os.path.isfile(lics_require_file)) | ||
794 | self._test_recipe_contents(lics_require_file, checkvars, []) | 790 | self._test_recipe_contents(lics_require_file, checkvars, []) |
795 | 791 | ||
796 | # make sure that dependencies don't mention local directory ./matryer/is | 792 | deps_require_file = os.path.join(temprecipe, 'recipetool-go-test-go-mods.inc') |
797 | dependencies = \ | 793 | self.assertFileExists(deps_require_file) |
798 | [ ('github.com/godbus/dbus','v5.1.0', 'github.com/godbus/dbus/v5', '/v5', ''), | ||
799 | ] | ||
800 | |||
801 | src_uri = set() | ||
802 | for d in dependencies: | ||
803 | src_uri.add(self._go_urifiy(*d)) | ||
804 | |||
805 | checkvars = {} | 794 | checkvars = {} |
806 | checkvars['GO_DEPENDENCIES_SRC_URI'] = src_uri | 795 | checkvars['SRC_URI'] = {'gomod://github.com/godbus/dbus/v5;version=v5.1.0;sha256sum=03dfa8e71089a6f477310d15c4d3a036d82d028532881b50fee254358e782ad9'} |
807 | |||
808 | self.assertTrue(os.path.isfile(deps_require_file)) | ||
809 | self._test_recipe_contents(deps_require_file, checkvars, []) | 796 | self._test_recipe_contents(deps_require_file, checkvars, []) |
810 | 797 | ||
811 | class RecipetoolTests(RecipetoolBase): | 798 | class RecipetoolTests(RecipetoolBase): |