[oe-commits] [openembedded-core] 03/03: XXX esdk testimage WIP
git at git.openembedded.org
git at git.openembedded.org
Wed Mar 1 10:57:05 UTC 2017
This is an automated email from the git hooks/post-receive script.
rpurdie pushed a commit to branch master-next
in repository openembedded-core.
commit badca196a9684135008eb69eeca5f069e06b4d3b
Author: Ross Burton <ross.burton at intel.com>
AuthorDate: Mon Feb 27 23:46:10 2017 +0000
XXX esdk testimage WIP
---
meta/lib/oeqa/sdk/case.py | 2 +-
meta/lib/oeqa/sdk/cases/gcc.py | 5 --
meta/lib/oeqa/sdkext/case.py | 8 +++-
meta/lib/oeqa/sdkext/cases/devtool.py | 78 +++++++++++++++-----------------
meta/lib/oeqa/sdkext/cases/sdk_update.py | 1 +
meta/lib/oeqa/sdkext/context.py | 4 +-
scripts/lib/devtool/sdk.py | 4 ++
7 files changed, 50 insertions(+), 52 deletions(-)
diff --git a/meta/lib/oeqa/sdk/case.py b/meta/lib/oeqa/sdk/case.py
index 782db8b..963aa8d 100644
--- a/meta/lib/oeqa/sdk/case.py
+++ b/meta/lib/oeqa/sdk/case.py
@@ -9,4 +9,4 @@ class OESDKTestCase(OETestCase):
def _run(self, cmd):
return subprocess.check_output(". %s > /dev/null; %s;" % \
(self.tc.sdk_env, cmd), shell=True,
- stderr=subprocess.STDOUT).decode("utf-8")
+ stderr=subprocess.STDOUT, universal_newlines=True)
diff --git a/meta/lib/oeqa/sdk/cases/gcc.py b/meta/lib/oeqa/sdk/cases/gcc.py
index 74ad2a2..d17ccd2 100644
--- a/meta/lib/oeqa/sdk/cases/gcc.py
+++ b/meta/lib/oeqa/sdk/cases/gcc.py
@@ -16,11 +16,6 @@ class GccCompileTest(OESDKTestCase):
shutil.copyfile(os.path.join(files[f], f),
os.path.join(self.tc.sdk_dir, f))
- def setUp(self):
- machine = self.td.get("MACHINE")
- if not self.tc.hasHostPackage("packagegroup-cross-canadian-%s" % machine):
- raise unittest.SkipTest("GccCompileTest class: SDK doesn't contain a cross-canadian toolchain")
-
def test_gcc_compile(self):
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/case.py b/meta/lib/oeqa/sdkext/case.py
index 6f708aa..905b730 100644
--- a/meta/lib/oeqa/sdkext/case.py
+++ b/meta/lib/oeqa/sdkext/case.py
@@ -16,6 +16,10 @@ class OESDKExtTestCase(OESDKTestCase):
paths_to_avoid = ['bitbake/bin', 'poky/scripts']
env['PATH'] = avoid_paths_in_environ(paths_to_avoid)
- return subprocess.check_output(". %s > /dev/null;"\
+ try:
+ return subprocess.check_output(". %s > /dev/null;"\
" %s;" % (self.tc.sdk_env, cmd), stderr=subprocess.STDOUT,
- shell=True, env=env).decode("utf-8")
+ shell=True, env=env, universal_newlines=True)
+ except subprocess.CalledProcessError as e:
+ print(e.output)
+ raise
diff --git a/meta/lib/oeqa/sdkext/cases/devtool.py b/meta/lib/oeqa/sdkext/cases/devtool.py
index baa528f..e5aa93e 100644
--- a/meta/lib/oeqa/sdkext/cases/devtool.py
+++ b/meta/lib/oeqa/sdkext/cases/devtool.py
@@ -3,116 +3,110 @@
import shutil
import subprocess
+import glob
from oeqa.sdkext.case import OESDKExtTestCase
from oeqa.core.decorator.depends import OETestDepends
from oeqa.core.decorator.oeid import OETestID
-from oeqa.core.decorator.data import skipIfNotDataVar
+from oeqa.utils.httpserver import HTTPService
class DevtoolTest(OESDKExtTestCase):
@classmethod
- def setUpClass(self):
- self.myapp_src = os.path.join(self.tc.esdk_files_dir, "myapp")
- self.myapp_dst = os.path.join(self.tc.sdk_dir, "myapp")
- shutil.copytree(self.myapp_src, self.myapp_dst)
+ def setUpClass(cls):
+ cls.myapp_src = os.path.join(cls.tc.esdk_files_dir, "myapp")
+ cls.myapp_dst = os.path.join(cls.tc.sdk_dir, "myapp")
+ shutil.copytree(cls.myapp_src, cls.myapp_dst)
- self.myapp_cmake_src = os.path.join(self.tc.esdk_files_dir, "myapp_cmake")
- self.myapp_cmake_dst = os.path.join(self.tc.sdk_dir, "myapp_cmake")
- shutil.copytree(self.myapp_cmake_src, self.myapp_cmake_dst)
+ cls.myapp_cmake_src = os.path.join(cls.tc.esdk_files_dir, "myapp_cmake")
+ cls.myapp_cmake_dst = os.path.join(cls.tc.sdk_dir, "myapp_cmake")
+ shutil.copytree(cls.myapp_cmake_src, cls.myapp_cmake_dst)
+
+ @classmethod
+ def tearDownClass(cls):
+ shutil.rmtree(cls.myapp_dst)
+ shutil.rmtree(cls.myapp_cmake_dst)
def _test_devtool_build(self, directory):
self._run('devtool add myapp %s' % directory)
try:
self._run('devtool build myapp')
- except Exception as e:
+ except subprocess.CalledProcessError as e:
print(e.output)
- self._run('devtool reset myapp')
raise e
- self._run('devtool reset myapp')
+ finally:
+ self._run('devtool reset myapp')
def _test_devtool_build_package(self, directory):
self._run('devtool add myapp %s' % directory)
try:
self._run('devtool package myapp')
- except Exception as e:
+ except subprocess.CalledProcessError as e:
print(e.output)
- self._run('devtool reset myapp')
raise e
- self._run('devtool reset myapp')
+ finally:
+ self._run('devtool reset myapp')
def test_devtool_location(self):
output = self._run('which devtool')
self.assertEqual(output.startswith(self.tc.sdk_dir), True, \
msg="Seems that devtool isn't the eSDK one: %s" % output)
-
+
@OETestDepends(['test_devtool_location'])
def test_devtool_add_reset(self):
self._run('devtool add myapp %s' % self.myapp_dst)
self._run('devtool reset myapp')
-
+
@OETestID(1605)
@OETestDepends(['test_devtool_location'])
- @skipIfNotDataVar('SDK_INCLUDE_TOOLCHAIN', '1', 'SDK does not include toolchain')
def test_devtool_build_make(self):
self._test_devtool_build(self.myapp_dst)
-
+
@OETestID(1606)
@OETestDepends(['test_devtool_location'])
- @skipIfNotDataVar('SDK_INCLUDE_TOOLCHAIN', '1', 'SDK does not include toolchain')
def test_devtool_build_esdk_package(self):
self._test_devtool_build_package(self.myapp_dst)
@OETestID(1607)
@OETestDepends(['test_devtool_location'])
- @skipIfNotDataVar('SDK_INCLUDE_TOOLCHAIN', '1', 'SDK does not include toolchain')
def test_devtool_build_cmake(self):
self._test_devtool_build(self.myapp_cmake_dst)
-
+
@OETestID(1608)
@OETestDepends(['test_devtool_location'])
- @skipIfNotDataVar('SDK_INCLUDE_TOOLCHAIN', '1', 'SDK does not include toolchain')
def test_extend_autotools_recipe_creation(self):
- req = 'https://github.com/rdfa/librdfa'
- recipe = "librdfa"
- self._run('devtool add %s %s' % (recipe, req) )
try:
- self._run('devtool build %s' % recipe)
- except Exception as e:
+ self._run('devtool sdk-install libxml2')
+ self._run('devtool add librdfa https://github.com/rdfa/librdfa')
+ self._run('devtool build librdfa')
+ except subprocess.CalledProcessError as e:
print(e.output)
- self._run('devtool reset %s' % recipe)
raise e
- self._run('devtool reset %s' % recipe)
+ finally:
+ self._run('devtool reset librdfa')
@OETestID(1609)
@OETestDepends(['test_devtool_location'])
- @skipIfNotDataVar('SDK_INCLUDE_TOOLCHAIN', '1', 'SDK does not include toolchain')
def test_devtool_kernelmodule(self):
docfile = 'https://github.com/umlaeute/v4l2loopback.git'
recipe = 'v4l2loopback-driver'
self._run('devtool add %s %s' % (recipe, docfile) )
try:
self._run('devtool build %s' % recipe)
- except Exception as e:
+ except subprocess.CalledProcessError as e:
print(e.output)
- self._run('devtool reset %s' % recipe)
raise e
- self._run('devtool reset %s' % recipe)
+ finally:
+ self._run('devtool reset %s' % recipe)
@OETestID(1610)
@OETestDepends(['test_devtool_location'])
- @skipIfNotDataVar('SDK_INCLUDE_TOOLCHAIN', '1', 'SDK does not include toolchain')
def test_recipes_for_nodejs(self):
package_nodejs = "npm://registry.npmjs.org;name=winston;version=2.2.0"
self._run('devtool add %s ' % package_nodejs)
try:
self._run('devtool build %s ' % package_nodejs)
- except Exception as e:
+ except subprocess.CalledProcessError as e:
print(e.output)
- self._run('devtool reset %s' % package_nodejs)
raise e
- self._run('devtool reset %s '% package_nodejs)
-
- @classmethod
- def tearDownClass(self):
- shutil.rmtree(self.myapp_dst)
- shutil.rmtree(self.myapp_cmake_dst)
+ finally:
+ self._run('devtool reset %s '% package_nodejs)
diff --git a/meta/lib/oeqa/sdkext/cases/sdk_update.py b/meta/lib/oeqa/sdkext/cases/sdk_update.py
index 2f8598b..7cf0b29 100644
--- a/meta/lib/oeqa/sdkext/cases/sdk_update.py
+++ b/meta/lib/oeqa/sdkext/cases/sdk_update.py
@@ -11,6 +11,7 @@ from oeqa.utils.httpserver import HTTPService
class SdkUpdateTest(OESDKExtTestCase):
@classmethod
def setUpClass(self):
+
self.publish_dir = os.path.join(self.tc.sdk_dir, 'esdk_publish')
if os.path.exists(self.publish_dir):
shutil.rmtree(self.publish_dir)
diff --git a/meta/lib/oeqa/sdkext/context.py b/meta/lib/oeqa/sdkext/context.py
index 8dbcd80..bee8c39 100644
--- a/meta/lib/oeqa/sdkext/context.py
+++ b/meta/lib/oeqa/sdkext/context.py
@@ -14,8 +14,8 @@ class OESDKExtTestContextExecutor(OESDKTestContextExecutor):
help = 'esdk test component'
description = 'executes esdk tests'
- default_cases = [OESDKTestContextExecutor.default_cases[0],
- os.path.join(os.path.abspath(os.path.dirname(__file__)), 'cases')]
+ default_cases = OESDKTestContextExecutor.default_cases + \
+ [os.path.join(os.path.abspath(os.path.dirname(__file__)), 'cases')]
default_test_data = None
_executor_class = OESDKExtTestContextExecutor
diff --git a/scripts/lib/devtool/sdk.py b/scripts/lib/devtool/sdk.py
index e8bf0ad..8113418 100644
--- a/scripts/lib/devtool/sdk.py
+++ b/scripts/lib/devtool/sdk.py
@@ -260,7 +260,11 @@ def sdk_install(args, config, basepath, workspace):
def checkstamp(recipe):
stampprefix = stampprefixes[recipe]
stamps = glob.glob(stampprefix + '*')
+ print(str(recipe))
+ print(str(stampprefix))
+ print(str(stamps))
for stamp in stamps:
+ print(str(stamp))
if '.sigdata.' not in stamp and stamp.startswith((stampprefix + '.', stampprefix + '_setscene.')):
return True
else:
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Openembedded-commits
mailing list