Commit Graph

30 Commits

Author SHA1 Message Date
Richard Purdie 2e5181e510 testsdk: Fix lockfile patch
In the previous lock removal patch I mixed up the two tasks and broke sdk
testing. Fix this by removing locks for both sdk and extsdk.

(From OE-Core rev: 20c6e876ed6b8c8ac007848e2b36e9a8a56bb703)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-03 12:21:09 +00:00
Richard Purdie e05c8d812e testsdk: Drop lockfile usage
We should be able to test sdks in parallel. As far as I can tell, this
restriction crept in for no good reason, based on locks that testimage used
for the non-qemu case.

Therefore remove the lock and allow sdks to test in parallel.

(From OE-Core rev: 54477664dc13c6aa15b3246f328b66591a340659)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-03 11:16:12 +00:00
Richard Purdie ea2fd77ba5 testsdk: Use auto.conf instead of local.conf to set SSTATE_MIRROR
The local.conf file can get overritten and changed by the SDK so (ab)use
auto.conf instead to ensure our configuration tweaks get applied.

Also ensure we append to any other configured SSTATE_MIRROR variable
that already exists.

(From OE-Core rev: 444a71b1c2d8f86fc4c35c8ff8e92bcbbe646b75)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-02 16:09:42 +00:00
Ross Burton 88c1fb2f0c oeqa/sdkext/devtool: use finally instead of repeating cleanup
Use the finally: block to always to cleanup.

Now that the test harness in testsdk.bbclass has monkey-patched
CalledProcessException to display the output we don't need to do that in the
test case.

(From OE-Core rev: 9f0f6326083ee76b72b431fbfcbe12c1ab2793b2)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-01 23:27:11 +00:00
Richard Purdie 51d6f19fa8 testsdk: Handle minimal eSDK and avoid download costs
When using a minimal eSDK, testing currently fails as the sdk isn't
populated. We therefore setup the eSDK under test to point at local
sstate and execute a command to ensure the toolchain is populated
since most of the tests depend on this being present.

At the same time, add in a link to DL_DIR through own-mirrors so
that tests which fetch source (e.g. the kernel module one) can
use the local stash. This cuts test execution of the kernel module
test from 2000s to 120s.

We did try using DL_DIR directly but that causes uninative issues
requiring other workarounds so own-mirrors is neater.

Together these fixes unbreak eSDK testing on the autobuilder.

(From OE-Core rev: 866b55905eabf93f45c10a08d5b53c459ac4c056)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-01 23:27:11 +00:00
Ming Liu e2280b9e12 meta: remove remaining True option to getVar calls
This is a complementary fix to commit 7c552996:
[ meta: remove True option to getVar calls ]

it intended to remove all True option to getVar calls, but there are
still some remaining.

Search made with the following regex: getVar ?\((.*), True\)

(From OE-Core rev: 87d03ffe03d6f01e360bfd51714be96e62506e0a)

Signed-off-by: Ming Liu <peter.x.liu@external.atlascopco.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-31 14:43:02 +00:00
Aníbal Limón 03d175f1fa classes/testsdk: Migrate to use the new OESDKExtTestContext
(From OE-Core rev: b254822dad850ce74563c83b7a9e31463501baa7)

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-23 12:05:19 +00:00
Aníbal Limón 3fac2417dd classes/testsdk: Remove the need of TEST_LOG_DIR variable
The TEST_LOG_DIR was used for store sdk_target_log this log
contains the output of the run of build commands now that information
could be found also on log.do_testsdk under WORKDIR.

The log will continue to store into SDK_DIR instead of TEST_LOG_DIR.

(From OE-Core rev: 1c9ba4b698bab916d42b58255692a7bf3d773bbc)

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-23 12:05:19 +00:00
Aníbal Limón 92c57a5db7 classes/testsdk: Migrates testsdk.bbclass to use new OESDKTestContext
The functionality provided is the same with imporvements on code
reuse and better interfaces.

(From OE-Core rev: 7a1ae3149965b162fb2c71fc7067e07a7a189249)

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-23 12:05:19 +00:00
Joshua Lock c4e2c59088 meta: remove True option to getVar calls
getVar() now defaults to expanding by default, thus remove the True
option from getVar() calls with a regex search and replace.

