Add Extensible SDK test suite
v2 cover Add Extensible SDK test suite
Summary of changes,
- Add new class called testsdk that now have the tests for SDK and eSDK.
- TestContext -> {Image, SDK, SDKExt}: Remove all duplicate code inside testimage and testsdk class move into oeqa/oetest and create class per type of Test.
- Extensible SDK fixes usage with proxies, when eSDK is configuring it executes setscene tasks that needs network acces if was build with sstate mirrors.
Testing was made building/running SDK and eSDK for core-image-minimal and core-image-sato, also testimage was run in core-image-minimal and core-image-sato with QemuRemote and SimpleRemote
to ensure that nothing was break.
This patchset DEPENDS on bitbake change to export proxies and NEEDS to be MERGED before, see:
bb/fetch2: Move export_proxies function from wget to utils.
There are 7 new patches that FIXES the comments in the ML did by Paul Eggleton.
The following changes since commit 60100884d4d6a20aaf499d7afcf7fc91faabd22e:
populate_sdk_ext: Add SSTATE_MIRRORS to config blacklist (2016-02-02 14:44:17 +0000)
are available in the git repository at:
git://git.yoctoproject.org/poky-contrib alimon/esdk_testsuite
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=alimon/esdk_testsuite
Aníbal Limón (28):
testimage: Modularize helper functions for get test lists. classes/testsdk: Add new class testsdk.
classes/testimage: Add defeault inherit for testsdk.
populate_sdk_ext: Set TOOLCHAINEXT_OUTPUTNAME.
get_test_suites: Add sdkext type for load test suites. classes/testsdk: Add testsdkext task only install. bb/fetch2: Move export_proxies function from wget to utils. classes/testsdk: Add call to export_proxies on testsdkext. toolchain-shar-extract.sh: Add proxy variable to new env. testimage/testsdk: Modularize TestContext. testimage/testsdk: Move get test suites routine inside TestContext. oetest.py/TestContext: Move loadTests and runTests inside it. oeqa/oetest.py: Fix missing oeqa.runtime import. classes/testsdk: Add function run_test_context classes/populate_sdk_ext: Add OE_SDK_EXT_SILENT env variable classes/testsdk: Add compatibility SDK testsuite to eSDK
testsdkext: Add skeleton for support Extensible SDK tests. classes/populate_sdk_ext: Add SDK_EXT_TARGET_MANIFEST and
SDK_EXT_HOST_MANIFEST
oeqa/sdkext: Add devtool basic tests for eSDK. classes/testsdk: Add help information on how to run tests. classes/testimage: Fix exportTests function. oeqa/sdkext/devtool.py: Add location test to ensure that devtool is
the eSDK one.
Revert "classes/populate_sdk_ext: Add OE_SDK_EXT_SILENT env variable" oeqa/oetest: oeSDKTest when run a command redirect env output to null oeqa/oetest.py: SDK{Ext,} improve host and target manifest load. oeqa/oetest: Fix compatibility SDK tests using eSDK. classes/testimage: exportTests simple improvment to use list instead
of test expresions.
classes/test{image, sdk}: Update Copyrights to match the true dates.
bitbake/lib/bb/fetch2/wget.py | 17 +- bitbake/lib/bb/utils.py | 19 ++ meta/classes/populate_sdk_ext.bbclass | 6 +- meta/classes/testimage.bbclass | 221 +---------------- meta/classes/testsdk.bbclass | 144 +++++++++++ meta/files/toolchain-shar-extract.sh | 4 +- meta/lib/oeqa/oetest.py | 388 ++++++++++++++++++++++-------- meta/lib/oeqa/sdkext/__init__.py | 3 + meta/lib/oeqa/sdkext/devtool.py | 32 +++ meta/lib/oeqa/sdkext/files/myapp/Makefile | 10 + meta/lib/oeqa/sdkext/files/myapp/myapp.c | 9 + 11 files changed, 519 insertions(+), 334 deletions(-) create mode 100644 meta/classes/testsdk.bbclass create mode 100644 meta/lib/oeqa/sdkext/__init__.py create mode 100644 meta/lib/oeqa/sdkext/devtool.py create mode 100644 meta/lib/oeqa/sdkext/files/myapp/Makefile create mode 100644 meta/lib/oeqa/sdkext/files/myapp/myapp.c
Signature · 1 line
2.1.4
PATCH v2 1/28 testimage: Modularize helper functions for get test lists.
Test lists functions can be used in other parts so modularize it and move to oeqa/oetest.py library.
Testimage class was updated to meet the new sign of the functions.
--- meta/classes/testimage.bbclass | 78 +++--------------------------------------- meta/lib/oeqa/oetest.py | 74 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 78 insertions(+), 74 deletions(-)
meta/classes/testimage.bbclass +4 -74
@@ -106,74 +106,6 @@ do_testsdk[nostamp] = "1" do_testsdk[depends] += "${TESTIMAGEDEPENDS}" do_testsdk[lockfiles] += "${TESTIMAGELOCK}" -# get testcase list from specified file -# if path is a relative path, then relative to build/conf/ -def read_testlist(d, fpath): - if not os.path.isabs(fpath): - builddir = d.getVar("TOPDIR", True) - fpath = os.path.join(builddir, "conf", fpath) - if not os.path.exists(fpath): - bb.fatal("No such manifest file: ", fpath) - tcs = [] - for line in open(fpath).readlines(): - line = line.strip() - if line and not line.startswith("#"): - tcs.append(line) - return " ".join(tcs) - -def get_tests_list(d, type="runtime"): - testsuites = [] - testslist = [] - manifests = d.getVar("TEST_SUITES_MANIFEST", True) - if manifests is not None: - manifests = manifests.split() - for manifest in manifests: - testsuites.extend(read_testlist(d, manifest).split()) - else: - testsuites = d.getVar("TEST_SUITES", True).split() - if type == "sdk": - testsuites = (d.getVar("TEST_SUITES_SDK", True) or "auto").split() - bbpath = d.getVar("BBPATH", True).split(':') - - # This relies on lib/ under each directory in BBPATH being added to sys.path - # (as done by default in base.bbclass) - for testname in testsuites: - if testname != "auto": - if testname.startswith("oeqa."): - testslist.append(testname) - continue - found = False - for p in bbpath: - if os.path.exists(os.path.join(p, 'lib', 'oeqa', type, testname + '.py')): - testslist.append("oeqa." + type + "." + testname) - found = True - break - elif os.path.exists(os.path.join(p, 'lib', 'oeqa', type, testname.split(".")[0] + '.py')): - testslist.append("oeqa." + type + "." + testname) - found = True - break - if not found: - bb.fatal('Test %s specified in TEST_SUITES could not be found in lib/oeqa/runtime under BBPATH' % testname) - - if "auto" in testsuites: - def add_auto_list(path): - if not os.path.exists(os.path.join(path, '__init__.py')): - bb.fatal('Tests directory %s exists but is missing __init__.py' % path) - files = sorted([f for f in os.listdir(path) if f.endswith('.py') and not f.startswith('_')]) - for f in files: - module = 'oeqa.' + type + '.' + f[:-3] - if module not in testslist: - testslist.append(module) - - for p in bbpath: - testpath = os.path.join(p, 'lib', 'oeqa', type) - bb.debug(2, 'Searching for tests in %s' % testpath) - if os.path.exists(testpath): - add_auto_list(testpath) - - return testslist - - def exportTests(d,tc): import json import shutil
@@ -272,7 +204,7 @@ def testimage_main(d): import oeqa.runtime import time import signal - from oeqa.oetest import loadTests, runTests + from oeqa.oetest import loadTests, runTests, get_test_suites, get_tests_list from oeqa.targetcontrol import get_target_controller from oeqa.utils.dump import get_host_dumper
@@ -286,7 +218,7 @@ def testimage_main(d): # tests in TEST_SUITES become required tests # they won't be skipped even if they aren't suitable for a image (like xorg for minimal) # testslist is what we'll actually pass to the unittest loader - testslist = get_tests_list(d) + testslist = get_tests_list(get_test_suites(d), d.getVar("BBPATH", True).split(':')) testsrequired = [t for t in d.getVar("TEST_SUITES", True).split() if t != "auto"] tagexp = d.getVar("TEST_SUITES_TAGS", True)
@@ -368,7 +300,6 @@ def testimage_main(d): testimage_main[vardepsexclude] =+ "BB_ORIGENV" - def testsdk_main(d): import unittest import os
@@ -377,7 +308,7 @@ def testsdk_main(d): import oeqa.sdk import time import subprocess - from oeqa.oetest import loadTests, runTests + from oeqa.oetest import loadTests, runTests, get_test_suites, get_tests_list pn = d.getVar("PN", True) bb.utils.mkdirhier(d.getVar("TEST_LOG_DIR", True))
@@ -385,7 +316,7 @@ def testsdk_main(d): # tests in TEST_SUITES become required tests # they won't be skipped even if they aren't suitable. # testslist is what we'll actually pass to the unittest loader - testslist = get_tests_list(d, "sdk") + testslist = get_tests_list(get_test_suites(d, "sdk"), d.getVar("BBPATH", True).split(':'), "sdk") testsrequired = [t for t in (d.getVar("TEST_SUITES_SDK", True) or "auto").split() if t != "auto"] tcname = d.expand("${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.sh")
@@ -457,4 +388,3 @@ def testsdk_main(d): bb.utils.remove(sdktestdir, True) testsdk_main[vardepsexclude] =+ "BB_ORIGENV" -
meta/lib/oeqa/oetest.py +74 -0
77 lines not on this page · raw message
Signature · 1 line
2.1.4
PATCH v2 2/28 classes/testsdk: Add new class testsdk.
In reply to Aníbal LimónMoves all the testsdk code from testimage in order to have it's own class because new tests will be added for extensible SDK.
The old paths for store logs "${WORKDIR}/testimage" and sdk "${WORKDIR}/testimage-sdk" was maintained for compatibility may be change to point testsdk after review the codebase.
The dependency of QEMU was removed because isn't needed.
--- meta/classes/testimage.bbclass | 98 ---------------------------------------- meta/classes/testsdk.bbclass | 100 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 100 insertions(+), 98 deletions(-) create mode 100644 meta/classes/testsdk.bbclass
meta/classes/testimage.bbclass +0 -98
@@ -98,14 +98,6 @@ do_testimage[nostamp] = "1" do_testimage[depends] += "${TESTIMAGEDEPENDS}" do_testimage[lockfiles] += "${TESTIMAGELOCK}" -python do_testsdk() { - testsdk_main(d) -} -addtask testsdk -do_testsdk[nostamp] = "1" -do_testsdk[depends] += "${TESTIMAGEDEPENDS}" -do_testsdk[lockfiles] += "${TESTIMAGELOCK}" - def exportTests(d,tc): import json import shutil
@@ -197,7 +189,6 @@ def exportTests(d,tc): bb.plain("Exported tests to: %s" % exportpath) - def testimage_main(d): import unittest import os
@@ -299,92 +290,3 @@ def testimage_main(d): target.stop() testimage_main[vardepsexclude] =+ "BB_ORIGENV" - -def testsdk_main(d): - import unittest - import os - import glob - import oeqa.runtime - import oeqa.sdk - import time - import subprocess - from oeqa.oetest import loadTests, runTests, get_test_suites, get_tests_list - - pn = d.getVar("PN", True) - bb.utils.mkdirhier(d.getVar("TEST_LOG_DIR", True)) - - # tests in TEST_SUITES become required tests - # they won't be skipped even if they aren't suitable. - # testslist is what we'll actually pass to the unittest loader - testslist = get_tests_list(get_test_suites(d, "sdk"), d.getVar("BBPATH", True).split(':'), "sdk") - testsrequired = [t for t in (d.getVar("TEST_SUITES_SDK", True) or "auto").split() if t != "auto"] - - tcname = d.expand("${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.sh") - if not os.path.exists(tcname): - bb.fatal("The toolchain is not built. Build it before running the tests: 'bitbake <image> -c populate_sdk' .") - - class TestContext(object): - def __init__(self): - self.d = d - self.testslist = testslist - self.testsrequired = testsrequired - self.filesdir = os.path.join(os.path.dirname(os.path.abspath(oeqa.runtime.__file__)),"files") - self.sdktestdir = sdktestdir - self.sdkenv = sdkenv - self.imagefeatures = d.getVar("IMAGE_FEATURES", True).split() - self.distrofeatures = d.getVar("DISTRO_FEATURES", True).split() - manifest = d.getVar("SDK_TARGET_MANIFEST", True) - try: - with open(manifest) as f: - self.pkgmanifest = f.read() - except IOError as e: - bb.fatal("No package manifest file found. Did you build the sdk image?\n%s" % e) - hostmanifest = d.getVar("SDK_HOST_MANIFEST", True) - try: - with open(hostmanifest) as f: - self.hostpkgmanifest = f.read() - except IOError as e: - bb.fatal("No host package manifest file found. Did you build the sdk image?\n%s" % e) - - sdktestdir = d.expand("${WORKDIR}/testimage-sdk/") - bb.utils.remove(sdktestdir, True) - bb.utils.mkdirhier(sdktestdir) - try: - subprocess.check_output("cd %s; %s <<EOF\n./tc\nY\nEOF" % (sdktestdir, tcname), shell=True) - except subprocess.CalledProcessError as e: - bb.fatal("Couldn't install the SDK:\n%s" % e.output) - - try: - targets = glob.glob(d.expand(sdktestdir + "/tc/environment-setup-*")) - bb.warn(str(targets)) - for sdkenv in targets: - bb.plain("Testing %s" % sdkenv) - # test context - tc = TestContext() - - # this is a dummy load of tests - # we are doing that to find compile errors in the tests themselves - # before booting the image - try: - loadTests(tc, "sdk") - except Exception as e: - import traceback - bb.fatal("Loading tests failed:\n%s" % traceback.format_exc()) - - - starttime = time.time() - result = runTests(tc, "sdk") - stoptime = time.time() - if result.wasSuccessful(): - bb.plain("%s SDK(%s):%s - Ran %d test%s in %.3fs" % (pn, os.path.basename(tcname), os.path.basename(sdkenv),result.testsRun, result.testsRun != 1 and "s" or "", stoptime - starttime)) - msg = "%s - OK - All required tests passed" % pn - skipped = len(result.skipped) - if skipped: - msg += " (skipped=%d)" % skipped - bb.plain(msg) - else: - raise bb.build.FuncFailed("%s - FAILED - check the task log and the commands log" % pn ) - finally: - bb.utils.remove(sdktestdir, True) - -testsdk_main[vardepsexclude] =+ "BB_ORIGENV"
meta/classes/testsdk.bbclass new file +100 -0
100 lines not on this page · raw message
Signature · 1 line
2.1.4
PATCH v2 3/28 classes/testimage: Add defeault inherit for testsdk.
In reply to Aníbal LimónFor compatibility adds default inherit of the new class testsdk for now, we need to review the code base.
--- meta/classes/testimage.bbclass | 2 ++ 1 file changed, 2 insertions(+)
meta/classes/testimage.bbclass +2 -0
@@ -290,3 +290,5 @@ def testimage_main(d): target.stop() testimage_main[vardepsexclude] =+ "BB_ORIGENV" + +inherit testsdk
Signature · 1 line
2.1.4
PATCH v2 4/28 populate_sdk_ext: Set TOOLCHAINEXT_OUTPUTNAME.
In reply to Aníbal LimónThis variable is needed by testextsdk to known the name of extensible sdk file generated.
--- meta/classes/populate_sdk_ext.bbclass | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
meta/classes/populate_sdk_ext.bbclass +2 -1
@@ -45,7 +45,8 @@ COREBASE_FILES ?= " \ SDK_DIR_task-populate-sdk-ext = "${WORKDIR}/sdk-ext" B_task-populate-sdk-ext = "${SDK_DIR}" -TOOLCHAIN_OUTPUTNAME_task-populate-sdk-ext = "${SDK_NAME}-toolchain-ext-${SDK_VERSION}" +TOOLCHAINEXT_OUTPUTNAME = "${SDK_NAME}-toolchain-ext-${SDK_VERSION}" +TOOLCHAIN_OUTPUTNAME_task-populate-sdk-ext = "${TOOLCHAINEXT_OUTPUTNAME}" SDK_TITLE_task-populate-sdk-ext = "${@d.getVar('DISTRO_NAME', True) or d.getVar('DISTRO', True)} Extensible SDK"
Signature · 1 line
2.1.4
PATCH v2 5/28 get_test_suites: Add sdkext type for load test suites.
In reply to Aníbal Limón--- meta/lib/oeqa/oetest.py | 2 ++ 1 file changed, 2 insertions(+)
meta/lib/oeqa/oetest.py +2 -0
@@ -271,6 +271,8 @@ def get_test_suites(d, type='runtime'): if type == "sdk": testsuites = (d.getVar("TEST_SUITES_SDK", True) or "auto").split() + elif type == "sdkext": + testsuites = (d.getVar("TEST_SUITES_SDKEXT", True) or "auto").split() else: manifests = (d.getVar("TEST_SUITES_MANIFEST", True) or '').split() if manifests:
Signature · 1 line
2.1.4
PATCH v2 6/28 classes/testsdk: Add testsdkext task only install.
In reply to Aníbal LimónAdd task for test extensible sdk for now only install the SDK.
--- meta/classes/testsdk.bbclass | 45 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+)
meta/classes/testsdk.bbclass +45 -0
@@ -98,3 +98,48 @@ python do_testsdk() { addtask testsdk do_testsdk[nostamp] = "1" do_testsdk[lockfiles] += "${TESTSDKLOCK}" + +TEST_LOG_SDKEXT_DIR ?= "${WORKDIR}/testsdkext" +TESTSDKEXTLOCK = "${TMPDIR}/testsdkext.lock" + +def testsdkext_main(d): + import unittest + import os + import glob + import oeqa.sdkext + import time + import subprocess + from oeqa.oetest import loadTests, runTests, get_test_suites, get_tests_list + + pn = d.getVar("PN", True) + bb.utils.mkdirhier(d.getVar("TEST_LOG_SDKEXT_DIR", True)) + + # tests in TEST_SUITES become required tests + # they won't be skipped even if they aren't suitable. + # testslist is what we'll actually pass to the unittest loader + testslist = get_tests_list(get_test_suites(d, "sdkext"), + d.getVar("BBPATH", True).split(':'), "sdkext") + testsrequired = [t for t in (d.getVar("TEST_SUITES_SDKEXT", True) or \ + "auto").split() if t != "auto"] + + tcname = d.expand("${SDK_DEPLOY}/${TOOLCHAINEXT_OUTPUTNAME}.sh") + if not os.path.exists(tcname): + bb.fatal("The toolchain ext is not built. Build it before running the" \ + " tests: 'bitbake <image> -c populate_sdk_ext' .") + + testdir = d.expand("${WORKDIR}/testsdkext/") + bb.utils.remove(testdir, True) + bb.utils.mkdirhier(testdir) + try: + subprocess.check_output("%s -y -d %s" % (tcname, testdir), shell=True) + except subprocess.CalledProcessError as e: + bb.fatal("Couldn't install the SDK EXT:\n%s" % e.output) + +testsdkext_main[vardepsexclude] =+ "BB_ORIGENV" + +python do_testsdkext() { + testsdkext_main(d) +} +addtask testsdkext +do_testsdkext[nostamp] = "1" +do_testsdkext[lockfiles] += "${TESTSDKEXTLOCK}"
Signature · 1 line
2.1.4
PATCH v2 7/28 bb/fetch2: Move export_proxies function from wget to utils.
In reply to Aníbal LimónIn order to use in other modules since is a common function when needs to get proxies working.
--- bitbake/lib/bb/fetch2/wget.py | 17 +---------------- bitbake/lib/bb/utils.py | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 16 deletions(-)
bitbake/lib/bb/fetch2/wget.py +1 -16
@@ -37,6 +37,7 @@ from bb.fetch2 import FetchMethod from bb.fetch2 import FetchError from bb.fetch2 import logger from bb.fetch2 import runfetchcmd +from bb.utils import export_proxies from bs4 import BeautifulSoup from bs4 import SoupStrainer
@@ -219,22 +220,6 @@ class Wget(FetchMethod): return resp - def export_proxies(d): - variables = ['http_proxy', 'HTTP_PROXY', 'https_proxy', 'HTTPS_PROXY', - 'ftp_proxy', 'FTP_PROXY', 'no_proxy', 'NO_PROXY'] - exported = False - - for v in variables: - if v in os.environ.keys(): - exported = True - else: - v_proxy = d.getVar(v, True) - if v_proxy is not None: - os.environ[v] = v_proxy - exported = True - - return exported - class HTTPMethodFallback(urllib2.BaseHandler): """ Fallback to GET if HEAD is not allowed (405 HTTP error)
bitbake/lib/bb/utils.py +19 -0
@@ -1406,3 +1406,22 @@ def set_process_name(name): libc.prctl(15, byref(buff), 0, 0, 0) except: pass + +# export common proxies variables from datastore to environment +def export_proxies(d): + import os + + variables = ['http_proxy', 'HTTP_PROXY', 'https_proxy', 'HTTPS_PROXY', + 'ftp_proxy', 'FTP_PROXY', 'no_proxy', 'NO_PROXY'] + exported = False + + for v in variables: + if v in os.environ.keys(): + exported = True + else: + v_proxy = d.getVar(v, True) + if v_proxy is not None: + os.environ[v] = v_proxy + exported = True + + return exported
Signature · 1 line
2.1.4
PATCH v2 8/28 classes/testsdk: Add call to export_proxies on testsdkext.
In reply to Aníbal LimónExtensible SDK needs to use network and some networks requires proxies then export it.
--- meta/classes/testsdk.bbclass | 3 +++ 1 file changed, 3 insertions(+)
meta/classes/testsdk.bbclass +3 -0
@@ -110,6 +110,9 @@ def testsdkext_main(d): import time import subprocess from oeqa.oetest import loadTests, runTests, get_test_suites, get_tests_list + from bb.utils import export_proxies + + export_proxies(d) pn = d.getVar("PN", True) bb.utils.mkdirhier(d.getVar("TEST_LOG_SDKEXT_DIR", True))
Signature · 1 line
2.1.4
PATCH v2 9/28 toolchain-shar-extract.sh: Add proxy variable to new env.
In reply to Aníbal LimónExtensible SDK needs to do network operations so add proxies to environment.
--- meta/files/toolchain-shar-extract.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
meta/files/toolchain-shar-extract.sh +3 -1
@@ -1,6 +1,8 @@ #!/bin/sh -[ -z "$ENVCLEANED" ] && exec /usr/bin/env -i ENVCLEANED=1 HOME="$HOME" "$0" "$@" +[ -z "$ENVCLEANED" ] && exec /usr/bin/env -i ENVCLEANED=1 HOME="$HOME" \ + http_proxy="$http_proxy" https_proxy="$https_proxy" ftp_proxy="$ftp_proxy" \ + no_proxy="$no_proxy" GIT_PROXY_COMMAND="$GIT_PROXY_COMMAND" "$0" "$@" [ -f /etc/environment ] && . /etc/environment export PATH=`echo "$PATH" | sed -e 's/:\.//' -e 's/::/:/'`
Signature · 1 line
2.1.4
PATCH v2 10/28 testimage/testsdk: Modularize TestContext.
In reply to Aníbal LimónFrom: Aníbal Limón <[email protected]>
Move anonymous duplicated class TestContext from testimage/testsdk to oeqa/oetest now we have two new classes ImageTestContext and SDKTestContext with common code in TestContext class.
--- meta/classes/testimage.bbclass | 40 ++------------------------- meta/classes/testsdk.bbclass | 29 ++----------------- meta/lib/oeqa/oetest.py | 63 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 69 insertions(+), 63 deletions(-)
meta/classes/testimage.bbclass +3 -37
@@ -195,7 +195,8 @@ def testimage_main(d): import oeqa.runtime import time import signal - from oeqa.oetest import loadTests, runTests, get_test_suites, get_tests_list + from oeqa.oetest import loadTests, runTests, \ + get_test_suites, get_tests_list, ImageTestContext from oeqa.targetcontrol import get_target_controller from oeqa.utils.dump import get_host_dumper
@@ -212,48 +213,14 @@ def testimage_main(d): testslist = get_tests_list(get_test_suites(d), d.getVar("BBPATH", True).split(':')) testsrequired = [t for t in d.getVar("TEST_SUITES", True).split() if t != "auto"] - tagexp = d.getVar("TEST_SUITES_TAGS", True) - # we need the host dumper in test context host_dumper = get_host_dumper(d) # the robot dance target = get_target_controller(d) - class TestContext(object): - def __init__(self): - self.d = d - self.testslist = testslist - self.tagexp = tagexp - self.testsrequired = testsrequired - self.filesdir = os.path.join(os.path.dirname(os.path.abspath(oeqa.runtime.__file__)),"files") - self.target = target - self.host_dumper = host_dumper - self.imagefeatures = d.getVar("IMAGE_FEATURES", True).split() - self.distrofeatures = d.getVar("DISTRO_FEATURES", True).split() - manifest = os.path.join(d.getVar("DEPLOY_DIR_IMAGE", True), d.getVar("IMAGE_LINK_NAME", True) + ".manifest") - nomanifest = d.getVar("IMAGE_NO_MANIFEST", True) - - self.sigterm = False - self.origsigtermhandler = signal.getsignal(signal.SIGTERM) - signal.signal(signal.SIGTERM, self.sigterm_exception) - - if nomanifest is None or nomanifest != "1": - try: - with open(manifest) as f: - self.pkgmanifest = f.read() - except IOError as e: - bb.fatal("No package manifest file found. Did you build the image?\n%s" % e) - else: - self.pkgmanifest = "" - - def sigterm_exception(self, signum, stackframe): - bb.warn("TestImage received SIGTERM, shutting down...") - self.sigterm = True - self.target.stop() - # test context - tc = TestContext() + tc = ImageTestContext(d, testslist, testsrequired, target, host_dumper) # this is a dummy load of tests # we are doing that to find compile errors in the tests themselves
@@ -264,7 +231,6 @@ def testimage_main(d): import traceback bb.fatal("Loading tests failed:\n%s" % traceback.format_exc()) - if export: signal.signal(signal.SIGTERM, tc.origsigtermhandler) tc.origsigtermhandler = None
meta/classes/testsdk.bbclass +3 -26
@@ -13,7 +13,8 @@ def testsdk_main(d): import oeqa.sdk import time import subprocess - from oeqa.oetest import loadTests, runTests, get_test_suites, get_tests_list + from oeqa.oetest import loadTests, runTests, \ + get_test_suites, get_tests_list, SDKTestContext pn = d.getVar("PN", True) bb.utils.mkdirhier(d.getVar("TEST_LOG_DIR", True))
@@ -28,29 +29,6 @@ def testsdk_main(d): if not os.path.exists(tcname): bb.fatal("The toolchain is not built. Build it before running the tests: 'bitbake <image> -c populate_sdk' .") - class TestContext(object): - def __init__(self): - self.d = d - self.testslist = testslist - self.testsrequired = testsrequired - self.filesdir = os.path.join(os.path.dirname(os.path.abspath(oeqa.runtime.__file__)),"files") - self.sdktestdir = sdktestdir - self.sdkenv = sdkenv - self.imagefeatures = d.getVar("IMAGE_FEATURES", True).split() - self.distrofeatures = d.getVar("DISTRO_FEATURES", True).split() - manifest = d.getVar("SDK_TARGET_MANIFEST", True) - try: - with open(manifest) as f: - self.pkgmanifest = f.read() - except IOError as e: - bb.fatal("No package manifest file found. Did you build the sdk image?\n%s" % e) - hostmanifest = d.getVar("SDK_HOST_MANIFEST", True) - try: - with open(hostmanifest) as f: - self.hostpkgmanifest = f.read() - except IOError as e: - bb.fatal("No host package manifest file found. Did you build the sdk image?\n%s" % e) - sdktestdir = d.expand("${WORKDIR}/testimage-sdk/") bb.utils.remove(sdktestdir, True) bb.utils.mkdirhier(sdktestdir)
@@ -63,8 +41,7 @@ def testsdk_main(d): targets = glob.glob(d.expand(sdktestdir + "/tc/environment-setup-*")) for sdkenv in targets: bb.plain("Testing %s" % sdkenv) - # test context - tc = TestContext() + tc = SDKTestContext(d, testslist, testsrequired, sdktestdir, sdkenv) # this is a dummy load of tests # we are doing that to find compile errors in the tests themselves
meta/lib/oeqa/oetest.py +63 -0
77 lines not on this page · raw message
Signature · 1 line
2.1.4
PATCH v2 11/28 testimage/testsdk: Move get test suites routine inside TestContext.
In reply to Aníbal LimónFrom: Aníbal Limón <[email protected]>
In order to provide better abstraction move functions to get the test suite inside the TestContext.
--- meta/classes/testimage.bbclass | 11 +-- meta/classes/testsdk.bbclass | 19 +--- meta/lib/oeqa/oetest.py | 192 +++++++++++++++++++++++------------------ 3 files changed, 112 insertions(+), 110 deletions(-)
meta/classes/testimage.bbclass +2 -9
@@ -195,8 +195,7 @@ def testimage_main(d): import oeqa.runtime import time import signal - from oeqa.oetest import loadTests, runTests, \ - get_test_suites, get_tests_list, ImageTestContext + from oeqa.oetest import loadTests, runTests, ImageTestContext from oeqa.targetcontrol import get_target_controller from oeqa.utils.dump import get_host_dumper
@@ -207,12 +206,6 @@ def testimage_main(d): bb.utils.remove(d.getVar("TEST_EXPORT_DIR", True), recurse=True) bb.utils.mkdirhier(d.getVar("TEST_EXPORT_DIR", True)) - # tests in TEST_SUITES become required tests - # they won't be skipped even if they aren't suitable for a image (like xorg for minimal) - # testslist is what we'll actually pass to the unittest loader - testslist = get_tests_list(get_test_suites(d), d.getVar("BBPATH", True).split(':')) - testsrequired = [t for t in d.getVar("TEST_SUITES", True).split() if t != "auto"] - # we need the host dumper in test context host_dumper = get_host_dumper(d)
@@ -220,7 +213,7 @@ def testimage_main(d): target = get_target_controller(d) # test context - tc = ImageTestContext(d, testslist, testsrequired, target, host_dumper) + tc = ImageTestContext(d, target, host_dumper) # this is a dummy load of tests # we are doing that to find compile errors in the tests themselves
meta/classes/testsdk.bbclass +2 -17
@@ -13,18 +13,11 @@ def testsdk_main(d): import oeqa.sdk import time import subprocess - from oeqa.oetest import loadTests, runTests, \ - get_test_suites, get_tests_list, SDKTestContext + from oeqa.oetest import loadTests, runTests, SDKTestContext pn = d.getVar("PN", True) bb.utils.mkdirhier(d.getVar("TEST_LOG_DIR", True)) - # tests in TEST_SUITES become required tests - # they won't be skipped even if they aren't suitable. - # testslist is what we'll actually pass to the unittest loader - testslist = get_tests_list(get_test_suites(d, "sdk"), d.getVar("BBPATH", True).split(':'), "sdk") - testsrequired = [t for t in (d.getVar("TEST_SUITES_SDK", True) or "auto").split() if t != "auto"] - tcname = d.expand("${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.sh") if not os.path.exists(tcname): bb.fatal("The toolchain is not built. Build it before running the tests: 'bitbake <image> -c populate_sdk' .")
@@ -41,7 +34,7 @@ def testsdk_main(d): targets = glob.glob(d.expand(sdktestdir + "/tc/environment-setup-*")) for sdkenv in targets: bb.plain("Testing %s" % sdkenv) - tc = SDKTestContext(d, testslist, testsrequired, sdktestdir, sdkenv) + tc = SDKTestContext(d, sdktestdir, sdkenv) # this is a dummy load of tests # we are doing that to find compile errors in the tests themselves
@@ -94,14 +87,6 @@ def testsdkext_main(d): pn = d.getVar("PN", True) bb.utils.mkdirhier(d.getVar("TEST_LOG_SDKEXT_DIR", True)) - # tests in TEST_SUITES become required tests - # they won't be skipped even if they aren't suitable. - # testslist is what we'll actually pass to the unittest loader - testslist = get_tests_list(get_test_suites(d, "sdkext"), - d.getVar("BBPATH", True).split(':'), "sdkext") - testsrequired = [t for t in (d.getVar("TEST_SUITES_SDKEXT", True) or \ - "auto").split() if t != "auto"] - tcname = d.expand("${SDK_DEPLOY}/${TOOLCHAINEXT_OUTPUTNAME}.sh") if not os.path.exists(tcname): bb.fatal("The toolchain ext is not built. Build it before running the" \
meta/lib/oeqa/oetest.py +108 -84
223 lines not on this page · raw message
Signature · 1 line
2.1.4
PATCH v2 12/28 oetest.py/TestContext: Move loadTests and runTests inside it.
In reply to Aníbal LimónFrom: Aníbal Limón <[email protected]>
Method's for loadTests and runTests make sense to define inside TestContext because it can be different around Image, SDK, SDKExt.
--- meta/classes/testimage.bbclass | 6 +- meta/classes/testsdk.bbclass | 6 +- meta/lib/oeqa/oetest.py | 197 ++++++++++++++++++++--------------------- 3 files changed, 103 insertions(+), 106 deletions(-)
meta/classes/testimage.bbclass +3 -3
@@ -195,7 +195,7 @@ def testimage_main(d): import oeqa.runtime import time import signal - from oeqa.oetest import loadTests, runTests, ImageTestContext + from oeqa.oetest import ImageTestContext from oeqa.targetcontrol import get_target_controller from oeqa.utils.dump import get_host_dumper
@@ -219,7 +219,7 @@ def testimage_main(d): # we are doing that to find compile errors in the tests themselves # before booting the image try: - loadTests(tc) + tc.loadTests() except Exception as e: import traceback bb.fatal("Loading tests failed:\n%s" % traceback.format_exc())
@@ -233,7 +233,7 @@ def testimage_main(d): try: target.start() starttime = time.time() - result = runTests(tc) + result = tc.runTests() stoptime = time.time() if result.wasSuccessful(): bb.plain("%s - Ran %d test%s in %.3fs" % (pn, result.testsRun, result.testsRun != 1 and "s" or "", stoptime - starttime))
meta/classes/testsdk.bbclass +3 -3
@@ -13,7 +13,7 @@ def testsdk_main(d): import oeqa.sdk import time import subprocess - from oeqa.oetest import loadTests, runTests, SDKTestContext + from oeqa.oetest import SDKTestContext pn = d.getVar("PN", True) bb.utils.mkdirhier(d.getVar("TEST_LOG_DIR", True))
@@ -40,13 +40,13 @@ def testsdk_main(d): # we are doing that to find compile errors in the tests themselves # before booting the image try: - loadTests(tc, "sdk") + tc.loadTests() except Exception as e: import traceback bb.fatal("Loading tests failed:\n%s" % traceback.format_exc()) starttime = time.time() - result = runTests(tc, "sdk") + result = tc.runTests() stoptime = time.time() if result.wasSuccessful(): bb.plain("%s SDK(%s):%s - Ran %d test%s in %.3fs" % (pn, os.path.basename(tcname), os.path.basename(sdkenv),result.testsRun, result.testsRun != 1 and "s" or "", stoptime - starttime))
meta/lib/oeqa/oetest.py +97 -100
221 lines not on this page · raw message
Signature · 1 line
2.1.4
PATCH v2 13/28 oeqa/oetest.py: Fix missing oeqa.runtime import.
In reply to Aníbal LimónFrom: Aníbal Limón <[email protected]>
oeqa.runtime import is used in TestContext to get data fixtures directory.
--- meta/lib/oeqa/oetest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta/lib/oeqa/oetest.py +1 -1
@@ -18,7 +18,7 @@ except ImportError: pass import logging -import oeqa +import oeqa.runtime from oeqa.utils.decorators import LogResults, gettag, getResults logger = logging.getLogger("BitBake")
Signature · 1 line
2.1.4
PATCH v2 14/28 classes/testsdk: Add function run_test_context
In reply to Aníbal LimónFrom: Aníbal Limón <[email protected]>
This helper functions will be serve as well to run extensible sdk tests so generalize it to get function context as arg.
--- meta/classes/testsdk.bbclass | 62 +++++++++++++++++++++++--------------------- 1 file changed, 32 insertions(+), 30 deletions(-)
meta/classes/testsdk.bbclass +32 -30
@@ -5,13 +5,40 @@ TEST_LOG_DIR ?= "${WORKDIR}/testimage" TESTSDKLOCK = "${TMPDIR}/testsdk.lock" +def run_test_context(CTestContext, d, testdir, tcname, pn): + import glob + import time + + targets = glob.glob(d.expand(testdir + "/tc/environment-setup-*")) + for sdkenv in targets: + bb.plain("Testing %s" % sdkenv) + tc = CTestContext(d, testdir, sdkenv) + + # this is a dummy load of tests + # we are doing that to find compile errors in the tests themselves + # before booting the image + try: + tc.loadTests() + except Exception as e: + import traceback + bb.fatal("Loading tests failed:\n%s" % traceback.format_exc()) + + starttime = time.time() + result = tc.runTests() + stoptime = time.time() + if result.wasSuccessful(): + bb.plain("%s SDK(%s):%s - Ran %d test%s in %.3fs" % (pn, os.path.basename(tcname), os.path.basename(sdkenv),result.testsRun, result.testsRun != 1 and "s" or "", stoptime - starttime)) + msg = "%s - OK - All required tests passed" % pn + skipped = len(result.skipped) + if skipped: + msg += " (skipped=%d)" % skipped + bb.plain(msg) + else: + raise bb.build.FuncFailed("%s - FAILED - check the task log and the commands log" % pn ) + def testsdk_main(d): - import unittest import os - import glob - import oeqa.runtime import oeqa.sdk - import time import subprocess from oeqa.oetest import SDKTestContext
@@ -31,32 +58,7 @@ def testsdk_main(d): bb.fatal("Couldn't install the SDK:\n%s" % e.output) try: - targets = glob.glob(d.expand(sdktestdir + "/tc/environment-setup-*")) - for sdkenv in targets: - bb.plain("Testing %s" % sdkenv) - tc = SDKTestContext(d, sdktestdir, sdkenv) - - # this is a dummy load of tests - # we are doing that to find compile errors in the tests themselves - # before booting the image - try: - tc.loadTests() - except Exception as e: - import traceback - bb.fatal("Loading tests failed:\n%s" % traceback.format_exc()) - - starttime = time.time() - result = tc.runTests() - stoptime = time.time() - if result.wasSuccessful(): - bb.plain("%s SDK(%s):%s - Ran %d test%s in %.3fs" % (pn, os.path.basename(tcname), os.path.basename(sdkenv),result.testsRun, result.testsRun != 1 and "s" or "", stoptime - starttime)) - msg = "%s - OK - All required tests passed" % pn - skipped = len(result.skipped) - if skipped: - msg += " (skipped=%d)" % skipped - bb.plain(msg) - else: - raise bb.build.FuncFailed("%s - FAILED - check the task log and the commands log" % pn ) + run_test_context(SDKTestContext, d, sdktestdir, tcname, pn) finally: bb.utils.remove(sdktestdir, True)
Signature · 1 line
2.1.4
PATCH v2 15/28 classes/populate_sdk_ext: Add OE_SDK_EXT_SILENT env variable
In reply to Aníbal LimónFrom: Aníbal Limón <[email protected]>
Sometimes we need to load environment without show help information only useful when user is interacting with the SDK.
For example: For test extensible SDK.
--- meta/classes/populate_sdk_ext.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/populate_sdk_ext.bbclass +1 -1
@@ -296,7 +296,7 @@ sdk_ext_postinst() { # so put it at the end of $PATH. echo "export PATH=\$PATH:$target_sdk_dir/sysroots/${SDK_SYS}/${bindir_nativesdk}" >> $env_setup_script - echo "printf 'SDK environment now set up; additionally you may now run devtool to perform development tasks.\nRun devtool --help for further details.\n'" >> $env_setup_script + echo "[ -z \$OE_SDK_EXT_SILENT ] && printf 'SDK environment now set up; additionally you may now run devtool to perform development tasks.\nRun devtool --help for further details.\n'" >> $env_setup_script # Warn if trying to use external bitbake and the ext SDK together echo "(which bitbake > /dev/null 2>&1 && echo 'WARNING: attempting to use the extensible SDK in an environment set up to run bitbake - this may lead to unexpected results. Please source this script in a new shell session instead.') || true" >> $env_setup_script
Signature · 1 line
2.1.4
PATCH v2 16/28 classes/testsdk: Add compatibility SDK testsuite to eSDK
In reply to Aníbal LimónFrom: Aníbal Limón <[email protected]>
Extensible SDK is compatible with SDK test suite so it need to execute the same tests over it.
--- meta/classes/testsdk.bbclass | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-)
meta/classes/testsdk.bbclass +21 -5
@@ -75,17 +75,27 @@ TEST_LOG_SDKEXT_DIR ?= "${WORKDIR}/testsdkext" TESTSDKEXTLOCK = "${TMPDIR}/testsdkext.lock" def testsdkext_main(d): - import unittest import os - import glob import oeqa.sdkext - import time import subprocess - from oeqa.oetest import loadTests, runTests, get_test_suites, get_tests_list + from oeqa.oetest import SDKTestContext, SDKExtTestContext from bb.utils import export_proxies + # extensible sdk use network export_proxies(d) + # extensible sdk shows a warning if found bitbake in the path + # because can cause problems so clean it + new_path = '' + for p in os.environ['PATH'].split(':'): + if 'bitbake/bin' in p or 'poky/scripts' in p: + continue + new_path = new_path + p + ':' + new_path = new_path[:-1] + os.environ['PATH'] = new_path + + os.environ['OE_SDK_EXT_SILENT'] = "1" + pn = d.getVar("PN", True) bb.utils.mkdirhier(d.getVar("TEST_LOG_SDKEXT_DIR", True))
@@ -98,10 +108,16 @@ def testsdkext_main(d): bb.utils.remove(testdir, True) bb.utils.mkdirhier(testdir) try: - subprocess.check_output("%s -y -d %s" % (tcname, testdir), shell=True) + subprocess.check_output("%s -y -d %s/tc" % (tcname, testdir), shell=True) except subprocess.CalledProcessError as e: bb.fatal("Couldn't install the SDK EXT:\n%s" % e.output) + try: + bb.plain("Running SDK Compatibility tests ...") + run_test_context(SDKTestContext, d, testdir, tcname, pn) + finally: + bb.utils.remove(testdir, True) + testsdkext_main[vardepsexclude] =+ "BB_ORIGENV" python do_testsdkext() {
Signature · 1 line
2.1.4
PATCH v2 17/28 testsdkext: Add skeleton for support Extensible SDK tests.
In reply to Aníbal LimónFrom: Aníbal Limón <[email protected]>
oeqa/sdkext: Add module and __init__.py will contain eSDK tests. classes/testsdk: Add support for run eSDK tests. oeqa/oetest: Create oeSDKExtTest for now only inherit oeSDKTest,
modified SDKExtTestContext now inherit SDKTestContext and set sdkext filesdir for store data fixtures.
--- meta/classes/testsdk.bbclass | 10 +++++++++- meta/lib/oeqa/oetest.py | 12 +++++++++++- meta/lib/oeqa/sdkext/__init__.py | 3 +++ 3 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 meta/lib/oeqa/sdkext/__init__.py
meta/classes/testsdk.bbclass +9 -1
@@ -116,7 +116,15 @@ def testsdkext_main(d): bb.plain("Running SDK Compatibility tests ...") run_test_context(SDKTestContext, d, testdir, tcname, pn) finally: - bb.utils.remove(testdir, True) + pass + + try: + bb.plain("Running Extensible SDK tests ...") + run_test_context(SDKExtTestContext, d, testdir, tcname, pn) + finally: + pass + + bb.utils.remove(testdir, True) testsdkext_main[vardepsexclude] =+ "BB_ORIGENV"
meta/lib/oeqa/oetest.py +11 -1
@@ -19,6 +19,7 @@ except ImportError: import logging import oeqa.runtime +import oeqa.sdkext from oeqa.utils.decorators import LogResults, gettag, getResults logger = logging.getLogger("BitBake")
@@ -126,6 +127,9 @@ class oeSDKTest(oeTest): def _run(self, cmd): return subprocess.check_output(". %s; " % self.tc.sdkenv + cmd, shell=True) +class oeSDKExtTest(oeSDKTest): + pass + def getmodule(pos=2): # stack returns a list of tuples containg frame information # First element of the list the is current frame, caller is 1
@@ -400,7 +404,13 @@ class SDKTestContext(TestContext): return [t for t in (self.d.getVar("TEST_SUITES_SDK", True) or \ "auto").split() if t != "auto"] -class SDKExtTestContext(TestContext): +class SDKExtTestContext(SDKTestContext): + def __init__(self, d, sdktestdir, sdkenv): + super(SDKExtTestContext, self).__init__(d, sdktestdir, sdkenv) + + self.sdkextfilesdir = os.path.join(os.path.dirname(os.path.abspath( + oeqa.sdkext.__file__)), "files") + def _get_test_namespace(self): return "sdkext"
meta/lib/oeqa/sdkext/__init__.py new file +3 -0
@@ -0,0 +1,3 @@ +# Enable other layers to have tests in the same named directory +from pkgutil import extend_path +__path__ = extend_path(__path__, __name__)
Signature · 1 line
2.1.4
PATCH v2 18/28 classes/populate_sdk_ext: Add SDK_EXT_TARGET_MANIFEST and SDK_EXT_HOST_MANIFEST
In reply to Aníbal LimónFrom: Aníbal Limón <[email protected]>
Extensible SDK needs to point to the correct manifest so add SDK_EXT_TARGET_MANIFEST and SDK_EXT_HOST_MANIFEST variables.
oeqa/oetest.py: Fix SDKExtTestContext for load the correct manifests.
--- meta/classes/populate_sdk_ext.bbclass | 3 +++ meta/lib/oeqa/oetest.py | 11 +++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-)
meta/classes/populate_sdk_ext.bbclass +3 -0
@@ -48,6 +48,9 @@ B_task-populate-sdk-ext = "${SDK_DIR}" TOOLCHAINEXT_OUTPUTNAME = "${SDK_NAME}-toolchain-ext-${SDK_VERSION}" TOOLCHAIN_OUTPUTNAME_task-populate-sdk-ext = "${TOOLCHAINEXT_OUTPUTNAME}" +SDK_EXT_TARGET_MANIFEST = "${SDK_DEPLOY}/${TOOLCHAINEXT_OUTPUTNAME}.target.manifest" +SDK_EXT_HOST_MANIFEST = "${SDK_DEPLOY}/${TOOLCHAINEXT_OUTPUTNAME}.host.manifest" + SDK_TITLE_task-populate-sdk-ext = "${@d.getVar('DISTRO_NAME', True) or d.getVar('DISTRO', True)} Extensible SDK" python copy_buildsystem () {
meta/lib/oeqa/oetest.py +9 -2
@@ -382,14 +382,18 @@ class SDKTestContext(TestContext): self.sdktestdir = sdktestdir self.sdkenv = sdkenv + if not hasattr(self, 'target_manifest_name'): + self.target_manifest_name = "SDK_TARGET_MANIFEST" try: - with open(d.getVar("SDK_TARGET_MANIFEST", True)) as f: + with open(d.getVar(self.target_manifest_name, True)) as f: self.pkgmanifest = f.read() except IOError as e: bb.fatal("No package manifest file found. Did you build the sdk image?\n%s" % e) + if not hasattr(self, 'host_manifest_name'): + self.host_manifest_name = "SDK_HOST_MANIFEST" try: - with open(d.getVar("SDK_HOST_MANIFEST", True)) as f: + with open(d.getVar(self.host_manifest_name, True)) as f: self.hostpkgmanifest = f.read() except IOError as e: bb.fatal("No host package manifest file found. Did you build the sdk image?\n%s" % e)
@@ -406,6 +410,9 @@ class SDKTestContext(TestContext): class SDKExtTestContext(SDKTestContext): def __init__(self, d, sdktestdir, sdkenv): + self.target_manifest_name = "SDK_EXT_TARGET_MANIFEST" + self.host_manifest_name = "SDK_EXT_HOST_MANIFEST" + super(SDKExtTestContext, self).__init__(d, sdktestdir, sdkenv) self.sdkextfilesdir = os.path.join(os.path.dirname(os.path.abspath(
Signature · 1 line
2.1.4
PATCH v2 19/28 oeqa/sdkext: Add devtool basic tests for eSDK.
In reply to Aníbal LimónFrom: Aníbal Limón <[email protected]>
Add simple myapp application is a C app that prints hello world and exit.
Add devtool test for that this app to the workspace, build and reset it.
--- meta/lib/oeqa/sdkext/devtool.py | 25 +++++++++++++++++++++++++ meta/lib/oeqa/sdkext/files/myapp/Makefile | 10 ++++++++++ meta/lib/oeqa/sdkext/files/myapp/myapp.c | 9 +++++++++ 3 files changed, 44 insertions(+) create mode 100644 meta/lib/oeqa/sdkext/devtool.py create mode 100644 meta/lib/oeqa/sdkext/files/myapp/Makefile create mode 100644 meta/lib/oeqa/sdkext/files/myapp/myapp.c
meta/lib/oeqa/sdkext/devtool.py new file +25 -0
@@ -0,0 +1,25 @@ +import shutil + +from oeqa.oetest import oeSDKExtTest +from oeqa.utils.decorators import * + +class DevtoolTest(oeSDKExtTest): + + @classmethod + def setUpClass(self): + self.myapp_src = os.path.join(self.tc.sdkextfilesdir, "myapp") + self.myapp_dst = os.path.join(self.tc.sdktestdir, "myapp") + shutil.copytree(self.myapp_src, self.myapp_dst) + + def test_devtool_add_reset(self): + self._run('devtool add myapp %s' % self.myapp_dst) + self._run('devtool reset myapp') + + def test_devtool_build(self): + self._run('devtool add myapp %s' % self.myapp_dst) + self._run('devtool build myapp') + self._run('devtool reset myapp') + + @classmethod + def tearDownClass(self): + shutil.rmtree(self.myapp_dst)
meta/lib/oeqa/sdkext/files/myapp/Makefile new file +10 -0
@@ -0,0 +1,10 @@ +all: myapp + +myapp: myapp.o + $(CC) $(LDFLAGS) $< -o $@ + +myapp.o: myapp.c + $(CC) $(CFLAGS) -c $< -o $@ + +clean: + rm -rf myapp.o myapp
meta/lib/oeqa/sdkext/files/myapp/myapp.c new file +9 -0
@@ -0,0 +1,9 @@ +#include <stdio.h> + +int +main (int argc,char *argv[]) +{ +printf ("Hello world\n" ); + +return 0 ; +}
Signature · 1 line
2.1.4
PATCH v2 20/28 classes/testsdk: Add help information on how to run tests.
In reply to Aníbal LimónFrom: Aníbal Limón <[email protected]>
--- meta/classes/testsdk.bbclass | 10 ++++++++++ 1 file changed, 10 insertions(+)
meta/classes/testsdk.bbclass +10 -0
@@ -2,6 +2,16 @@ # # Released under the MIT license (see COPYING.MIT) +# testsdk.bbclass enables testing for SDK and Extensible SDK +# +# For run SDK tests you need to do, +# - bitbake core-image-sato -c populate_sdk +# - bitbake core-image-sato -c testsdk +# +# For run eSDK tests you need to do, +# - bitbake core-image-sato -c populate_sdk_ext +# - bitbake core-image-sato -c testsdkext + TEST_LOG_DIR ?= "${WORKDIR}/testimage" TESTSDKLOCK = "${TMPDIR}/testsdk.lock"
Signature · 1 line
2.1.4
PATCH v2 21/28 classes/testimage: Fix exportTests function.
In reply to Aníbal LimónWith new structure of TestContext now holds suite and variable that contains unittest instances, it can't be exported using JSON causing and exception.
Adds the suite variable for avoid export it.
--- meta/classes/testimage.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/testimage.bbclass +1 -1
@@ -112,7 +112,7 @@ def exportTests(d,tc): savedata["host_dumper"] = {} for key in tc.__dict__: # special cases - if key != "d" and key != "target" and key != "host_dumper": + if key != "d" and key != "target" and key != "host_dumper" and key != "suite": savedata[key] = getattr(tc, key) savedata["target"]["ip"] = tc.target.ip or d.getVar("TEST_TARGET_IP", True) savedata["target"]["server_ip"] = tc.target.server_ip or d.getVar("TEST_SERVER_IP", True)
Signature · 1 line
2.1.4
PATCH v2 22/28 oeqa/sdkext/devtool.py: Add location test to ensure that devtool is the eSDK one.
In reply to Aníbal Limón--- meta/lib/oeqa/sdkext/devtool.py | 7 +++++++ 1 file changed, 7 insertions(+)
meta/lib/oeqa/sdkext/devtool.py +7 -0
@@ -11,10 +11,17 @@ class DevtoolTest(oeSDKExtTest): self.myapp_dst = os.path.join(self.tc.sdktestdir, "myapp") shutil.copytree(self.myapp_src, self.myapp_dst) + def test_devtool_location(self): + output = self._run('which devtool') + self.assertEqual(output.startswith(self.tc.sdktestdir), True, \ + msg="Seems that devtool isn't the eSDK one: %s" % output) + + @skipUnlessPassed('test_devtool_location') def test_devtool_add_reset(self): self._run('devtool add myapp %s' % self.myapp_dst) self._run('devtool reset myapp') + @skipUnlessPassed('test_devtool_location') def test_devtool_build(self): self._run('devtool add myapp %s' % self.myapp_dst) self._run('devtool build myapp')
Signature · 1 line
2.1.4
PATCH v2 23/28 Revert "classes/populate_sdk_ext: Add OE_SDK_EXT_SILENT env variable"
In reply to Aníbal LimónThis reverts commit 303985d3f402013c7c4a3355f19d48b1cef1c12f.
As discussion with Paul Eggleton, he don't want to have env variables to change the behaviour of what the env script needs to print, i'll redirect the output in oeSDK.run() method.
I didn't agree because it can hides another messages like error ones and with the variable you can control what prints or not.
--- meta/classes/populate_sdk_ext.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/populate_sdk_ext.bbclass +1 -1
@@ -299,7 +299,7 @@ sdk_ext_postinst() { # so put it at the end of $PATH. echo "export PATH=\$PATH:$target_sdk_dir/sysroots/${SDK_SYS}/${bindir_nativesdk}" >> $env_setup_script - echo "[ -z \$OE_SDK_EXT_SILENT ] && printf 'SDK environment now set up; additionally you may now run devtool to perform development tasks.\nRun devtool --help for further details.\n'" >> $env_setup_script + echo "printf 'SDK environment now set up; additionally you may now run devtool to perform development tasks.\nRun devtool --help for further details.\n'" >> $env_setup_script # Warn if trying to use external bitbake and the ext SDK together echo "(which bitbake > /dev/null 2>&1 && echo 'WARNING: attempting to use the extensible SDK in an environment set up to run bitbake - this may lead to unexpected results. Please source this script in a new shell session instead.') || true" >> $env_setup_script
Signature · 1 line
2.1.4
Re: [PATCH v2 23/28] Revert "classes/populate_sdk_ext: Add OE_SDK_EXT_SILENT env variable"
Quoted 10 lines · On Tue, 02 Feb 2016 18:30:35 Aníbal Limón wrote:
This reverts commit
303985d3f402013c7c4a3355f19d48b1cef1c12f.As discussion with Paul Eggleton, he don't want to have env variables to change the behaviour of what the env script needs to print, i'll redirect the output in
oeSDK.run()method.I didn't agree because it can hides another messages like error ones and with the variable you can control what prints or not.
Signed-off-by Aníbal Limón <[email protected]>
We don't want to add this and revert it in the same series.
Cheers,
Paul
Signature · 2 lines
Paul Eggleton Intel Open Source Technology Centre
Re: [PATCH v2 23/28] Revert "classes/populate_sdk_ext: Add OE_SDK_EXT_SILENT env variable"
Quoted 7 lines · Paul Eggleton
Quoted 6 lines · On Tue, 02 Feb 2016 18:30:35 Aníbal Limón wrote:
This reverts commit
303985d3f402013c7c4a3355f19d48b1cef1c12f.As discussion with Paul Eggleton, he don't want to have env variables to change the behaviour of what the env script needs to print, i'll redirect the output in
oeSDK.run()method.
Quoted 6 lines
Quoted 4 lines
I didn't agree because it can hides another messages like error ones and with the variable you can control what prints or not.
Signed-off-by Aníbal Limón <[email protected]>We don't want to add this and revert it in the same series.
Ok, then i'll send another series without this commit and this revert in another commit.
That's ok?
alimon
Quoted 4 lines
Cheers,
Paul
Re: [PATCH v2 23/28] Revert "classes/populate_sdk_ext: Add OE_SDK_EXT_SILENT env variable"
Quoted 11 lines · On Thu, 04 Feb 2016 14:12:40 Aníbal Limón wrote:
Quoted 10 lines · Paul Eggleton
Quoted 9 lines · On Tue, 02 Feb 2016 18:30:35 Aníbal Limón wrote:
This reverts commit
303985d3f402013c7c4a3355f19d48b1cef1c12f.As discussion with Paul Eggleton, he don't want to have env variables to change the behaviour of what the env script needs to print, i'll redirect the output in
oeSDK.run()method.I didn't agree because it can hides another messages like error ones and with the variable you can control what prints or not.
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
Signed-off-by Aníbal Limón <[email protected]>We don't want to add this and revert it in the same series.
Ok, then i'll send another series without this commit and this revert in another commit.
If you mean without both the commit and the revert, then yes.
Cheers,
Paul
Signature · 2 lines
Paul Eggleton Intel Open Source Technology Centre
Re: [PATCH v2 23/28] Revert "classes/populate_sdk_ext: Add OE_SDK_EXT_SILENT env variable"
Comments below,
Quoted 12 lines · Paul Eggleton
Quoted 11 lines · On Thu, 04 Feb 2016 14:12:40 Aníbal Limón wrote:
Quoted 10 lines · Paul Eggleton
Quoted 9 lines · On Tue, 02 Feb 2016 18:30:35 Aníbal Limón wrote:
This reverts commit
303985d3f402013c7c4a3355f19d48b1cef1c12f.As discussion with Paul Eggleton, he don't want to have env variables to change the behaviour of what the env script needs to print, i'll redirect the output in
oeSDK.run()method.I didn't agree because it can hides another messages like error ones and with the variable you can control what prints or not.
Quoted 9 lines
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
Signed-off-by Aníbal Limón <[email protected]>We don't want to add this and revert it in the same series.
Ok, then i'll send another series without this commit and this revert in another commit.
If you mean without both the commit and the revert, then yes.
No i don't mean that way because i don't agree with this change and i consider this as *CENSURE* because if i someone don't agree a change the why? information need to be placed in the git repository for future references.
I'll make the changes that you requested to drop the two commits (i'm still disagree) for don't stop the process of integrate the eSDK tests that we need for a some time ago.
Cheers,
alimon
Quoted 3 lines
Cheers,
Paul
Re: [PATCH v2 23/28] Revert "classes/populate_sdk_ext: Add OE_SDK_EXT_SILENT env variable"
Quoted 22 lines · On Thu, 04 Feb 2016 14:38:56 Aníbal Limón wrote:
Comments below,
Quoted 19 lines · Paul Eggleton
Quoted 17 lines · On Thu, 04 Feb 2016 14:12:40 Aníbal Limón wrote:
Quoted 7 lines · Paul Eggleton
Quoted 6 lines · On Tue, 02 Feb 2016 18:30:35 Aníbal Limón wrote:
This reverts commit
303985d3f402013c7c4a3355f19d48b1cef1c12f.As discussion with Paul Eggleton, he don't want to have env variables to change the behaviour of what the env script needs to print, i'll redirect the output in
oeSDK.run()method.Quoted 6 lines
Quoted 4 lines
I didn't agree because it can hides another messages like error ones and with the variable you can control what prints or not.
Signed-off-by Aníbal Limón <[email protected]>We don't want to add this and revert it in the same series.
Ok, then i'll send another series without this commit and this revert in another commit.
Quoted 6 lines
Quoted 1 line
If you mean without both the commit and the revert, then yes.
No i don't mean that way because i don't agree with this change and i consider this as *CENSURE* because if i someone don't agree a change the why? information need to be placed in the git repository for future references.
We don't put the entire history of decisions on a change in the git history (certainly not in the form of commit and revert, anyway) or it would be really hard to follow when looking back in future. If you want to record that we discussed this alternative solution, the place to do it would be in the commit message where you make the redirection change, which was the alternative to this.
Cheers,
Paul
Signature · 2 lines
Paul Eggleton Intel Open Source Technology Centre
Re: [PATCH v2 23/28] Revert "classes/populate_sdk_ext: Add OE_SDK_EXT_SILENT env variable"
Quoted 8 lines · Paul Eggleton
Quoted 6 lines · On Thu, 04 Feb 2016 14:38:56 Aníbal Limón wrote:
No i don't mean that way because i don't agree with this change and i
consider this as *CENSURE* because if i someone don't agree a change the
why? information need to be placed in the git repository for future references.
Quoted 11 lines
We don't put the entire history of decisions on a change in the git history
(certainly not in the form of commit and revert, anyway) or it would be really
hard to follow when looking back in future. If you want to record that we
discussed this alternative solution, the place to do it would be in the commit
message where you make the redirection change, which was the alternative to
this.
I'd also add that this is clearly being discussed on the mailing list, so there *is* a very clear public record of it.
There are patches I've disagreed with which I have merged and there are patches I've written, then dropped as after discussion they weren't right (sstate using xz is a recent obvious one). Censorship would be not even allowing those discussions to happen, we don't do that, very much the opposite.
As Paul says, we don't put it all into git history though.
Cheers,
Richard
Re: [PATCH v2 23/28] Revert "classes/populate_sdk_ext: Add OE_SDK_EXT_SILENT env variable"
Quoted 24 lines · Richard Purdie
Quoted 8 lines · Paul Eggleton
Quoted 6 lines · On Thu, 04 Feb 2016 14:38:56 Aníbal Limón wrote:
No i don't mean that way because i don't agree with this change and i
consider this as *CENSURE* because if i someone don't agree a change the
why? information need to be placed in the git repository for future references.Quoted 11 lines
We don't put the entire history of decisions on a change in the git history
(certainly not in the form of commit and revert, anyway) or it would be really
hard to follow when looking back in future. If you want to record that we
discussed this alternative solution, the place to do it would be in the commit
message where you make the redirection change, which was the alternative to
this.I'd also add that this is clearly being discussed on the mailing list, so there *is* a very clear public record of it.
Quoted 7 lines
There are patches I've disagreed with which I have merged and there are patches I've written, then dropped as after discussion they weren't right (sstate using xz is a recent obvious one). Censorship would be not even allowing those discussions to happen, we don't do that, very much the opposite.
As Paul says, we don't put it all into git history though.
Ok, i'll add the comments and the link to the ML in the original commit and drop the another two.
There is a place/wiki/etc where this kind of issues are explained?
alimon
Quoted 6 lines
Cheers,
Richard
PATCH v2 24/28 oeqa/oetest: oeSDKTest when run a command redirect env output to null
In reply to Aníbal LimónSome tests are failing because the eSDK env load script shows a help message on the output so redirect this to /dev/null.
classes/testsdk: Removed deprecated OE_SDK_EXT_SILENT variable.
See Revert "classes/populate_sdk_ext: Add OE_SDK_EXT_SILENT env variable" commit for details.
--- meta/classes/testsdk.bbclass | 2 -- meta/lib/oeqa/oetest.py | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-)
meta/classes/testsdk.bbclass +0 -2
@@ -104,8 +104,6 @@ def testsdkext_main(d): new_path = new_path[:-1] os.environ['PATH'] = new_path - os.environ['OE_SDK_EXT_SILENT'] = "1" - pn = d.getVar("PN", True) bb.utils.mkdirhier(d.getVar("TEST_LOG_SDKEXT_DIR", True))
meta/lib/oeqa/oetest.py +1 -1
@@ -125,7 +125,7 @@ class oeSDKTest(oeTest): return False def _run(self, cmd): - return subprocess.check_output(". %s; " % self.tc.sdkenv + cmd, shell=True) + return subprocess.check_output(". %s > /dev/null; %s;" % (self.tc.sdkenv, cmd), shell=True) class oeSDKExtTest(oeSDKTest): pass
Signature · 1 line
2.1.4
PATCH v2 25/28 oeqa/oetest.py: SDK{Ext, } improve host and target manifest load.
In reply to Aníbal LimónDon't pass variable name instead of it expands the host and target manifest at init of the classes.
--- meta/lib/oeqa/oetest.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
meta/lib/oeqa/oetest.py +8 -8
@@ -382,18 +382,18 @@ class SDKTestContext(TestContext): self.sdktestdir = sdktestdir self.sdkenv = sdkenv - if not hasattr(self, 'target_manifest_name'): - self.target_manifest_name = "SDK_TARGET_MANIFEST" + if not hasattr(self, 'target_manifest'): + self.target_manifest = d.getVar("SDK_TARGET_MANIFEST", True) try: - with open(d.getVar(self.target_manifest_name, True)) as f: + with open(self.target_manifest) as f: self.pkgmanifest = f.read() except IOError as e: bb.fatal("No package manifest file found. Did you build the sdk image?\n%s" % e) - if not hasattr(self, 'host_manifest_name'): - self.host_manifest_name = "SDK_HOST_MANIFEST" + if not hasattr(self, 'host_manifest'): + self.host_manifest = d.getVar("SDK_HOST_MANIFEST", True) try: - with open(d.getVar(self.host_manifest_name, True)) as f: + with open(self.host_manifest) as f: self.hostpkgmanifest = f.read() except IOError as e: bb.fatal("No host package manifest file found. Did you build the sdk image?\n%s" % e)
@@ -410,8 +410,8 @@ class SDKTestContext(TestContext): class SDKExtTestContext(SDKTestContext): def __init__(self, d, sdktestdir, sdkenv): - self.target_manifest_name = "SDK_EXT_TARGET_MANIFEST" - self.host_manifest_name = "SDK_EXT_HOST_MANIFEST" + self.target_manifest = d.getVar("SDK_EXT_TARGET_MANIFEST", True) + self.host_manifest = d.getVar("SDK_EXT_HOST_MANIFEST", True) super(SDKExtTestContext, self).__init__(d, sdktestdir, sdkenv)
Signature · 1 line
2.1.4
Re: [PATCH v2 25/28] oeqa/oetest.py: SDK{Ext, } improve host and target manifest load.
Quoted 43 lines · On Tue, 02 Feb 2016 18:30:37 Aníbal Limón wrote:
Don't pass variable name instead of it expands the host and target manifest at init of the classes.
Signed-off-by Aníbal Limón <[email protected]>--- meta/lib/oeqa/oetest.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)meta/lib/oeqa/oetest.py +6
-6@@ -382,18 +382,18 @@ class SDKTestContext(TestContext): self.sdktestdir = sdktestdir self.sdkenv = sdkenv - if not hasattr(self, 'target_manifest_name'): - self.target_manifest_name = "SDK_TARGET_MANIFEST" + if not hasattr(self, 'target_manifest'): + self.target_manifest = d.getVar("SDK_TARGET_MANIFEST", True) try: - with open(d.getVar(self.target_manifest_name, True)) as f: + with open(self.target_manifest) as f: self.pkgmanifest = f.read() except IOError as e: bb.fatal("No package manifest file found. Did you build the sdk image?\n%s" % e) - if not hasattr(self, 'host_manifest_name'): - self.host_manifest_name = "SDK_HOST_MANIFEST" + if not hasattr(self, 'host_manifest'): + self.host_manifest = d.getVar("SDK_HOST_MANIFEST", True) try: - with open(d.getVar(self.host_manifest_name, True)) as f: + with open(self.host_manifest) as f: self.hostpkgmanifest = f.read() except IOError as e:bb.fatal("No host package manifest file found. Did you build
the sdk image?\n%s" % e) @@ -410,8 +410,8 @@ class SDKTestContext(TestContext):class SDKExtTestContext(SDKTestContext):
def__init__(self, d, sdktestdir, sdkenv):
meta/lib/oeqa/oetest.py class SDKTestContext(TestContext): · line 416
Quoted 6 lines
meta/lib/oeqa/oetest.py +2
-2- self.target_manifest_name = "SDK_EXT_TARGET_MANIFEST" - self.host_manifest_name = "SDK_EXT_HOST_MANIFEST" + self.target_manifest = d.getVar("SDK_EXT_TARGET_MANIFEST", True) + self.host_manifest = d.getVar("SDK_EXT_HOST_MANIFEST", True) super(SDKExtTestContext, self).__init__(d, sdktestdir, sdkenv)
Please squash this into the earlier commit where the original logic was added.
Thanks,
Paul
Signature · 2 lines
Paul Eggleton Intel Open Source Technology Centre
Re: [PATCH v2 25/28] oeqa/oetest.py: SDK{Ext, } improve host and target manifest load.
Ok agreed.
Quoted 56 lines · Paul Eggleton
Quoted 43 lines · On Tue, 02 Feb 2016 18:30:37 Aníbal Limón wrote:
Don't pass variable name instead of it expands the host and target manifest at init of the classes.
Signed-off-by Aníbal Limón <[email protected]>--- meta/lib/oeqa/oetest.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)meta/lib/oeqa/oetest.py +6
-6@@ -382,18 +382,18 @@ class SDKTestContext(TestContext): self.sdktestdir = sdktestdir self.sdkenv = sdkenv - if not hasattr(self, 'target_manifest_name'): - self.target_manifest_name = "SDK_TARGET_MANIFEST" + if not hasattr(self, 'target_manifest'): + self.target_manifest = d.getVar("SDK_TARGET_MANIFEST", True) try: - with open(d.getVar(self.target_manifest_name, True)) as f: + with open(self.target_manifest) as f: self.pkgmanifest = f.read() except IOError as e: bb.fatal("No package manifest file found. Did you build the sdk image?\n%s" % e) - if not hasattr(self, 'host_manifest_name'): - self.host_manifest_name = "SDK_HOST_MANIFEST" + if not hasattr(self, 'host_manifest'): + self.host_manifest = d.getVar("SDK_HOST_MANIFEST", True) try: - with open(d.getVar(self.host_manifest_name, True)) as f: + with open(self.host_manifest) as f: self.hostpkgmanifest = f.read() except IOError as e:bb.fatal("No host package manifest file found. Did you build
the sdk image?\n%s" % e) @@ -410,8 +410,8 @@ class SDKTestContext(TestContext):class SDKExtTestContext(SDKTestContext):
def__init__(self, d, sdktestdir, sdkenv):meta/lib/oeqa/oetest.py class SDKTestContext(TestContext): · line 416
Quoted 6 lines
meta/lib/oeqa/oetest.py +2
-2- self.target_manifest_name = "SDK_EXT_TARGET_MANIFEST" - self.host_manifest_name = "SDK_EXT_HOST_MANIFEST" + self.target_manifest = d.getVar("SDK_EXT_TARGET_MANIFEST", True) + self.host_manifest = d.getVar("SDK_EXT_HOST_MANIFEST", True) super(SDKExtTestContext, self).__init__(d, sdktestdir, sdkenv)Please squash this into the earlier commit where the original logic was added.
Thanks,
Paul
PATCH v2 26/28 oeqa/oetest: Fix compatibility SDK tests using eSDK.
In reply to Aníbal LimónWhen run SDK tests over eSDK we need to use SDKExtTestContext instead of SDKTestContext because if we use SDKTestContext search for SDK manifest and depends on the SDK manifest generation so populate_sdk needs to be executed.
Adds a compatibility mode flag to SDKExtTestContext for search tests over sdk module instead of sdkext module and change testsdk calls to comply with this new param.
--- meta/classes/testsdk.bbclass | 6 +++--- meta/lib/oeqa/oetest.py | 13 ++++++++++--- 2 files changed, 13 insertions(+), 6 deletions(-)
meta/classes/testsdk.bbclass +3 -3
@@ -15,14 +15,14 @@ TEST_LOG_DIR ?= "${WORKDIR}/testimage" TESTSDKLOCK = "${TMPDIR}/testsdk.lock" -def run_test_context(CTestContext, d, testdir, tcname, pn): +def run_test_context(CTestContext, d, testdir, tcname, pn, *args): import glob import time targets = glob.glob(d.expand(testdir + "/tc/environment-setup-*")) for sdkenv in targets: bb.plain("Testing %s" % sdkenv) - tc = CTestContext(d, testdir, sdkenv) + tc = CTestContext(d, testdir, sdkenv, args) # this is a dummy load of tests # we are doing that to find compile errors in the tests themselves
@@ -122,7 +122,7 @@ def testsdkext_main(d): try: bb.plain("Running SDK Compatibility tests ...") - run_test_context(SDKTestContext, d, testdir, tcname, pn) + run_test_context(SDKExtTestContext, d, testdir, tcname, pn, True) finally: pass
meta/lib/oeqa/oetest.py +10 -3
@@ -376,7 +376,7 @@ class ImageTestContext(TestContext): setattr(oeRuntimeTest, "pscmd", "ps -ef" if oeTest.hasPackage("procps") else "ps") class SDKTestContext(TestContext): - def __init__(self, d, sdktestdir, sdkenv): + def __init__(self, d, sdktestdir, sdkenv, *args): super(SDKTestContext, self).__init__(d) self.sdktestdir = sdktestdir
@@ -409,9 +409,13 @@ class SDKTestContext(TestContext): "auto").split() if t != "auto"] class SDKExtTestContext(SDKTestContext): - def __init__(self, d, sdktestdir, sdkenv): + def __init__(self, d, sdktestdir, sdkenv, *args): self.target_manifest = d.getVar("SDK_EXT_TARGET_MANIFEST", True) self.host_manifest = d.getVar("SDK_EXT_HOST_MANIFEST", True) + if args: + self.cm = args[0] # Compatibility mode for run SDK tests + else: + self.cm = False super(SDKExtTestContext, self).__init__(d, sdktestdir, sdkenv)
@@ -419,7 +423,10 @@ class SDKExtTestContext(SDKTestContext): oeqa.sdkext.__file__)), "files") def _get_test_namespace(self): - return "sdkext" + if self.cm: + return "sdk" + else: + return "sdkext" def _get_test_suites(self): return (self.d.getVar("TEST_SUITES_SDK_EXT", True) or "auto").split()
Signature · 1 line
2.1.4
PATCH v2 27/28 classes/testimage: exportTests simple improvment to use list instead of test expresions.
In reply to Aníbal LimónIt's better to use a list instead if variable isn't match some value.
--- meta/classes/testimage.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/testimage.bbclass +1 -1
@@ -112,7 +112,7 @@ def exportTests(d,tc): savedata["host_dumper"] = {} for key in tc.__dict__: # special cases - if key != "d" and key != "target" and key != "host_dumper" and key != "suite": + if key not in ['d', 'target', 'host_dumper', 'suite']: savedata[key] = getattr(tc, key) savedata["target"]["ip"] = tc.target.ip or d.getVar("TEST_TARGET_IP", True) savedata["target"]["server_ip"] = tc.target.server_ip or d.getVar("TEST_SERVER_IP", True)
Signature · 1 line
2.1.4
Re: [PATCH v2 27/28] classes/testimage: exportTests simple improvment to use list instead of test expresions.
Quoted 16 lines · On Tue, 02 Feb 2016 18:30:39 Aníbal Limón wrote:
It's better to use a list instead if variable isn't match some value.
Signed-off-by Aníbal Limón <[email protected]>--- meta/classes/testimage.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)meta/classes/testimage.bbclass +0
-1@@ -112,7 +112,7 @@ def exportTests(d,tc): savedata["host_dumper"] = {} for key in tc.__dict__: # special cases - if key != "d" and key != "target" and key != "host_dumper" and key
Quoted 5 lines
!= "suite": + if key not in ['d', 'target', '
host_dumper', 'suite']:
savedata[key] =getattr(tc, key)
savedata["target"]["ip"] = tc.target.ip or d.getVar("TEST_TARGET_IP",
True) savedata["target"]["server_ip"] = tc.target.server_ip ord.getVar("TEST_SERVER_IP", True)
Please squash this into the commit where you're adding the "suite" item.
Cheers,
Paul
Signature · 2 lines
Paul Eggleton Intel Open Source Technology Centre
Re: [PATCH v2 27/28] classes/testimage: exportTests simple improvment to use list instead of test expresions.
Ok agreed.
Quoted 28 lines · Paul Eggleton
Quoted 16 lines · On Tue, 02 Feb 2016 18:30:39 Aníbal Limón wrote:
It's better to use a list instead if variable isn't match some value.
Signed-off-by Aníbal Limón <[email protected]>--- meta/classes/testimage.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)meta/classes/testimage.bbclass +0
-1@@ -112,7 +112,7 @@ def exportTests(d,tc): savedata["host_dumper"] = {} for key in tc.__dict__: # special cases - if key != "d" and key != "target" and key != "host_dumper" and keyQuoted 5 lines
!= "suite": + if key not in ['d', 'target', '
host_dumper', 'suite']:
savedata[key] =getattr(tc, key)
savedata["target"]["ip"] = tc.target.ip or d.getVar("TEST_TARGET_IP",
True) savedata["target"]["server_ip"] = tc.target.server_ip ord.getVar("TEST_SERVER_IP", True)Please squash this into the commit where you're adding the "suite" item.
Cheers,
Paul
PATCH v2 28/28 classes/test{image, sdk}: Update Copyrights to match the true dates.
In reply to Aníbal Limón--- meta/classes/testimage.bbclass | 2 +- meta/classes/testsdk.bbclass | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
meta/classes/testimage.bbclass +1 -1
@@ -1,4 +1,4 @@ -# Copyright (C) 2013 Intel Corporation +# Copyright (C) 2013 - 2016 Intel Corporation # # Released under the MIT license (see COPYING.MIT)
meta/classes/testsdk.bbclass +1 -1
@@ -1,4 +1,4 @@ -# Copyright (C) 2016 Intel Corporation +# Copyright (C) 2013 - 2016 Intel Corporation # # Released under the MIT license (see COPYING.MIT)
Signature · 1 line
2.1.4
Re: [PATCH v2 28/28] classes/test{image, sdk}: Update Copyrights to match the true dates.
Quoted 21 lines · On Tue, 02 Feb 2016 18:30:40 Aníbal Limón wrote:
Signed-off-by Aníbal Limón <[email protected]>--- meta/classes/testimage.bbclass | 2 +- meta/classes/testsdk.bbclass | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)meta/classes/testimage.bbclass +1
-1@@ -1,4 +1,4 @@ -# Copyright (C) 2013 Intel Corporation +# Copyright (C) 2013 - 2016 Intel Corporation # # Released under the MIT license (see COPYING.MIT)meta/classes/testsdk.bbclass +0
-0
meta/classes/testsdk.bbclass line 3
Quoted 4 lines
meta/classes/testsdk.bbclass +1
-1@@ -1,4 +1,4 @@ -# Copyright (C) 2016 Intel Corporation +# Copyright (C) 2013 - 2016 Intel Corporation # # Released under the MIT license (see COPYING.MIT)
Can you squash this into the commit where you create testsdk.bbclass?
Thanks,
Paul
Signature · 2 lines
Paul Eggleton Intel Open Source Technology Centre
Re: [PATCH v2 28/28] classes/test{image, sdk}: Update Copyrights to match the true dates.
Ok agreed.
Quoted 32 lines · Paul Eggleton
Quoted 21 lines · On Tue, 02 Feb 2016 18:30:40 Aníbal Limón wrote:
Signed-off-by Aníbal Limón <[email protected]>--- meta/classes/testimage.bbclass | 2 +- meta/classes/testsdk.bbclass | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)meta/classes/testimage.bbclass +1
-1@@ -1,4 +1,4 @@ -# Copyright (C) 2013 Intel Corporation +# Copyright (C) 2013 - 2016 Intel Corporation # # Released under the MIT license (see COPYING.MIT)meta/classes/testsdk.bbclass +0
-0meta/classes/testsdk.bbclass line 3
Quoted 4 lines
meta/classes/testsdk.bbclass +1
-1@@ -1,4 +1,4 @@ -# Copyright (C) 2016 Intel Corporation +# Copyright (C) 2013 - 2016 Intel Corporation # # Released under the MIT license (see COPYING.MIT)Can you squash this into the commit where you create testsdk.bbclass?
Thanks,
Paul