Search made with the following regex: getVar ?\(( ?[^,()]*), True\)

(From OE-Core rev: 7c552996597faaee2fbee185b250c0ee30ea3b5f)

Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-16 10:23:23 +00:00
Robert Yang ddfc3afced testsdk.bbclass: print which file is not found
This is helpful when debug.

(From OE-Core rev: eef945787b5717bbb5d3bbddc446d4da86e3eb62)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-23 11:10:13 +00:00
Robert P. J. Day 12809c8283 testsdk.bbclass: Clean up comments, clarify image choices.
Make it clear that SDK testing can use any valid image.

(From OE-Core rev: d190c69347921a626665a53469dcf99b3c86994b)

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-06 23:35:34 +00:00
Ulf Magnusson c5823be186 testsdk.bbclass: Use bb.fatal() instead of raising FuncFailed
This sets a good example and avoids unnecessarily contributing to
perceived complexity and cargo culting.

Motivating quote below:

< kergoth> the *original* intent was for the function/task to error via
           whatever appropriate means, bb.fatal, whatever, and
           funcfailed was what you'd catch if you were calling
           exec_func/exec_task. that is, it's what those functions
           raise, not what metadata functions should be raising
< kergoth> it didn't end up being used that way
< kergoth> but there's really never a reason to raise it yourself

FuncFailed.__init__ takes a 'name' argument rather than a 'msg'
argument, which also shows that the original purpose got lost.

(From OE-Core rev: 086240468265dc15c5b4cdb2594d5aa7c3114dda)

Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-04 16:29:05 +01:00
Paul Eggleton a702c68c5b classes/populate_sdk_ext: eliminate double execution on install
Use the new BB_SETSCENE_ENFORCE functionality to avoid having to run
bitbake twice on installing the extensible SDK - we can now do it all in
one invocation which not only takes less time, but we should also get
more meaningful errors for some types of failure, in particular where
downloading from an sstate mirror fails.

One result of this change is that you get the errors printed on the
console during normal output rather than this going to the
preparing_build_system.log file first. In OE-Core revision
227d2cbf9e0b8c35fa6644e3d72e0699db9607fa, we changed to always print the
contents of preparing_build_system.log on failure, but now at least the
error contents of that log is duplicated. Besides, I intentionally
didn't print out the contents of that log during normal usage because
it's quite verbose - the bug that we were attempting to fix was about
not getting this information when seeing failures in the automated
tests, thus I've moved printing the log to the test handling code
instead.

Part of the implementation of [YOCTO #9367].

(From OE-Core rev: e1390c1ef85862b91b067ab24f3c06ca506155ad)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:23 +01:00
Paul Eggleton ff41cfb508 classes/testsdk: print output correctly on failure
With Python 3 we get a bytes object from the command output and not a
string, which gives some ugly formatting for error messages unless you
decode it first.

(From OE-Core rev: 798bec6fe43116b51247284eb4e415337b2e8e04)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-08 09:57:23 +01:00
Aníbal Limón 738bd1a640 classes/testsdk: Pass tcname to SDK and SDKExt contexts
tcname is needed for eSDK update testcase will be used for
 publish it and then try to update

(From OE-Core rev: a75944a63482597be88ff0f3ce55025647b78e2c)

Signed-off-by: Aníbal Limón <limon.anibal@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-28 11:33:06 +00:00
Aníbal Limón 2a410b225a classes/testsdk: Move the removal of bitbake PATH to eSDK context only
The removal of bitbake and scripts PATH is only needed by eSDK tests
so move to eSDK context only.

This also it's a support for eSDK update test because it needs to
execute oe-publish-sdk from scripts.

(From OE-Core rev: 4ae0c84568f39661722cbceba8ddab22cffe5003)

Signed-off-by: Aníbal Limón <limon.anibal@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-28 11:33:06 +00:00
Aníbal Limón eb1f8b9427 classes/testsdk: Move code for avoid PATHs to oeqa.utils
Due to the neeed to use in other modules.

(From OE-Core rev: a25aef2bdefae54c8b3eb2bd4afec5a86110ddc7)

Signed-off-by: Aníbal Limón <limon.anibal@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-28 11:33:06 +00:00
Aníbal Limón 5e978d7ed8 classes/testsdk: do_testsdkext avoid STAGING_DIR/BASE_WORKDIR in PATH
The inclusion of STAGING_DIR/BASE_WORKDIR in PATH is contaminating
the environment, i.e. when try to sanity check perl (check_perl_modules)
it takes perl from STAGING_DIR causing eSDK install to fail.

(From OE-Core rev: 32611395e1da21f6f7f7916fb8077e35ee81bb23)

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-11 22:33:40 +00:00
Aníbal Limón f895a61fc1 classes/testsdk: Add help information on how to run tests.
(From OE-Core rev: fcf0dc253f914418e15e2c6afc6f649b9270824a)

Signed-off-by: Aníbal Limón <limon.anibal@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10 16:06:23 +00:00
Aníbal Limón a619ea293a oeqa/oetest: Fix compatibility SDK tests using eSDK.
When 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.

(From OE-Core rev: ebe743235b383b17225553d84bf8e6f80d364dcd)

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10 16:06:23 +00:00
Aníbal Limón 4cfdf174ce testsdkext: Add skeleton for support Extensible SDK tests.
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.

(From OE-Core rev: f3781544a5c077610498a6b7dc5244ee4c5bc6df)

Signed-off-by: Aníbal Limón <limon.anibal@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10 16:06:23 +00:00
Aníbal Limón 5580d7bd62 classes/testsdk: Add compatibility SDK testsuite to eSDK
Extensible SDK is compatible with SDK test suite so it need
to execute the same tests over it.

(From OE-Core rev: fb9db1698039ca51ae52ea623d2ca845753f8260)

Signed-off-by: Aníbal Limón <limon.anibal@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10 16:06:23 +00:00
Aníbal Limón f3c2ce2739 classes/testsdk: Add function run_test_context
This helper functions will be serve as well to run extensible
sdk tests so generalize it to get function context as arg.

(From OE-Core rev: 51782e5f77cb3f32a31a221c6e0f9b33cf3a33c9)

Signed-off-by: Aníbal Limón <limon.anibal@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10 16:06:23 +00:00
Aníbal Limón 3577c35f6e oetest.py/TestContext: Move loadTests and runTests inside it.
Method's for loadTests and runTests make sense to define
inside TestContext because it can be different around
Image, SDK, SDKExt.

(From OE-Core rev: 03af7b99e3ce36ce3e29dc31e33d2cc74eb14849)

Signed-off-by: Aníbal Limón <limon.anibal@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10 16:06:23 +00:00
Aníbal Limón 8009418d55 testimage/testsdk: Move get test suites routine inside TestContext.
In order to provide better abstraction move functions to get the test
suite inside the TestContext.

(From OE-Core rev: 552285688441330440bd1bc138aeaea87549024a)

Signed-off-by: Aníbal Limón <limon.anibal@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10 16:06:22 +00:00
Aníbal Limón b588b80d66 testimage/testsdk: Modularize TestContext.
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.

(From OE-Core rev: 593f2fdf6ee94c5f91761a669048da3598cbe3fa)

Signed-off-by: Aníbal Limón <limon.anibal@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10 16:06:22 +00:00
Aníbal Limón abd81585fa classes/testsdk: Add call to export_proxies on testsdkext.
Extensible SDK needs to use network and some networks requires
proxies then export it.

(From OE-Core rev: 1c79fce34a02fee696bccb085a09957d71d87d56)

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10 16:06:22 +00:00
Aníbal Limón 42f2ac42d2 classes/testsdk: Add testsdkext task only install.
Add task for test extensible sdk for now only install the SDK.

(From OE-Core rev: d5061e07c4fd6ea37a0ceacedb83c7878f5bfd6d)

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10 16:06:22 +00:00
Aníbal Limón 24326a983b classes/testsdk: Add new class testsdk.
Moves 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.

(From OE-Core rev: b30edc18866865ec757b3fd86eb84de530720acf)

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10 16:06:22 +00:00