Commit Graph

564 Commits

Author SHA1 Message Date
Leonardo Sandoval 900639c1b2 oeqa/utils/ftools: Ignore the exception if file does not exist
There may be cases where the configuration file (path) does not exist,
thus the remove_from_file should catch this exception. In case the exception
is not the latter (errno.ENOENT), then re-raise it.

[YOCTO #8540]

(From OE-Core rev: 1136f9e02d9cbe2c2cda189321d72b763649ba42)

Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-21 22:56:05 +01:00
Benjamin Esquivel 2e91cbd12d oeqa/selftest/manifest.py: Test support for manifests
adding support for tests to verify that manifest contents
contain entries that exist in an specified pkgdata dir

tests added:
 - manifest.VerifyManifest.test_image_manifest_entries
 - manifest.VerifyManifest.test_SDK_manifest_entries
test support written for future tests:
 -adding a setUpClass that supports other manifest tests
 -a get dir from bb var function that verifies if the dir exists
 -a ManifestEntry class defined with missing items list
 -check for the paths and fail gracefully if not there
 -debug prints for failure analysis

[YOCTO#8028]

(From OE-Core rev: aed5b7aef33459f1bb5fa29560920c254a5fd637)

Signed-off-by: Benjamin Esquivel <benjamin.esquivel@linux.intel.com>
Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-21 22:56:05 +01:00
Paul Eggleton db55d31dc2 devtool: handle virtual providers
For modify / extract / upgrade, if the specified "recipe" is not
actually a recipe but a virtual target such as virtual/kernel, map it
correctly to the actual recipe and make sure we use that name within the
workspace. Thanks to Chris Larson for reminding me this was still broken
and for a hint on how to fix it.

(From OE-Core rev: 1f7752282ffb47d2621030ddb2fa42a5e491d6d2)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-21 22:56:03 +01:00
Mariano Lopez b8f704285f oeqa/runtime: Fix setUp and tearDown methods
Currently some of the runtime test overwrites
the setUp and tearDown methods provided by
oeRuntimeTest, this will avoid some checks
required when running the test suit.

This patch changes the setUp and tearDown methods
for their local counterparts, so when these
tests are called, it will run the parent setUp
and tearDown and also the local ones.

[YOCTO #8465]

(From OE-Core rev: 13282223b07787a92c251f89251e8a49a0e4e3eb)

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-19 17:57:59 +01:00
Mariano Lopez 3327401264 oetest: Add tearDownLocal class
In the current state there are some runtime test that
don't run the tearDown method fromm oeRuntimeTest class
because the tearDown class is overwritten in the child
class.

This change adds tearDownLocal method in oeRuntimeTest
class that will run after tearDown. This method can be
overwritten in the child classes to implement specific
test functionality.

[YOCTO #8465]

(From OE-Core rev: b5917f8032d6965596868b2fe01da4e0682e2804)

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-19 17:57:59 +01:00
Mariano Lopez 48e5579c1e oeqa/utils/qemurunner: Add support for Unicode from qemu
The current state of qemurunner will drop the Unicode
characters received from qemu, this is because error
report web had problems with Unicode characters; now
that the server support Unicode, it is possible to
log all the output from qemu. So far the only Unicode
character seen is the copyright symbol.

This patch allows to get Unicode characters from the qemu
target and save the log in an UTF-8 file for latter use.

[YOCTO #8225]

(From OE-Core rev: 4708a55879e1d8fe830d230b0621029cc40de9c3)

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-07 00:11:20 +01:00
Ed Bartosh 07fc8c2dfb oe-selftest: wic: fix LocalSetup
Appended required features to build config every time
LocalSetup is run to ensure that core-image-minimal is not
rebuilt due to configuration changes.

This should fix test22_mkgummidisk and test23_mkefidisk testcases as
they depend on specific features set in LocalSetup.

(From OE-Core rev: 037b757722093ced372eaae8cc9305ad2ea81ab5)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-07 00:09:10 +01:00
Lucian Musat c9bdcf5be7 oeqa/runexported: Replaced optionparser with argparse.
Also added the default json file name as default for
the first positional argument.

(From OE-Core rev: 3cfad28dfa9ef3d142f12d7d181ee70ee1559dc4)

Signed-off-by: Lucian Musat <george.l.musat@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-01 17:54:56 +01:00
Mariano Lopez ebd5035a7b testimage: Added IO commands to dumps
This change just add two more commands to
the host dumps to get more information
related to the IO.

[YOCTO #8412]

(From OE-Core rev: 9c9fd32105bd1a5e1c01f9dd5d1a56ceef12554e)

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-01 17:54:55 +01:00
Cristian Iorga a7329e1df3 Revert "oeqa/runtime: Added one runtime testcase in connman."
connman daemon forks during normal usage,
so this test is no longer valid and generates
sometimes false positives.

This reverts commit 7d01c595c9.

(From OE-Core rev: bc974be50d5eff4eed00078ad1d1976ee81c5ecc)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-01 15:08:21 +01:00
Richard Purdie e5b9c2a9f2 oeqa/selftest/wic: Use SetupLocal instead of Setup
If we replace the code Setup method, we don't get the cleanup it performs
and this just resulted in failures on the autobuilder due to a stale
config fragment. Setup will call SetupLocal so this should be a safe
and easy fix to resolve the auobuilder failures.

(From OE-Core rev: 16957f5f1de0f1fb4052d5aef93ee10c893f4a38)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-01 07:43:38 +01:00
Richard Purdie ff17f14878 oeqa/selftest/sstatetests: Add test that MACHINE doesn't change target sigs
When we change between two machines with the same tune, we shouldn't see
rebuilds of binaries. This adds a test for this using the qemux86copy
machine. We also extend the test to cover multilibs.

(From OE-Core rev: df49d7a0f80673e73f753e8650cd88a086e77245)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-01 07:43:35 +01:00
Richard Purdie 6cfc7c0ce1 oeqa/selftest/sstatetests: Add check for same sigs for SDKMACHINE
Extend one of the sstate tests to also ensure that changing SDKMACHINE doesn't
change the target task checksums.

Also fix a typo and improve debugging by turning the diff filtering off
in all cases (if the test fails, we want to full list).

(From OE-Core rev: 24bb41f273148db023721804b98676a92f9a5f9c)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-01 07:43:35 +01:00
Leonardo Sandoval ec504e0ff6 oeqa/utils/decorators: Append the testname without the full path
When getting the failures/errors/skipped lists, include the
unit test without the full path.

This issue was found on this scenario

    | test_1_logrotate_setup (oeqa.runtime.logrotate.LogrotateTest) ... FAIL
    | test_2_logrotate (oeqa.runtime.logrotate.LogrotateTest) ... ok

Where test_1_logrotate failed and test_2_logrotate should not have
run because

    @skipUnlessPassed("test_1_logrotate_setup")
    def test_2_logrotate(self):

(From OE-Core rev: 8715beff7b910209627da3726b18b7abf801b557)

Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-01 07:43:35 +01:00
Mariano Lopez df09a6f4e3 oetest: Change logic of a failed test
Currently the logic to check if a test failed was
to check for an exception in the thread, but some
decorators used in the syslog runtime test would
generate and handle exceptions; this will mess
with the current check logic and will dump the
host and the target as if the test failed.

This patch changes the check logic to verify if
the test that just happend is in the failure test
list and dump the host and target accordingly.

[YOCTO #8406]

(From OE-Core rev: 8b97d9320b989023c62db8246f5d8d2126c3723e)

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-01 07:43:34 +01:00
Lucian Musat 1222eb18aa oeqa/runexported: Fix a problem with ssh_target_log existing in folder.
When copying the exported tests to a remote machine ssh_target_log can
be transformed from softlink to file which will throw an error when
trying to run again.

(From OE-Core rev: 2bc7732c27e192821b9ebb76e1dfba739cf5b088)

Signed-off-by: Lucian Musat <george.l.musat@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-01 07:43:34 +01:00
Mariano Lopez cb93670840 qemurunner: Sanitize output from qemu and qemu pid
Currently the output from qemu could contain control
or Unicode characters; having such characters in the
log will cause an internal server error when sending
the report to error reporting web. Control characters
can be found in the command line used to run quemu too.

This change sanitize the output from qemu and the
command line used to run qemu, this way the logs doesn't
contain control or Unicode characters and this will solve
the issue of error reporting web and generate better
logs.

The only Unicode character found in the qemu output
is the copyright symbol, it really doesn't interfer
removing Unicode characters with debugging.

[YOCTO #8225]

(From OE-Core rev: 9f25f723828d6709aad581267ccc63d2ade1ff5c)

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-01 07:43:33 +01:00
Lucian Musat 9549f57c80 oeqa/decorators: Fixed a problem with decorator logs link.
When not doing actual tests with testimage, like for example
exporting tests, the link to the log file was still created
although the actual log file was not existent. Fixed it by
moving the link creation part into the run() method.

(From OE-Core rev: 6950a5b1220d1ff81dae15195fe0d8e06977fec8)

Signed-off-by: Lucian Musat <george.l.musat@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-01 07:43:33 +01:00
Daniel Istrate 790b6c7ead oeqa/selftest/wic: Added testcase decorator to all testcases + fixed minor typos.
(From OE-Core rev: 432e85d8879ed074e04306174398a53e4903f84f)

Signed-off-by: Daniel Istrate <daniel.alexandrux.istrate@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-01 07:43:33 +01:00
Markus Lehtonen e9bae506e5 devtool: better support for local source files
* extract: Copy all local source files (i.e.  non-compressed/non-arcived
  SRC_URI files that have file:// URI prefix) - excluding patches - to
  the srctree repository. The files will be placed in a subdirectory
  called 'oe-local-files'. The oe-local-files directory is not committed
  to the Git repository, but, marked to be ignored by a .gitignore file.
  The developer can manually add and commit the files to Git if the
  changes to them need to be tracked.

  Before this patch, local source files (were copied (and committed) to
  the srctree repository only in some special cases (basically when
  S=WORKDIR) when doing devtool-extract. For most of the packages local
  files were not copied at all.

* update-recipe: This patch causes the local files to be 'synced' from
  the srctree (i.e. from the 'oe-local-files' subdirectory) to the
  layer.  Being 'synced' means that in addition to copying modified
  files over the original sources, devtool will also handle removing and
  adding local source files and updating the recipe accordingly.  We
  don't want to create patches against the local source files but rather
  update them directly.  Thus, 'oe-local-file' directory is ignored in
  patch generation when doing update-recipe, even if committed to Git.
  This functionality is only enabled if the 'oe-local-files' directory
  is present in srctree.

[YOCTO #7602]

(From OE-Core rev: a3bb5bd25b72bd1bcc156dabd0ffa2d9184bb160)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-01 07:43:32 +01:00
Markus Lehtonen 2f8440b9ae oe-selftest: devtool: add method for checking repo status
New method for checking the status of the working tree of a repository.

(From OE-Core rev: 4e5eea06a77eca7311209b0b650e79e816713ab9)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-01 07:43:31 +01:00
Markus Lehtonen 0a9f59e8d2 oe-selftest: devtool: add method for checking srctree repo
Removes some code duplication.

(From OE-Core rev: 5bd2ca137a496e34bb62cfafd406db8ae78635d6)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-01 07:43:31 +01:00
Markus Lehtonen afb01421e2 oe-selftest: devtool: add setup() method
In order to remove some code duplication.  The method currently only
does checking of workspace dir.

(From OE-Core rev: 5d7cd3dc9e497bb3c2aba4cf2af3e3ee84dd7a2f)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-01 07:43:31 +01:00
Richard Purdie 3af9f06f1b oeqa/sdk/gcc: Fix makefile test
The makefile test was hardcoding a test for gcc. In the SDK context, we
need to use $(CC) to use the cross compiler.

(From OE-Core rev: d28ddc23bbf232901ae07f7a01f821ecc4b79e32)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-28 12:00:31 +01:00
Lucian Musat 320500e38e oeqa/parselogs: Updated log parser whitelist.
Added some fixes for meta-intel boards and moved some
errors from specific images to common.

(From OE-Core rev: ccbb12f9ec7c0a5714a8b1a24efb46755408c256)

Signed-off-by: Lucian Musat <george.l.musat@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-28 12:00:24 +01:00
Lucian Musat 3fb464f6af oeqa/decorators: Add timestamp to decorator logs.
To avoid logs being overwriten when running the automated
tests multiple times, log files include timestamps in
their names and a link is created to point to the latest one.

(From OE-Core rev: 0aa6af4aec6f9773ec2aea929deb3a1ed049cbb9)

Signed-off-by: Lucian Musat <george.l.musat@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-28 12:00:22 +01:00
Richard Purdie 3408d0dc87 qemurunner: Handle qemu start failure correctly
If qemu didn't start correctly, we may not have registered the child
signal. This results in a nasty traceback which confuses the underlying
issue. Cleanup this code and make the handler cleanup conditional.

(From OE-Core rev: 0ead936925c61aaaa7a819f6c5b999ba3a4daeda)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-28 12:00:18 +01:00
Richard Purdie 09af262045 oeqa/oetest: Fix SDK command execution
The SDK environment wasn't being sourced when running these test
commands, meaning in some cases the cross compiler was being tested,
not the SDK tools. This is clearly not the intent so fix this by
ensuring the SDK environment is present. This fixes test failures
in multilib SDKs.

(From OE-Core rev: 39c56f7c280cfe6bf40ea9145f3f7060b565bc62)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-28 12:00:18 +01:00
Daniel Istrate 9673278ddd oeqa/selftest/archiver: Test that archiver filters on recipe name
[YOCTO #6929] this test validates the feature introduced in bug 6929

(From OE-Core rev: 2642fb1e00878baa8eaec80015ff3678cb3088f8)

Signed-off-by: Daniel Istrate <daniel.alexandrux.istrate@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-24 17:54:28 +01:00
Mariano Lopez 68073270f8 oeqa/utils/dump: Add default commands and directory
Currently if qemu fails when running a selftest and
tries to run some commands on the host it will fail
because some variables required by the Dumper class
do not exist because testimage was not included.

This change adds a default parent directory to save
the dumps for the host or target. Also adds default
commands to run if no commands were provided to the
class. With these changes the previous errors using
selftest don't show anymore.

[YOCTO #8306]

(From OE-Core rev: 713beaf84f8b8ab415b7a8ccba8a4a2aff7f98e5)

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-24 17:54:28 +01:00
Lucian Musat 8733b53826 oeqa/runexported: Removed DEPLOY_DIR as mandatory.
We don't need DEPLOY_DIR for every runtime test so there is no
need for it to be mandatory.

(From OE-Core rev: 9f89e8e0bf2ba65f2cff5adb3050d6a701dc486a)

Signed-off-by: Lucian Musat <george.l.musat@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-24 17:54:27 +01:00
Lucian Musat f1e7fb0856 oeqa/oetest: Remove bb as requirement for oetest.
In order for the test export runner to work oetest needs to be
separated from bitbake environment. There is no need to use bb
import here so we can use a logger instead.

(From OE-Core rev: 22bd8a600823306d7c5965a9a69b8e8888993513)

Signed-off-by: Lucian Musat <george.l.musat@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-24 17:54:27 +01:00
Aníbal Limón 61e77c7166 oeqa/runtime/parselogs.py: Fix dmesg log retrieve in sato
Sato uses busybox that fails to write log using echo "" because
dmesg output can contain special characters.

[YOCTO #8377]

(From OE-Core rev: 89107d0e01235b8cff70c0325723d2a99d2c336c)

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-24 17:54:26 +01:00
Aníbal Limón 524ddd86c3 oeqa/utils/qemurunner.py: Remove duplicate message on LoggingThread start
The Starting logging thread message is also executed on run() inside
LoggingThread class.

(From OE-Core rev: 2ad7308ee7166641eff99f3b9fe6794de143f6bc)

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-23 09:53:21 +01:00
Aníbal Limón 376ce717bd oeqa/utils/qemurunner.py: Fix HIGH CPU usage on LoggingThread
LoggingThread is used for receive console output from QEMU
over TCP, so add filter to only wake poll on read events,
also change the event mask variable name to be more descriptive.

This fixes HIGH CPU consume caused by wake on ready to write
events.

(From OE-Core rev: 7b6c9b6327638c9731cea80a52d30d4a8fb6e081)

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-23 09:53:21 +01:00
Paul Eggleton 76084cdfa6 devtool: build-image: delete bbappend at end of build
Upon further reflection, it seems to me that this bbappend ought to just
be deleted at the end of the build. This keeps things simple; you never
have to remember to delete any files to get back to where you were
before with the image. This means we can also drop the slightly awkward
message reminding the user how to do that. I've also updated the test to
look at the image manifest to determine if the command has worked
instead of looking for the (now deleted) bbappend.

(From OE-Core rev: f6b90bceaedf9bad3d111e6ca1fa79e59f472c73)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-23 09:53:19 +01:00
Daniel Istrate 266e417bb8 oeqa/selftest: buildoptions.py Removed unused imports
Removed unused imports: unittest, logging, pexpect

(From OE-Core rev: f5752cefe6ee374bffadcecb2ec50bfd38376b7d)

Signed-off-by: Daniel Istrate <daniel.alexandrux.istrate@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-23 09:53:10 +01:00
Lucian Musat bbe06b443b oeqa/testimage: Enhance -v switch in testimage
When testimage is run with -v switch now individual
test progress can be seen directly in bitbake console.

[YOCTO #6841]

(From OE-Core rev: 27138b2eeafa8b81f3020ad9d8a55263e636288c)

Signed-off-by: Lucian Musat <george.l.musat@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-23 09:52:55 +01:00
Richard Purdie 4727384a74 oeqa/sstatetests: Add test for nativesdk stamp invariance with MACHINE
nativesdk-glbic should not rebuild when you change MACHINE but
it was. We've fixed that, now add tests to ensure this doesn't
happen again.

Rather than add yet another stamps test, extend one of the
existing ones to cover this instead.

(From OE-Core rev: e55b3d88e7a9138f518301a7217f74ba98e979aa)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-18 09:05:30 +01:00
Lucian Musat d8eb9d41b0 oeqa/decorators: Added decorator to restart the DUT in case of test hang.
Once the DUT is hanged during testing, currently all the following test
cases have to wait for default timeout to exit. Using this decorator the
user can choose a timeout at case by case basis and what happens when the
timeout is reached by overwriting the self.target.restart method.

[YOCTO #7853]

(From OE-Core rev: ce9a7501ea29ddba61ef7c297223b3f7eca5a2a1)

Signed-off-by: Lucian Musat <george.l.musat@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-18 09:05:21 +01:00
Richard Purdie ba17ce3f20 oeqa/targetbuild: Ensure we run gnu-configize so config files are up to date
On aarch64 we need to do this as the versions in the upstream source don't
recognise the target triplet causing SDK test failures.

(From OE-Core rev: 2374bfa3b98f787f4559f14a60647e4c2b051274)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-12 22:48:47 +01:00
Richard Purdie a14c363409 oeqa: Test failure/cleanup improvements
Currently, if qemu segfaults, the tests merrily continue trying to execute
which takes time for them to timeout and is a bit silly. Worse, no logs about
the segfault are shown to the user, its silent!

This patch tries to unravel the tangled web of issues and ensures that we:

* install a SIGCHLD handler which tells the user qemu exited
* check if qemu is running, if it isn't fail the test outright
* don't leave processes behind in sshcontrol which would hold
  bitbake.lock and block shutdown

(From OE-Core rev: 77e9363feba53b72429154be5713c46b007ae0a4)

(From OE-Core rev: c77b57e2fa8a4cf90543038fe1939f6ca9b12bd1)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-12 22:48:33 +01:00
Ross Burton 44ae903e30 oeqa/runtime/date: stop systemd-timesyncd during test
There's a race between systemd-timesyncd manipulating the system time (with NTP
lookups) and the test case's time manipulation.  Prevent this by stopping
systemd-timesyncd for the duration of the test case.

Thanks to Khem Raj for root-causing this.

(From OE-Core rev: 5334f1b1e9363fa9c128289b51ade55c7ae1a0a3)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-12 22:48:24 +01:00
Richard Purdie 9bfaf596fb oeqa/sstatettests: Improve output of assert
Currently if this fails you see:

"AssertionError: 1 != 0"

which is useless. Add the output of the failed command so we can stand
some chance of debugging what went wrong.

(From OE-Core rev: e482f9bfddc6b710c9b566c3d3433dc2d7d5a22e)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-09 14:27:54 +01:00
Markus Lehtonen 3dd9fc39ab devtool: update-recipe: better 'auto' mode
Enhance the logic behind the 'auto' mode a bit by only updating the
SRCREV if the changes are already found upstream. The logic is simple:
update SRCREV only if the current local HEAD commit is found in the
remote branch (i.e. 'origin/<branch_name>'). Otherwise resort to
patching.

This affects a couple of the oe-selftest tests so update those as well.

[YOCTO #7907]

(From OE-Core rev: 9b9733b7d74032aef4979bec553019421e77da14)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-09 14:27:52 +01:00
Leonardo Sandoval 8be95c5fbe devtool: add upgrade feature
Upgrades a recipe to a particular version and downloads the source code
into a folder. User can avoid patching the source code.

These are the general steps of the upgrade function:

   - Extract current recipe source code into srctree and create a branch
   - Extract upgrade recipe source code into srctree and rebase with
     previous branch. In case the rebase is not correctly applied, source
     code will not be deleted, so user correct the patches
   - Creates the new recipe under the workspace

[YOCTO #7642]

(From OE-Core rev: 4020f5d91b3e4d011150d5081d36215f8eab732e)

Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-09 14:27:51 +01:00
Cristina Agurida dd075b9e79 oeqa/parselogs: Updated log error whitelist.
[YOCTO #7898]
[YOCTO #7761]
[YOCTO #7804]

(From OE-Core rev: fb3a5c732997eddee6dacb52558d4e6c8942f1e1)

Signed-off-by: Cristina Agurida <cristina-danielax.agurida@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-09 14:27:48 +01:00
Richard Purdie e87c182b6c qemurunner: Fix killpg pid usage
killpg should be being called with a pgid, not a pid.

(From OE-Core rev: d23bf86f305a04a47d19236d72979c1027a31620)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-09 14:27:47 +01:00
Richard Purdie 335260cbfc qemurunner: Ensure runqemu doesn't survive SIGKILL
Currently, we see runqemu and qemu-system-* processes left behind when
bitbake is killed by buildbot. This is due to the use of setpgrp() in
the runqemu subprocess call.

We need the setpgrp call so that all runqemu processes can easily be
killed (by killing their process group). This presents a problem if this
controlling process itself is killed however since those processes don't
notice the death of the parent and merrily continue on.

Rather than hack runqemu to deal with this, we add something to
qemurunner, at least for now to resolve the issue. Basically we fork off
another process which holds an open pipe to the parent and also is
setpgrp. If/when the pipe sees EOF from the parent dieing, it kills the
process group. This is like pctrl's PDEATHSIG but for a process group
rather than a single process.

(From OE-Core rev: 99428eafb5352bd39bc4329bdba07c6d6f17b03f)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-09 14:27:46 +01:00
Richard Purdie e3b5d8f42c qemurunner: Drop error to a warning to improve user feedback
If a task shows an error, the full log is surpressed since bitbake assumes
the user has been shown what is wrong. In this code path that isn't the
case and its much more helpful to show the user the full error. Therefore
show a warning instead to aid usability.

(From OE-Core rev: 4ccef5543649262a1630bff586ef9048fe164016)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-09 14:27:44 +01:00
Mariano Lopez 6b41b7cc32 testimage: handle SIGTERM to conclude runqemu
In the current state if a SIGTERM is sent to
the testimage worker, the worker will exit but
runqemu and qemu won't exit and the processes
need to be killed manually to free the
bitbake lock.

This allows to catch the SIGTERM signal in
testimage, this way it is possible to stop
runqemu and qemu and allow to free the bitbake lock.

Also this allows to skip the rest of the tests
when running the tests in qemu or real hardware.

This also solves minimal breaks in the setup of the
runtime test when checking if qemu is alive.

[YOCTO #8239]

(From OE-Core rev: 2694d2f17d597b44fcc7aed5f6836081fa88a6b3)

Signed-off-by: Benjamin Esquivel <benjamin.esquivel@linux.intel.com>
Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-09 14:27:39 +01:00
Lucian Musat 4925fa08e1 oeqa/decorators: Fixed a problem with tests having the same names.
When two or more tests had the same name but different classes then
the decorator log whould have the output all wrong. This was because
a comparison which was made only between method names but now it
compares classes too.

[YOCTO #8029]

(From OE-Core rev: 2b475f82d13b5c04d0c483d11a7df5e9352caa75)

Signed-off-by: Lucian Musat <george.l.musat@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-06 15:26:22 +01:00
Richard Purdie ef0fe3193e oeqa: Test failure/cleanup improvements
Currently, if qemu segfaults, the tests merrily continue trying to execute
which takes time for them to timeout and is a bit silly. Worse, no logs about
the segfault are shown to the user, its silent!

This patch tries to unravel the tangled web of issues and ensures that we:

* install a SIGCHLD handler which tells the user qemu exited
* check if qemu is running, if it isn't fail the test outright
* don't leave processes behind in sshcontrol which would hold
  bitbake.lock and block shutdown

(From OE-Core rev: 5c04b1ca1e989f569d5755a646734d01a0c56cae)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-06 15:26:18 +01:00
zjh fac0d67ec2 testimage: filter proper test cases by tags
If a test case is decorate by oeqa.utils.decorators.tag, this case will
by add a tag, testrunner will filter these tags by TEST_SUITES_TAGS
[YOCTO #7849]

(From OE-Core rev: 085589b1018ba4d950baf7bcfb499be02c1b29fc)

Signed-off-by: zjh <junhuix.zhang@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-04 16:23:52 +01:00
Mariano Lopez 097f36f636 qemurunner: Handle lack of data on run serial gracefully
This changes the behavior when data was not received over
the serial console when a command is run. With this the
socket is no longer closed but it throws and exception that
can handled in upper layers. With this the test can continue
without throwing errors for not having the socket anymore.

[YOCTO #8118]

(From OE-Core rev: 4770a766389b94ddd5639d7a92e196abac38da22)

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-03 12:43:31 +01:00
Ed Bartosh 4fd65df90f wic: add test cases for 3 images
Added test cases to build qemux86_directdisk, mkgummidisk and
mkefdisk images.

(From OE-Core rev: f2d75d76d1af9e4852637f60eac8dfc967431acb)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-03 12:43:25 +01:00
Ed Bartosh bf41b06887 oe-selftest: wic: configure a build
Added MACHINE_FEATURES and IMAGE_FSTYPES variables to the build config
to ensure that bootimg and efi artifacts are built. This is needed to
build canned wic images that are using those artifacts.

Introduced class variable Wic.image_is_ready to avoid building image
more than once. It would be better to build image in setUpClass, which
is called only once, but add_config method can't be called in class method,
so we have to use this trick with class variable in setUp method.

(From OE-Core rev: c5bb95704e00e7afdbcb2e02c1fbc74f33e26481)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-03 12:43:25 +01:00
Mariano Lopez a2b0d04235 runexported: Make it compatible with host dump
Currently it is not possible to run a exported test,
but this patch will allow to use the HosDumper class
when running a exported test, otherwise the HostDumper
class will break runexpored test.

[YOCTO #8118]

(From OE-Core rev: 25814dbdd12db0499e4d81876873158e1b8a4fcc)

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-03 12:43:17 +01:00
Mariano Lopez 53ab41a5f6 qemurunner: Added host dumps when there are errors
This adds an instance of HostDumper to qemurunner,
with this instance now is possible to get dumps
from the host when there is an error.

This adds dump points in the next cases:
    - runqemu exits before seeing qemu pid
    - Fail to get qemu process arguments
    - Not reach login banner before timeout
    - qemu pid never appears

This also modifies the constructors of BaseDumper,
HostDumper and TargetDumper, they don't require
the datastore anymore, but the feature to replace
datastore variables has been lost (never used)

[YOCTO #8118]

(From OE-Core rev: b0af40fb76cd5035696e9d8a44f815f64214d23a)

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-03 12:43:16 +01:00
Ed Bartosh 22afc047dd oe-selftest: test devtool build-image plugin
Added test case to test functionaly of build-image plugin:

Add two packages to workspace and run 'devtool build-image
core-image-minimal'.

Checked if command is successful.

Checked if expected package is added to generated
core-image-minimal.bbappend file.

(From OE-Core rev: 524c590fb44d0ef9711accf2db1a21e4a3cbcfc2)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-31 11:37:14 +01:00
Ed Bartosh beea25ec42 oe-selftest: wic: fix test19_image_env test case
This test case fails on qemu machines as not all expected bitbake
variables are present in .env file.

Fixed by filtering out optional variables.

(From OE-Core rev: dd76c276a8ebaa2e2ab17b819514589ab4507740)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-31 11:33:31 +01:00
Richard Purdie 67ed7c3435 oeqa: Add allarch sstate sig test
"allarch" targets should be MACHINE invariant. This means their sstate
signature should not change regardless of which MACHINE is built.

Errors keep creeping in around this area so automating this as part
of self test seems the best way to maintain this.

The "do_build" stamps are known to differ and are harmless so those
are excluded from the test.

(From OE-Core rev: 9f991103218f6fff67934b51411d31180d5d3e1a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-31 00:04:31 +01:00
Ed Bartosh 4f7b72a07d oe-selftest: test building wic image by bitbake
Added test case to verify building of wic-image-minimal recipe
and produced artifacts: manifest and bzipped partitioned image.

(From OE-Core rev: 9d12fe44fdb52aeb8aa2c5c2c83175a06a0c7224)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-30 23:26:26 +01:00
Ed Bartosh 70534141e7 oe-selftest: test generation of <image>.env
Added test case to check if <image>.env file is generated
and contains bitbake variables used in wic code.

(From OE-Core rev: eaa5ecd2e7ff30192e51793d1419c0198638936d)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-30 23:26:25 +01:00
Richard Purdie 8a5eb20a43 oeqa/utils/dump: Handle empty commandlist gracefully
If the commandlist isn't available, the code currently gives a backtrace.
At least stop doing that and return more gracefully.

(From OE-Core rev: e6903e9ef856d98258d81587bf85199cb7dbdca4)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-30 23:25:10 +01:00
Ross Burton ac0b85d714 oeqa/runtime/multilib: add test for libc
Add a basic test to verify that /lib/libc.so.6 and /lib32/libc.so.6 have the
right ELF class.

(From OE-Core rev: 51e9f90b3b61e34603bc02bf4cfcbd0243686798)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-30 12:36:14 +01:00
Mariano Lopez 277571bbd0 oetest: Fix regresion when testing real hardware
This fix the regresion introduced in commit
9c72c1a5aa
when testing with real hardware. This regression
happens when a test in real hardware fails.

[YOCTO #8203]

(From OE-Core rev: e63889cc70041ada022c2ebe789b569f9e44dbd6)

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-30 12:36:13 +01:00
Mariano Lopez c78ba0d4f0 dump: allow to have datastore vars on dump commands
This allows to have datastore variables in the dump
commands and will get the data when a new instance
it's created.

Also this remove special cases from the commands.

[YOCTO #8118]

(From OE-Core rev: 384927eb8d52bc5f14c63c8421aa62ee859587f0)

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-30 12:36:13 +01:00
Mariano Lopez 85fd1a7a12 dump: Created new classes for dump host and target
It makes sense to separate the dump commands from the
oeRuntimeTest class, this way it can be used in all
the test context.

These are the changes included in this patch:

    - Created classes: BaseDumper, HostDumper, TargetDumper
    - Create an instance of HostDumper in imagetest.bbclass
      and add it to TestContext class, this way any class
      that have access to the TestContext would be able
      to dump logs from the host
    - Create an instance of TargetDumper in QemuTarget
      class after get the runner, this way it is
      accessible during the tests.

[YOCTO #8118]

(From OE-Core rev: ad10af6be343b5425fde43055263b0744c161cb3)

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-30 12:36:12 +01:00
Mariano Lopez 48373be830 testimage: Run commands in target and host when test fails
This patch modify three files altought two of them
are minimal modifications. This version includes
the changes proposed by Paul.

testimage.bbclass:
    Create new vars for easy modification of the dump
directory and commands to be run on host and target
when a test fails
    TESTIMAGE_DUMP_DIR: Directory to save the dumps
    testimage_dump_target: Commands to run on target
    testimage_dump_host: Commands to run on host

oetest.py:
    - Allow to use the vars defined in testimage class
    - Now able to run commands in the host and dump the
      results
    - Fix an issue with the condition where to run the
      dump commands (Before it run the commands every
      test after a failure, now it runs the commands only
      in tests that failed)
    - Fix the output to stdout

[YOCTO #8118]

(From OE-Core rev: 26fe645457633f90bb5ddbb12f5f7b9ca4a06cc5)

(From OE-Core rev: 7b4fbbf979ed22434b8e3f83ae145139bb0d9fc7)

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-30 12:36:07 +01:00
Richard Purdie d1052050bd oeqa: Optimise sstate tests
We can use "none" here instead of printdiff for some small performance
gains. This also means we can remove the ignore exit code hack which
leads to safer code.

Also drop an unused variable.

(From OE-Core rev: e2b8d6fa45b1ae530be2ffabf48ea61d4c467066)

(From OE-Core rev: dd08ea759294415e7357bd1fb8fcd6d976e4f016)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-30 12:36:01 +01:00
Ross Burton 013f762327 oeqa/runtime/multilib: fix and improve multilib test
Replace the previous shell magic with a Python function to parse the readelf
output, and fix the package names to include the lib32- prefix.

[ YOCTO #8219 ]

(From OE-Core rev: c51d24710b48eb3930edb8c661100705c6203e78)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-29 13:38:05 +01:00
Randy Witt 1e8d03827d qemurunner: Don't loop on EWOULDBLOCK in logging thread.
EAGAIN/EWOULDBLOCK can be followed by no data. So don't tight loop
waiting for data.

(From OE-Core rev: 3aad1f489f38e999914ee6ccbf87367b9a75ee5e)

Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-29 13:38:03 +01:00
Costin Constantin 6de522e1cc runtime/syslog.py: fix syslog test crash
This patch fixes the ability to correctly identify syslog's package
name for the built image. It is derived from modifying oeqa/oetest.py
for [YOCTO #8170]

(From OE-Core rev: 74d02c942414a193a01367c0a32bf91a3329a8d4)

Signed-off-by: Costin Constantin <costin.c.constantin@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-29 13:38:02 +01:00
Costin Constantin 393bd7496d oeqa/oetest.py: add better package search for hasPackage()
Modified hasPackage() to split the content of pacakage manifest file
in containing lines and search at the begining of each line the
existance of the needed pkg.

[YOCTO #8170]

(From OE-Core rev: f07045fcae859c902434062d1725f1348f42d1dd)

Signed-off-by: Costin Constantin <costin.c.constantin@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-26 08:28:06 +01:00
Randy Witt 315fb4c9e2 qemurunner: In the logging thread retry on EAGAIN, EWOULDBLOCK
On a nonblocking socket an exception can be generated for the EAGAIN
and EWOULDBLOCK errnos. Since these aren't actually errors make sure to
retry rather than bailing out.

(From OE-Core rev: 2f5cbfee0ab1189fbb83f0e785d79c8d123fccc2)

Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-26 08:28:06 +01:00
Randy Witt 55077eac1e qemurunner: Shut down logging thread successfully when test fails
Before this change on a test failure an exception would be generated due
to runqemu being killed before the logging thread which was on the other
end of the socket.

The exception was actually correct saying there was no data on a socket
marked readable, but this was because the qemu process was killed before
the listener thread.

(From OE-Core rev: 6497fddf7f6c4a59e16dab4a9daeb3614a61a8dc)

Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-25 23:23:53 +01:00
Randy Witt d893a2503d runqemu: Add a tcpserial option
The option was added so that the qemurunner could start a second tcp
serial port without adding machine conditional logic to qemurunner.

The issue that made this necessary was that when "virt" is passed to
qemu-system-aarch64, the normal mechanism for specifying a tcp serial
port does not work. This is because the hardware for the "virt" machine
is hardcoded in the device tree blob and the addition devices must be
virtio devices.

So runqemu can specify virtio for qemuarm64 whereas it seems all other
qemu machines work with the "-serial tcp*" option.

(From OE-Core rev: 849d65d55e4df5fa443b2cb7b4cee23913fc9d5a)

Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-24 23:47:07 +01:00
Randy Witt fd164dcc31 qemurunner: Use two serial ports and log console with a thread
qemu can freeze and stop responding if the socket buffer connected to a tcp
serial connection fills up. This happens of course when the reader of
the serial data doesn't actually read it.

This happened in the qemurunner code, because after checking for the
"login:" sentinel, data was never again read from the serial connection.

This patch solves the potential freeze by adding a thread to continuously
read the data from the console and log it. So it also will give a full log
of the console, rather than just up to the login prompt.

To simplify this patch, another serial port was also added to use for the
sole purpose of watching for the sentinel as well as being the interactive
serial port. This will also prevent the possibility of lots of debug
data on the console preventing the sentinel value from being seen due to
interleaved text.

(From OE-Core rev: 2da3fee6b6d9f4dd4c4cb529f4ba393c20aa0f13)

Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-24 23:47:07 +01:00
Randy Witt 8d05d8a0c4 qemurunner: Make create_socket() return data and use exceptions
So that create_socket() can be called more than once to create sockets,
it now returns the socket and port rather than setting class variables
directly.

create_socket() now only uses exceptions for errors, not the return
value from the function.

(From OE-Core rev: b46d83a848cf23c7f639a6ebafbd0f2c1413584a)

Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-24 23:47:06 +01:00
Randy Witt 62585cff0d qemurunner.py: Move some class variables that should only be local
The bootlog and qemusock variables were set in the class as part of the
create_socket() routine. However those variables are never used outside
of the same function and thus serve no purpose as class variables.

This initializes those variables near where they are used.

(From OE-Core rev: 829a6e521f15bae93d5f1a02dc67bc56a8c606c8)

Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-24 23:47:06 +01:00
Paul Eggleton 21f9844fa9 oe-selftest: replace assertTrue(False, ...) with fail(...)
I'd somehow missed the existence of fail() when I wrote these. It's
preferable here so you don't get the somewhat useless "false is not
true" message in the case of failure.

(From OE-Core rev: 173a5896fff57136e1f15e15f90961416aadde94)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-24 23:47:02 +01:00
Mihaly Varga e4cb847b32 wic: Test creation of iso image
Added new wic testcase, for testing the creation of the hybrid iso
image with isoimage-isohybrid plugin.

(From OE-Core rev: de3de340ba9c86c297bcb9fc1b1022dd05a195e7)

Signed-off-by: Mihaly Varga <mihaly.varga@ni.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-24 23:46:56 +01:00
Richard Purdie c0dd559088 oeqa/targetbuild: Remove bashism
Use '.' instead of 'source' so this works with dash as /bin/sh.

(From OE-Core rev: 4114c904f173721c682f9ed1a593c77307ef9d35)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-19 18:05:43 +01:00
Paul Eggleton 677e8c8e97 devtool: fix handling of BBCLASSEXTENDed recipes
If a recipe is BBCLASSEXTENDed (e.g. to -native), its PN value and the
name of the bbappend will be different; we were assuming them to be the
same when reading in the workspace, leading to us seeing the base recipe
name everywhere afterwards.

Also add a test so we ensure this doesn't regress in future.

Fixes [YOCTO #8157].

(From OE-Core rev: b63fca00c2e24ad0c8b8b3c492d93ee4372fa92d)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-19 18:05:39 +01:00
Mariano Lopez 857da0884a oetest.py: Don't wait to write dump files
This allows to write the dump files immediately
after get the data from the target. Before this,
it would run all the commands and write the files.
The old behavior could cause no log written at all
if the serial console gets stuck.

(From OE-Core rev: 73c98d38e94d3b1407620c134f3b00dcd9d6132c)

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-16 09:25:00 +01:00
Mariano Lopez 9c72c1a5aa oetest.py: Added method tearDown for oeRuntimeTest
The tearDown method is triggered when a tests ends
it doesn't matter if fails or succeeds. Inside this
method added an evalution to check if fails and then
run some commands in the target to get the data for
later debugging.

[YOCTO #8118]

(From OE-Core rev: 8bbfef69828d9b053e2a33dfa9d8318d9572cf6b)

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-16 09:25:00 +01:00
Mariano Lopez 51d8e8fb37 qemurunner.py: Performance improvements in run_serial
This allow to search for the prompt after a command is
run so it can avoid waiting for the timeout.

Also corrected identation issues

[YOCTO #8118]

(From OE-Core rev: 600f35c0873a61f8cd02c0e5cc1495ce7785ea89)

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-16 09:25:00 +01:00
Mariano Lopez c0c463be28 qemurunner.py: Added raw mode in run_serial
Raw mode allows to send the command without sending
'echo $?' for validation; Also this doesn't remove the
command or the prompt from the output returned. In raw
mode validation is done if there is output.

This raw mode would be useful for validate the prompt
when a user logs in.

[YOCTO #8118]

(From OE-Core rev: b8ead7c0929c4096e50b481a608f5d0c09eab29d)

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-16 09:24:59 +01:00
Mariano Lopez a5bfa110f6 qemurunner.py: Added login to start method
This adds the automatic login after the target
finished booting. If the automatic login fails
it won't stop the target or any test, it would
only send a log to the file.

[YOCTO #8118]

(From OE-Core rev: cc2b1c28801399c6b525248fa0dabf7c42afc714)

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-16 09:24:59 +01:00
Mariano Lopez 78e1c4f146 qemurunner.py: Add method run_serial
The only need for the console before this patch was
to check if the target has booted. This allows to send
commands to the terminal.

This new method is based on the method with the same name
of the QemuTinyRunner class. The difference here is it will
remove the command and the prompt. The other diference is
it will send an echo $? to check if the last command was
successful.

[YOCTO #8118]

(From OE-Core rev: a82711fe4520538a732a16795d50573b6f1d4463)

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-16 09:24:59 +01:00
Mihail Stanciu d2598bf396 oeqa/selftest: remove tests for TCs that are no longer valid
Several toaster backend tests are no longer valid due to design changes.

(From OE-Core rev: 08a938adbeb809dd3ea3f30ffe8f8bc2c37ed4b1)

Signed-off-by: Mihail Stanciu <stanciux.mihail@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-11 09:28:50 -07:00
Richard Purdie 37e78463e5 oeqa/qemurunner: Improve runqemu log output debug
If runqemu fails, ensure the log output is shown as its invaluable
to aid debugging. Its slightly convoluted since we need to ensure
we don't block on reading the pipe which may still be executing
hence the need for nonblocking IO.

(From OE-Core rev: 0e0fa1461863ec586b4f028dfd7d641f091ea928)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-09 00:13:58 -07:00
Alejandro Hernandez 0658434ee3 qemurunner: Improves checking for server and target IPs on qemus parameters
Fixes OS hanging infinitely waiting for qemus process to release bitbake.lock

(From OE-Core rev: d168bf34c553dbe5de7511e158cd83869d7a88bc)

Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-09 00:13:56 -07:00
Richard Purdie 18dfdb0840 oeqa/commands: Increase qemu boot timeout to match testimage.bbclass
This matches the value in testimage.bbclass, which makes sense
since the autobuilders are usually contended.

(From OE-Core rev: dd5c87900b73bf44cf96735706d7d06e56b4d20e)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-01 07:34:08 +01:00
Costin Constantin 79e41e39c6 oeqa/sstatetests.py: add annotator to test_sstate_32_64_same_hash [YOCTO #6006]
(From OE-Core rev: a8c05132fc6a20d8b401e1ecaed7f0bd00868b64)

Signed-off-by: Costin Constantin <costin.c.constantin@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-01 07:34:07 +01:00
Costin Constantin d1e2d289b1 oeqa/sstatetests.py: add decorator to test_sstate_nativelsbstring_same_hash
(From OE-Core rev: 65d0a9eb205b9bfa7c9466b12e0410257b83765e)

Signed-off-by: Costin Constantin <costin.c.constantin@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-01 07:34:07 +01:00
Paul Eggleton 93360e8a1c oe-selftest: devtool: fix teardown warning in test_devtool_update_recipe_append
We don't need to run bitbake -c cleansstate on this because it's being
cleaned out as part of "devtool reset".

Addresses [YOCTO #8031].

(From OE-Core rev: fb0e372bed321998d12460282ad8b30203a871a9)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-01 07:34:04 +01:00
Richard Purdie 54c92196b8 sshcontrol: Use os.environ.copy() instead of copy.copy()
os.environ is special and copy.copy() doesn't do what we'd expect,
changes in the child object change the parent. copy.deepcopy() is
also known to have issues with it.

Use the dedicated .copy() method which will not influence the
parent. This fixes selftest failures where the DISPLAY variable
disappears.

(From OE-Core rev: 638cd44cc9a9eb435350aac7e8eeec585d74f8db)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-31 10:32:45 +01:00
Richard Purdie ae344c188d oeqa/qemurunner: Fix AttributeError: QemuRunner instance has no attribute 'server_socket'
If start() returns False due to create_socker() failing, stop() may still get
called and currently this gives a track back since server_socket doesn't exist.

Avoid this.

(From OE-Core rev: 26fb69ec663afd05134822dc5e48fc8928ea5bf1)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-27 23:29:15 +01:00
Richard Purdie f4f72b15ad qemurunner: Show last 25 line of log, not 5
For debugging purposes, 5 lines often isn't useful as it doesn't even
cover a full backtrace. Show 25 instead.

(From OE-Core rev: 5b3ff562b2c56df301fc402c8b84420d8d4e5705)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-27 23:29:15 +01:00
Richard Purdie e3aa7a30b3 targetcontrol: Improve logs by outputting qemu boot log in case of failure
We've had a few cases on the autobuilder where we've lost logs of
the boot and been unable to debug it further. Show this information
onto the console to be more useful.

(From OE-Core rev: 5302b7b8fa1349ae99040fe8fdcc4e42c722cc10)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-27 23:29:15 +01:00
Paul Eggleton edc7780ab7 oeqa/selftest/devtool: use new runqemu function
Use the common code we now have to run QEMU instead of running it
ourselves, avoiding reliance on the machine showing up at 192.168.7.2.
This also makes a copy of the image rather than using -snapshot so if we
need to inspect the image after a failure, we can.

Fixes [YOCTO #7928].

(From OE-Core rev: 3d3748a237bb06ce7d9520bf485ef0c6cf1adc86)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-27 23:29:15 +01:00
Paul Eggleton c256bbc44d oeqa/selftest/imagefeatures: remove gummiboot tests
These tests were _deleting_ meta-intel if it happened to appear under
COREBASE, which could have been catastrophic if there was any work in
progress in that directory. It turns out we don't even need meta-intel,
but we do need a machine that's set up appropriately (e.g.
genericx86-64). Tests that involve layers outside of OE-Core don't
really belong in OE-Core, and genericx86-64 is in meta-yocto-bsp;
however we will soon have the capability to have selftest tests in other
layers, so remove this here so we can add a fixed version in
meta-yocto-bsp after that happens.

(From OE-Core rev: 7bf55e7b8036bb09f49ee0987fd002ec25e3e9e0)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-27 23:29:15 +01:00
Paul Eggleton 86f0232bff oeqa/selftest/imagefeatures: fix RPM4 test
* Use our new runqemu function
* Don't hard-code the RPM4 version
* Double-check the native version is RPM4
* Check that an rpm 4.x package is in the image manifest (this isn't
  strictly necessary, but "belt-and-braces" and it serves as an example
  of how to do that)
* Check that the database is working on the target
* Ensure the image actually has openssh in it so we can connect to it

Initial runqemu adaptation by Richard Purdie <richard.purdie@linuxfoundation.org>

Part of the fix for [YOCTO #7994].

(From OE-Core rev: 80289106423746b7d7fd4c4fd181ffbae93f71d1)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-27 23:29:15 +01:00
Richard Purdie 90a52ffd44 oeqa/selftest/imagefeatures: fix SSH without password tests
* We need to set EXTRA_IMAGE_FEATURES outright or existing values will
  affect the test
* For test case 1107 we need "empty-root-password" to match the behaviour
  described in the test case
* For test case 1115 we shouldn't be able to connect as root with the
  features we are setting

Test cases 1107 and 1115 have been updated in Testopia to match.

(From OE-Core rev: f1e66398eaba495ea6d8d39e2b489e594ac88a0e)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-27 23:29:14 +01:00
Richard Purdie 76d8c4e97c oeqa/selftest/imagefeatures: Use QemuTarget code
Create a runqemu function which uses the QemuTarget() code from
oeqa.targetcontrol to setup the QEMU instance, with all of the added
robustness that that gives us. To do this, a datastore is needed for the
recipe in question (core-image-minimal) so we do the work needed to set
this up. We then use this runqemu function within the imagefeatures
tests instead of a hand-rolled implementation.

We can then use SSHControl to run the SSH tests rather than rolling our
own code to do that as an added bonus.

Fixed and extended by Paul Eggleton <paul.eggleton@linux.intel.com>.

Part of the fix for [YOCTO #7994].

(From OE-Core rev: 7d18d1169204ee80f1c00b35998f10fffaefa107)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-27 23:29:14 +01:00
Paul Eggleton 01ccad15da oeqa/targetcontrol: write QemuRunner log output to a file
If we use this outside of testimage we don't have a task log; so let's
just explicitly write the log output to a file all the time so it's
always there to look at (particularly useful when runqemu exits
immediately with an error.)

(From OE-Core rev: 09b7ed39df150257cfe2eb55a8f8c7475e73217e)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-27 23:29:14 +01:00
Paul Eggleton a6eb5ec327 oeqa/utils/qemurunner: fix error handling if runqemu exits with an error
* Don't wait for QEMU to start if it's never going to (because runqemu
  exited with an error)
* Don't error out if killing the process fails with "no such process"
  (we don't care if it's already dead)

(From OE-Core rev: 1789b89de6c4642464abadd9f8a4746385e6b4a7)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-27 23:29:14 +01:00
Paul Eggleton 7f9b42a90f oeqa/utils/qemurunner: avoid blocking on stty when running under oe-selftest
runqemu-internal runs stty to return the terminal to its previous state
in case QEMU hasn't done that properly (which it at least used to do
when it crashed). For some reason I have yet to determine, stty blocks
(on tcsetattr() according to gdb) when run within QemuRunner() under
oe-selftest, with the result that we always wait until the timeout and
then we kill the script, which adds an extra delay after QEMU is
stopped. Naturally you would assume that this is something to do with
the nature of the terminal under which it is being run; however no
amount of playing around with stdin/stdout/stderr seemed to fix the
issue, apart from passing in subprocess.PIPE as stdin which makes stty
error out with "stty: standard input: Inappropriate ioctl for device". I
was also unable to come up with a reliable test for the terminal which
we could use inside runqemu-internal to avoid calling stty. For now, go
with the stdin=subprocess.PIPE workaround to at least avoid the delay
with minimal ill effect.

(From OE-Core rev: a058d07cd7251749fa9c1c8eca3caa80144664fe)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-27 23:29:14 +01:00
Paul Eggleton 4855ec380f oeqa/utils/qemurunner: fix logging
OE-Core commit 519e381278d40bdac79add340e4c0460a9f97e17 unfortunately
broke logging in two different ways:

1) it prevented logging to the task log from working within bitbake
   -c testimage. This is due to the logger object being set up too early
   which interferes with BitBake's own logging. If we prefix the name
   with "BitBake." everything works (and we don't need to set the
   logging level).

2) Additionally because it called the log functions on the logging
   module and not the logger object it set up, this caused the
   oe-selftest logging to start printing everything from that point
   forward.

Fix these two issues and return us to the desired behaviour for
do_testimage.

(From OE-Core rev: 429b1971be06d5146bb1c14f4697966cddab3b33)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-27 23:29:14 +01:00
Paul Eggleton 69bae0651e oeqa/targetcontrol: create test directory before copying rootfs image
The test directory might not exist at this point so just go ahead and
create it.

(From OE-Core rev: 7ef86ce62b52f0f3d0c51e3c20d7b4f37025bf41)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-27 23:29:14 +01:00
Christopher Larson 3108e00d92 oeqa/recipetool: allow templayerdir override
This is provided for use by subclasses.

(From OE-Core rev: 95330664826e80c56360645ea90b59d265c2c50e)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-27 23:29:13 +01:00
Christopher Larson 7eb55b442b oeqa/recipetool: add tests for appendsrcfile(s)
(From OE-Core rev: a6d63b8b4a8a436897bfd29f5de647152149e832)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-27 23:29:13 +01:00
Christopher Larson 6e7ee4e9bf oeqa/recipetool: refactor / split out RecipetoolBase
(From OE-Core rev: 2de348bcc5b015c64c4be7f538a7abd434434ed6)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-27 23:29:13 +01:00
Richard Purdie e9804c7dc9 oeqa: Add exception handling around qemu process cleanup
The qemu processes may no longer exist at the end of the test so
don't error if that is the case by ignoring any exceptions.

(From OE-Core rev: 64c531282e756965365c742751846250a2c1d3f1)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-25 23:15:53 +01:00
Ross Burton 9a539cbc19 oeqa/qemurunner: don't assume hostname starts with qemu
It's possible to customise the hostname trivially so don't assume that the
hostname hasn't been configured.

(From OE-Core rev: faf85728ed9a5a3af336f243f6f3567c773159cf)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-25 14:41:42 +01:00
Ross Burton b0f034e4db oeqa/runtime/parselogs: don't use uname to get MACHINE
Instead of running "uname -n" on the target (which actually returns the
hostname) to get something approximating the hostname (or not, if that has been
overriden), simply fetch MACHINE from the datastore.

(From OE-Core rev: 17efc6b3284f165a9df14090dec57d877e0c36fa)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-25 14:41:42 +01:00
Ross Burton 46cb3f0d2f oeqa/selftest/imagefeatures: handle killpg victim not existing
If Pexpect throws an exception it may be because the child has already died, in
which case killpg will fail.  Catch the latter exception silently, and output
the exception from Pexpect.

(From OE-Core rev: 4d777ce9736e91bb560558b691b8025acf784046)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-25 14:41:42 +01:00
Ross Burton 7b33ced7d2 oeqa/runtime/parselogs: add more x86 log exceptions
Move "fail to add MMCONFIG..." to qemux86_common as we started to also see it on
x86-64 with Linux 4.1.

Add "can't claim BAR..." to qemux86_common.

Generalise "Failed to access perfctr MSR" as the MSR number can change.

(From OE-Core rev: 312417c182267584141d4ba62458bdd1d9d9ccb9)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-25 14:41:42 +01:00
Richard Purdie 672517e071 oeqa/sshcontrol: Ensure we don't trigger ssh-askpass
If DISPLAY is set, ssh-askpass can be triggered which is not what
we want in the middle of sanity tests. We can disable this by
unsetting DISPLAY.

(From OE-Core rev: 085681a1418a29a8331cdde0f477f4e223de84be)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-25 14:41:42 +01:00
Costin Constantin 51ae4918a0 oeqa/buildoptions.py: automate test case 926, archive work dir and export source
(From OE-Core rev: f6bf07f2247b316421b3945d9d21ed8cbb300bda)

Signed-off-by: Costin Constantin <costin.c.constantin@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-23 08:48:41 +01:00
Costin Constantin d8c981041c oeqa/buildoptions.py: automate test case 563; build directfb image
(From OE-Core rev: 1054662a891f37dc62e0ddeeadfd840944833389)

Signed-off-by: Costin Constantin <costin.c.constantin@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-23 08:48:40 +01:00
Ross Burton 1b17b58c51 oeqa/QemuRunner: don't use bb for logging
Instead of using bb.note() etc for logging use logging.Logger directly, allowing
the use of QemuRunner outside of bitbake.

Also clean up the logging/errors by moving create_socket() out of
__init__()/restart() and into start().

(From OE-Core rev: 519e381278d40bdac79add340e4c0460a9f97e17)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-23 08:48:40 +01:00
Lucian Musat 83f19d4565 oeqa/syslog: Removed a pointless testcase and added skip for another.
The testcase syslog --help was rather useless and also causing problems
on images where syslog was non-busybox, like LSB images so I removed it.
Added a skip condition for TC 202 for the same reason. If syslog is
non-busybox then the test skips.

(From OE-Core rev: 3947ec61cdc2977db5ce6042863b31f99d47a12a)

Signed-off-by: Lucian Musat <george.l.musat@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-23 08:48:38 +01:00
Lucian Musat cc2202b8b4 oeqa/runtime: Added decorators for the remaining auto tests.
This helps for the automatic completion of the results in testopia.

(From OE-Core rev: 9148e5873a79ea3ef64f00cf9807fae99bf3040a)

Signed-off-by: Lucian Musat <george.l.musat@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-23 08:48:38 +01:00
Daniel Istrate 1bfb9327b7 oeqa/runtime: Added a new automated rpm test.
testcase 195: Check rpm install/removal log file size

(From OE-Core rev: abf07439e59180a79518e8a2443930104e9e71d0)

Signed-off-by: Daniel Istrate <daniel.alexandrux.istrate@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-23 08:48:38 +01:00
Costin Constantin 0d1f10e6ad oeqa/prservice: add useful failure messages to test cases
(From OE-Core rev: 5089154d1edc31cb208cf13189ee117ca0b445f3)

Signed-off-by: Costin Constantin <costin.c.constantin@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-23 08:48:38 +01:00
Costin Constantin 68f546e6cb oeqa/recipetool: add useful failure messages to test cases
(From OE-Core rev: e555646ecb1ee9c7b00ec22f0d40bdd9da1b4dfd)

Signed-off-by: Costin Constantin <costin.c.constantin@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-23 08:48:38 +01:00
Costin Constantin 9d02d3fd02 oeqa/pkgdata: add useful failure messages to test cases
(From OE-Core rev: 0884dc483e5111021d700e9a509c478de2e431b3)

Signed-off-by: Costin Constantin <costin.c.constantin@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-23 08:48:37 +01:00
Daniel Istrate 7d01c595c9 oeqa/runtime: Added one runtime testcase in connman.
(testcase 223) Check that only one connmand runs in background.

(From OE-Core rev: 904a3f2c772980b5dc65ef61a0aad23768fcb8dc)

Signed-off-by: Daniel Istrate <daniel.alexandrux.istrate@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-23 08:48:37 +01:00
Daniel Istrate d6fa512d90 oeqa/selftest: Fix imagefeature testcases not to interfere with testimage on AB
[YOCTO #8017] - selftest does not use pkill qemu
[YOCTO #7976] - tests do not touch .ssh/known_hosts
              - don't hardcode qemu IP
[YOCTO #8027] - use qemu nographic
Extra: removed unnecessary assert for bitbake and runCmd status

(From OE-Core rev: f58df3a630b774083934171463b2b07add29dc0e)

Signed-off-by: Daniel Istrate <daniel.alexandrux.istrate@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-21 23:56:17 +01:00
Costin Constantin 4d77270c2d oeqa/devtool: add useful failure messages for some test cases
(From OE-Core rev: b6a66026ef547eb34c6019d2ac7da90b90741dad)

Signed-off-by: Costin Constantin <costin.c.constantin@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-16 15:09:25 +01:00
Costin Constantin 74dc0c833f oeqa/buildoptions: add useful failure messages for all test cases
(From OE-Core rev: 4d027bbb067cf508d73c0e23a77bbf430388b13f)

Signed-off-by: Costin Constantin <costin.c.constantin@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-16 15:09:25 +01:00
Costin Constantin eeed010b17 oeqa/bblayers.py: add useful failure messages to all test cases
(From OE-Core rev: 3d157c146659a9b976e61ae93d766773f9f21b4f)

Signed-off-by: Costin Constantin <costin.c.constantin@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-16 15:09:24 +01:00
Costin Constantin 2606cd2774 oeqa/bbtests: add useful failure messages for all test cases
(From OE-Core rev: a6b9cbb08f6052fbfad53444cd0e9eba8599d7b1)

Signed-off-by: Costin Constantin <costin.c.constantin@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-16 15:09:24 +01:00
Richard Purdie e9817d59d3 oeqa/sstatetests: Add NATIVELSB sstate signature equivalence test
The sstate checksums should be independent of whichever NATIVELSBSTRING is
detected. Add an automated QA test which tests this using bitbake -S.

To make this possible, we need to be able to override the value of
NATIVELSBSTRING so make a small change to allow this.

(From OE-Core rev: 2da156d491caf25dfa3efd567d6dbb451dd7e9dc)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-12 22:55:38 +01:00
Daniel Istrate 975cb960aa oeqa/selftest: Added 2 testcases and updated setup for other two in imagefeatures.
Automated 2 oe-selftest testcases:
- 1116: Check if clutter image can be built
- 1117: Check Wayland support in image

Updated setup for test_efi_gummiboot_images_can_be_build and
test_wic_command_can_create_efi_gummiboot_installation_images
to accomodate latest wic changes.

(From OE-Core rev: cf3e145bb6823fb22e2701a9a7e0623e4c4a1791)

Signed-off-by: Daniel Istrate <daniel.alexandrux.istrate@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-09 18:00:20 +01:00
Richard Purdie 9fa842addc oeqa/sstatetests: Add test for comparing 32 and 64 bit sstate checksums
The sstate checksums for both native and target should not vary whether
they're built on a 32 or 64 bit system. Rather than requiring two different
build machines and running a builds, override the variables calling uname()
manually and check using bitbake -S.

[YOCTO #5970]

(From OE-Core rev: da91637dd6991ae085ce82d932f1053d820b0cc4)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-09 18:00:17 +01:00
Richard Purdie 0aaa67a790 oeqa/bbtests: Fix to ensure DL_DIR is set
write_config overwrites the config rather than appends to it, so
ensure we write both variables in one go.

(From OE-Core rev: 50a37ee563d9003e21bfb9280f184cd81c62e9bf)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-08 13:09:28 +01:00
Daniel Istrate 923fb2e558 oeqa/selftest: Added new testsuite for image features.
Automated 5 oe-selftest testcase:
    - 1107: Check if non root user can connect via ssh without password
    - 1115: Check if all users can connect via ssh without password
    - 1114: Check rpm version 4 support on image
    - 1101: Check if efi/gummiboot images can be buit
    - 1103: Check that wic command can create efi/gummiboot installation images

(From OE-Core rev: ea414da3ecc59a48a0f2fb719fc86538b47fafb8)

Signed-off-by: Daniel Istrate <daniel.alexandrux.istrate@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-08 00:01:19 +01:00
Daniel Istrate ffa54b94b6 oeqa/selftest: Added @testcase decorators to oeselftest testcases.
Added decorator to some testcases missing this feature.

(From OE-Core rev: 2a9009583fd498df94a55f21a149e302180f19cc)

Signed-off-by: Daniel Istrate <daniel.alexandrux.istrate@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-08 00:01:19 +01:00
Daniel Istrate 9f91aa697f oeqa/selftest: Add methods to manipulate bblayers.conf in base.py
Added methods for manipulating bblayers.conf file in the same manner as local.conf file:
    - write_bblayers_config
    - append_bblayers_config
    - remove_bblayers_config

(From OE-Core rev: 477ed5931f40dd504a2ae3e184c09153f4fa9735)

Signed-off-by: Daniel Istrate <daniel.alexandrux.istrate@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-08 00:01:18 +01:00
Richard Purdie a24fdcae86 oeqa/bbtests: Fix race over DL_DIR and SSTATE_DIR
Running "-c cleanall" on shared DL_DIR and SSTATE_DIR is antisocial.
It leads to hard to debug races where we wonder why files disappear
and reappear from those directories.

Fix this by using a specific set of directories for these tests. This
avoids a long standing bug on the autobuilder where aspell and man
sources would disappear.

[YOCTO #6276]

(From OE-Core rev: 6b089c4a79dc3aae00c8a6e7ab0f6ba4b4b5f138)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-07 13:33:27 +01:00
Ed Bartosh 673343414f wic: Test rootfs plugin using rootfs paths
Added testcase to create multi-rootfs images using rootfs plugin
with paths to rootfs directories in wic command line.

(From OE-Core rev: 8becfc2281282a2e63b3bf511936df36315c9cb1)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-02 23:08:36 +01:00
Ed Bartosh b42d7d26e1 wic: Test rootfs plugin using image recipes
Added canned wks and testcase to create multi-rootfs images referring
bitbake image recipes.

(From OE-Core rev: 723ed56eda0e64b9678b846ef2001465b15e0c1b)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-02 23:08:35 +01:00
Richard Purdie 3360f9343d oeqa/bbtests: Show useful failure message for gplv3 test
If this test fails the current output tells us nothing about what happened.
Show the exit status and output to aid debugging.

(From OE-Core rev: e54437b7e7c5f1b8c33627b3914f896724207837)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-01 15:39:59 +01:00
Richard Purdie 58ecd46c64 oeqa/bbtests: Improve error handling
Currently if a test fails the cleanup isn't performed, leading to cascade
failures in other tests. We can do better.

(From OE-Core rev: db01d6ba2ce87e1586dc8804dd823a0a038d5794)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-01 15:39:59 +01:00
Richard Purdie 4bc0fc70b9 oeqa/parselogs: Whitelist qemumips64 runtime error
Similarly to qemumips, ignore these errors upon bootup so that
we have a good QA baseline for new errors.

(From OE-Core rev: 592a1d94a7b0e80059016adb59c4c61e256206f0)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-27 22:50:41 +01:00
Richard Purdie 6dba7a07a7 oeqa/parselogs: Whitelist qemuarm64 runtime errors
The qemuarm64 machine doesn't have graphics so whitelist the
X server failures to start.

(From OE-Core rev: 4e1b7773e480a05ac791fcceca23889ef9919aa7)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-27 22:50:41 +01:00
Richard Purdie e77c23cc35 oeqa/recipetool: Fix symlink resolution
Instead of readlink we need to use realpath to resolve any possible
symlink in the file name. I'd got the two confused in the previous
patch. This should really fix selftest failures on the autobuilder.

(From OE-Core rev: 878764ab7252f9b5b67b697dcd51b961b673fda0)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-27 22:42:56 +01:00
Lucian Musat 608bf2228d oeqa/parselogs: Fixed a problem in parselogs
When the test passed it returned an error because
grep did not return any error and the variable that
held the results was being referenced but not
assigned any value.

(From OE-Core rev: 0f5c2fb975010cf6e8154384b764a2c9da1b371e)

Signed-off-by: Lucian Musat <george.l.musat@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-27 22:42:55 +01:00
Ed Bartosh e6f29dd712 wic: oe-selftest: Test image compressing
Added 4 new testcases for 'wic --compress-with <compressor>' functionality.

(From OE-Core rev: 0ffc5c38ef28605abf815a47eb41923802d31df7)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-27 22:42:50 +01:00
Richard Purdie ffd7cac8f6 oeqa/selftest/recipetool: Fix appendfile_binary test on opensuse131
On OpenSUSE 13.1, /bin/ls is a symlink to /usr/bin/ls. This means the
test doesn't use a binary file an fails on that system.

Ensure we resolve any symlink using readlink to avoid this failure.

======================================================================
FAIL: test_recipetool_appendfile_binary (oeqa.selftest.recipetool.RecipetoolTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/meta/lib/oeqa/selftest/recipetool.py", line 115, in test_recipetool_appendfile_binary
    self.assertIn('WARNING: ', result.output)
AssertionError: 'WARNING: ' not found in 'Parsing recipes..done.\nNOTE: Writing append file /tmp/recipetoolqai0NY8l/recipes-core/coreutils/coreutils_8.23.bbappend\nNOTE: Copying /bin/ls to /tmp/recipetoolqai0NY8l/recipes-core/coreutils/coreutils/ls'

[YOCTO #7920]

(From OE-Core rev: 792107de1586336f4a734557c0c3fa36a1174e9e)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-26 09:27:31 +01:00
Richard Purdie 86d30d756a meta: Add explict getVar param for (non) expansion
Rather than just use d.getVar(X), use the more explict d.getVar(X, False)
since at some point in the future, having the default of expansion would
be nice. This is the first step towards that.

This patch was mostly made using the command:

sed -e 's:\(getVar([^,()]*\)\s*):\1, False):g' -i `grep -ril getVar *`

(From OE-Core rev: ab7c1d239b122c8e549e8112c88fd46c9e2b061b)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-23 11:57:25 +01:00
Ed Bartosh 4862a4c33a wic: oe-selftest: Add 3 tests of 'wic help' command
Added tests for 'wic test overview', 'wic test plugins' and
'wic test kickstart' commands.

(From OE-Core rev: 2009df2aa048bb51b7b3050b69a44fe414c4de9d)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-23 11:47:35 +01:00
Ed Bartosh 40764a309d wic: Return error code when wic fails to invoke command
Return 1 if command doesn't exist or wic is called without
any commmand.
Return result of invoke_command as wic return code.

Added tests for unsupported command and no command.

Fixed typo in test case test02_createhelp spotted by this fix.

[YOCTO #7856]

(From OE-Core rev: ebd9f7b1da8ed556e98aab4d5f4e81707ac44b27)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-23 11:47:34 +01:00
Ed Bartosh 410e272591 oe-selftest: wic: Fix testcase
Fixed test05_build_artifacts testcase by using values of MACHINE
and BUILD_SYS bitbake variables in paths to artifacts.

Test was failing because of hardcoded machine(qemux86) and
build_sys(qemux86-poky-linux) in artifact paths.

[YOCTO #7730]

(From OE-Core rev: dda85cd420d47d97b0d0b0f294b37cd6066c541c)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-23 11:47:30 +01:00
Paul Eggleton 2054b29dd7 devtool: deploy: fix preservation of symlinks and permissions/ownership
It turns out that scp can't be used to copy symlinks because it follows
them instead of copying them, and this is by design (since it emulates
rcp which also behaved this way); the unfortunate result is that
symlinks that point to valid files on the host translate into the host
file being copied to the target (yuck).  The simplest alternative that
does not have this undesirable behaviour is to use tar and pipe it over
ssh.

At the same time, it would be even better if we properly reflect file
permissions and ownership on the target that have been established
within the pseudo environment. We can do this by executing the copy
process under pseudo, which turns out to be quite easy with access to
the pseudo environment set up by the build system.

Fixes [YOCTO #7868].

(From OE-Core rev: 69adaed0e982d627ebfa57b360b0ee049ea7a276)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-18 09:14:06 +01:00
Paul Eggleton e22c18113b lib/oeqa/utils/commands: ensure get_bb_var() works when value contains =
Only split on the first equals character so that values that contain
equals characters (such as FAKEROOTENV) can be retrieved.

(From OE-Core rev: ff720dd3b77130b2c485d7acad63735fd8751a7d)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-18 09:14:06 +01:00
Lucian Musat 7a4d72dc18 oeqa/parselogs: Added some more errors to the whitelist.
(From OE-Core rev: 70f514719b1bac2a478bc05afd5382b3a26a419a)

Signed-off-by: Lucian Musat <george.l.musat@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-11 23:59:18 +01:00
Lucian Musat ee663961bb oeqa/parselogs: The logs are now copied and parsed locally.
This is to fix a problem with reaching the limit of the whitelist size.

(From OE-Core rev: 7f49f098cff1848ab7bd25a6a232b09b4f0b4b03)

Signed-off-by: Lucian Musat <george.l.musat@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-11 23:59:18 +01:00
Lucian Musat ad0aa8d548 oeqa/utils: Added timeout decorator for testcases.
(From OE-Core rev: c6fe26ade5734efb5250e00c56fdbb4095b0018b)

Signed-off-by: Lucian Musat <george.l.musat@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-11 23:59:17 +01:00
Ed Bartosh 998273aee2 wic: oe-selftest: Configure testing of gpt/UUID image
Added runtime dependency to gptfdisk-native to wic test suite to
be able to test modified directdisk-gpt with UUID support.

(From OE-Core rev: 16e7d43cd4a4d16e498152764a8dbc8b933eef89)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-11 23:59:12 +01:00
Ed Bartosh 921ea71607 wic: Test creation of directdisk image with GPT table
Added new wic testcase to the sute - creation of directdisk-gpt
image.

(From OE-Core rev: 73762747dfda5013563f15b13bcb19b40d0f69d9)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-11 23:59:11 +01:00
Ed Bartosh 29d5503a54 oe-selftest: Build wic runtime requirements and images before testing
Some native tools (syslinux, parted, mtools, etc) are required
by wic to produce images. Unit tests fail if the tools are
not available.

Baked tools and image-core-minimal used by wic before running tests.

[YOCTO #7730]

(From OE-Core rev: 379c9bb7ffae5b40c5450e968cdde600b6edd3f3)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-24 07:19:20 +01:00
Paul Eggleton 7539c1f889 devtool: update-recipe: add option to write changes to bbappend
Quite often what you want to do having made customisations to a piece of
software is to apply those customisations in your own layer rather than
in the original recipe. Thus, add a -a/--append option to the
update-recipe subcommand which allows you to specify the layer to write
a bbappend into. The bbappend will be created at the appropriate path
within the specified layer directory (which may or may not be in your
bblayers.conf) or if one already exists it will be updated
appropriately.

(This re-uses code written for recipetool appendfile.)

Implements [YOCTO #7587].

(From OE-Core rev: 87d487ea4fdfb6cd30e3b3fad47732db12e86f23)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-20 21:41:04 +01:00
Paul Eggleton fbfc06a969 recipetool: add appendfile subcommand
Locating which recipe provides a file in an image that you want to
modify and then figuring out how to bbappend the recipe in order to
replace it can be a tedious process. Thus, add a new appendfile
subcommand to recipetool, providing the ability to create a bbappend
file to add/replace any file in the target system. Without the -r
option, it will search for the recipe packaging the specified file
(using pkgdata from previously built recipes). The bbappend will be
created at the appropriate path within the specified layer directory
(which may or may not be in your bblayers.conf) or if one already exists
it will be updated appropriately.

Fairly extensive oe-selftest tests are also provided.

Implements [YOCTO #6447].

(From OE-Core rev: dd2aa93b3c13d2c6464ef0fda59620c7dba450bb)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-20 21:41:04 +01:00
Paul Eggleton c63adf5c5b oe-selftest: move recipetool tests to their own module
These tests really belong in their own module; if we refactor
out a base class from DevtoolTests with shared functions then we can
move them out easily. Also create temp directory in setupLocal() so we
don't have to do that in individual tests anymore.

(From OE-Core rev: 2f88f6e7b2e54b13376338354aae1d61c0c0db60)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-20 21:41:04 +01:00
Lucian Musat 3e7dde7d16 oeqa/utils: Fixed a problem with get_bb_var not returning right variable.
It searches using regex now and should be more accurate.

(From OE-Core rev: 1ae7e1cc4a5c7a217dee937c330539e5c8ac794d)

Signed-off-by: Lucian Musat <george.l.musat@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-14 11:44:00 +01:00
Paul Eggleton 4a711028c7 oe-selftest: devtool: add a proper test to see if tap devices exist
Check up front in test_devtool_deploy_target whether the tap devices
exist and skip if not. If we don't do this we get a significantly less
comprehensible error via pexpect.

(From OE-Core rev: 2258345e19efff7717fe19a5026ec55f1b6f90b6)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-07 14:59:43 +01:00
Paul Eggleton 1f15117404 devtool: fix for rename of gcc-source
After OE-Core commit 67db7182faf6742b0d971d61d8c5ba34f69d2e12, PV is
appended to the end of the gcc-source PN, thus we need to handle that in
devtool and the corresponding test.

Part of the fix for [YOCTO #7729].

(From OE-Core rev: 440029dc229a566b9bead1481215d5e5760c5fe6)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-07 14:59:43 +01:00
Paul Eggleton b7cff751fd oe-selftest: devtool: fix broken URL in test_devtool_add_fetch
I already had the file fetched from some previous work and thus it
didn't attempt to download the invalid URL when I tested it earlier.

Part of the fix for [YOCTO #7729].

(From OE-Core rev: f9bad5aeb507f5b3c1346118011c7766c44d9ba4)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-07 14:59:43 +01:00
Ed Bartosh fd254d007f wic tests: Move wic tests to oe-selftest infra
Modified existing wic test modules to work with oe-selftest
infrastructure.

$ oe-selftest --run-tests wic
...
test01_help (oeqa.selftest.wic.Wic)
Test wic --help ... ok
test02_createhelp (oeqa.selftest.wic.Wic)
Test wic create --help ... ok
test03_listhelp (oeqa.selftest.wic.Wic)
Test wic list --help ... ok
test04_build_image_name (oeqa.selftest.wic.Wic)
Test wic create directdisk --image-name core-image-minimal ... ok
test05_build_artifacts (oeqa.selftest.wic.Wic)
Test wic create directdisk providing all artifacts. ... ok

----------------------------------------------------------------------
Ran 5 tests in 6.434s

OK

(From OE-Core rev: 2a7f16b19d78186ed6c2eb119ec102c645596b87)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-03 11:43:49 +01:00
Ed Bartosh 8bc5ccb7a6 oeqa/utils: Allow ~ in bblayers
Bitbake can parse ~ in bblayer's paths.
Added this functionality to oeqa code.

(From OE-Core rev: b4dc5b271247a1894d66908c5f20973be2a60d43)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-03 11:43:48 +01:00
Paul Eggleton 1643a7f3bc oe-selftest: devtool: add some tests for devtool add -f
Tests the following aspects of "devtool add" with the -f option:
* Works for a git and https URI
* Extracts to the appropriate directory
* Uses the correct recipe file name with and without -V
* Sets SRC_URI and S appropriately with and without -V
* Sets SRCREV if rev= is specified in the URI

A lot of this functionality relies on "recipetool create" which
"devtool add" wraps around, so the associated behaviour of that is also
being tested here.

Refactor out the code to check a recipe for variable values / inherits
at the same time so we can use it to check the generated recipe.

(From OE-Core rev: 0e626639ee75d42cb44d357efe2d9c4d2ff65294)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-01 17:08:50 +01:00
Richard Purdie 26997d1d21 lib/oeqa: Add sdk tests for gcc/perl/python
Enhance testing of the generated SDK tarballs by adding tests for
gcc/perl/python based on the existing runtime tests.

(From OE-Core rev: 18160403427b2aab4207c939312fb0981c3f2d1b)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-29 10:58:55 +01:00
Richard Purdie 94ed114eff oeqa/targetbuild: Use DL_DIR for downloads if present
This isn't a test of wget so if the files we need are present in DL_DIR,
use them from there and save a bit of speed/bandwidth and skip the wget.

(From OE-Core rev: dc1d83d021afd77ca8fb948dc47bbd11e3844865)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-29 10:58:54 +01:00
Paul Eggleton e8db1ccef3 devtool: add: use correct bbappend file name with -V option
We weren't adding the version into the bbappend file name when -V was
specified which meant that building or resetting failed.

Also adjust one of the tests so that we're testing devtool add both with
and without this option.

Fixes [YOCTO #7647].

(From OE-Core rev: bdbeff0cd342e31053d7203d78fc5dda611052b1)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-27 15:05:52 +01:00
Paul Eggleton a8c7558c76 oe-selftest: devtool: fix test_devtool_update_recipe_git
Make this test work after recent changes to the mtd-utils recipe, and
hopefully make it robust against any future changes.

(From OE-Core rev: 5be62624a6537659f9f6229c82762da45909f902)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-27 15:05:51 +01:00
Cristian Iorga a6ad4183cf oeqa/selftest/toaster: fix bad indent
oe-selftest --list-classes crashes because
of a bad indent (see below). Fixed.

systemd-build$ oe-selftest --list-classes
2015-04-22 12:12:39,141 - selftest - INFO - Listing all available test modules:
_sstatetests_noauto (hidden)
 -- SStateBase
 -- RebuildFromSState
 --  -- test_sstate_rebuild
 --  -- test_sstate_relocation
_toaster (hidden)
Traceback (most recent call last):
  File "/mnt/Yo/yoctoproject/poky/scripts/oe-selftest", line 201, in <module>
    ret = main()
  File "/mnt/Yo/yoctoproject/poky/scripts/oe-selftest", line 157, in main
    modlib = importlib.import_module(test)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/mnt/Yo/yoctoproject/poky/meta/lib/oeqa/selftest/_toaster.py", line 438
    time.sleep(3)
    ^
IndentationError: unexpected indent

(From OE-Core rev: 46869abf72c1c5babce49537f221d7a4f53ca820)

Signed-off-by: Cristian Iorga <cristian.iorga@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-27 10:10:11 +01:00
Nathan Rossi 71db5767a8 oeqa/utils/decorators: Fix up frame selection
Use threading to get the current threads ident to select the current
executing frame to ensure that the scanned stack is the expected stack.

This allows for the decorators to be used within a process that has
multiple threads executing.

(From OE-Core rev: a44d27b92baba4ab51f432ec01cdc473436ce406)

Signed-off-by: Nathan Rossi <nathan.rossi@xilinx.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-21 07:20:25 +01:00
Richard Purdie 710b01e01e oeqa: Add test for layer append and FILESPATH tracking
This test actually tests a spectrum of bitbake functionality. Three
layers are created, one containing a recipe, one with a bbappend adding
a file to the recipe and another which overwrites the file in another
bbappend.

The correct outcomes in building the recipe are tested, with the file
in the final layer added, removed and then re-added.

This tests bitbake's cache handling as well as restoration from
sstate which happens in the final test phase.

Based on a test case from:
[YOCTO #7019]

(From OE-Core rev: e57437c0e02b148a878c8db91660674069fbd6e2)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-15 14:19:44 +01:00
Lucian Musat 3d1106ea4b oeqa/runtime: Boot test for poky-tiny.
Bug 6705.

(From OE-Core rev: 4d3574e7fe5353b4dbbf5266a8b950b57542a743)

Signed-off-by: Lucian Musat <george.l.musat@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-10 18:10:27 +01:00
Lucian Musat 38320db53f oeqa/utils: Add runner for poky-tiny qemu.
The connection and commands are done via serial.

(From OE-Core rev: bc6ac3058d7adb6f1bf87e57deaa50347f452e59)

Signed-off-by: Lucian Musat <george.l.musat@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-10 18:10:27 +01:00
Lucian Musat fa5970e0d9 oeqa/targetcontrol: Add support for poky-tiny in QemuTarget.
(From OE-Core rev: 8f1a52a3f72506911154769e6ad4a44f32c3112e)

Signed-off-by: Lucian Musat <george.l.musat@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-10 18:10:27 +01:00
Lucian Musat 39d5666da4 oeqa/runtime/smart: Added new decorators for existing automated tests.
(From OE-Core rev: d307950f4938ea2f9d480d4f4cd184b76e33df0b)

Signed-off-by: Lucian Musat <george.l.musat@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-10 18:10:25 +01:00
Lucian Musat e58e983076 oeqa/runtime/rpm: Added new decorators for existing automated tests.
(From OE-Core rev: 7381c10f2260181eccd3abddf5d0289c969863cb)

Signed-off-by: Lucian Musat <george.l.musat@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-10 18:10:25 +01:00
Lucian Musat 3dabad439a oeqa/runtime/ping: Added new decorators for existing automated tests.
(From OE-Core rev: 9ca0f5c7837ef42cf3b95ff4091ea6951b4e8021)

Signed-off-by: Lucian Musat <george.l.musat@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-10 18:10:25 +01:00
Lucian Musat f33488a656 oeqa/runtime/parselogs: Added new decorators for existing automated tests.
(From OE-Core rev: 8fb4bc7296d8da62ac2db3bf65d202a9c27d743f)

Signed-off-by: Lucian Musat <george.l.musat@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-10 18:10:25 +01:00
Lucian Musat d48df946c3 oeqa/runtime/ldd: Added new decorators for existing automated tests.
(From OE-Core rev: 6385874553b8bd9302c1b77d0586edd821e999be)

Signed-off-by: Lucian Musat <george.l.musat@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-10 18:10:25 +01:00
Patrick Ohly f626c58c32 testimage: sort modules based on dependencies
TEST_SUITES="auto" is useful to run all suitable tests without
having to hard-code the list. However, it did not take test
dependencies into account, which can be an issue for tests
which really depend on some other test to run first.

To fix this, modules get loaded in the order determined by
TESTS_SUITES, but then get re-ordered based on dependencies
derived from @skipUnlessPassed before running them. The original
order is used to break ties when there are no dependencies, so
reordering only occurs when really necessary.

@skipUnlessPassed gets extended such that it makes the test name
a method depends on available for inspection by the test loader
in oetest.py.

Unfortunately Python's unittest offers no API to inspect tests
in a TestSuite, so the code has to rely on implementation details
to find all tests. The worst that can happen when the implementation
changes is that tests are not found and reordering does not happen.

(From OE-Core rev: 6e4543a35836c572b23b9f8162b19d1e038d3ed2)

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-10 18:10:25 +01:00
Patrick Ohly 206d532180 oeqa/runtime/systemd.py: skip instead of failing without avahi
The SystemdServiceTests assume that avahi-daemon is installed,
which is not necessarily the case depending on the image being
tested.

Better check this dependency before starting the tests and skip
them if the service is not installed. This has to be done for
each test instead of for the entire module, because other
tests in the module can run without avavi.

(From OE-Core rev: ca23337d517cfdb7119e5fd8bd9a9a663ae135de)

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-10 18:10:25 +01:00
Patrick Ohly 058e75d60e oeqa/oetest.py: use bb logging
Plain print has two drawbacks:
- the output is handled by different processes, causing the message
  about found tests to appear randomly after the result of the initial
  tests
- the output is not part of the bitbake console output

Affects image testing with testimage.bbclass.

(From OE-Core rev: 4b6f87a82ece230b7296f1577d4092ef559af1d4)

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-10 18:10:25 +01:00
Yi Zhao c0fc3c4727 lib/oeqa/selftest/bblayers: improve test for add-layer and remove-layer
Use absolute path instead of relative path for meta-skeleton.
Otherwise the case would fail if the builddir outside the poky source
tree.

(From OE-Core rev: 90edaf9b9e51a24bf67c1c95732fc2d8cb22b098)

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-10 18:10:24 +01:00
Lucian Musat b0b8f47e99 oeqa/runtime: Added a new auto rpm test
The test tries to query the rpm list with a non-root user

(From OE-Core rev: 9d5deedfdae28d0257e84e1980c2cb7fd4e38c45)

Signed-off-by: Lucian Musat <george.l.musat@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-03-22 08:49:57 +00:00
Paul Eggleton a8c98c399f oe-selftest: use spaces to indent python code, not tabs
Indenting-only change.

(From OE-Core rev: b3005576a9e0bcaa47c41f25451d1fe7ef30c7fe)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-03-21 09:42:36 +00:00
Randy Witt 05471f8710 lib/oeqa/selftest/lic-checksum: Add INHIBIT_DEFAULT_DEPS
The test_nonmatching_checksum doesn't need the default dependencies,
and they would just take extra time to generate.

(From OE-Core rev: d91ed126eead8b09a4ddfe5cc11db16dda71273f)

Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-03-20 11:27:52 +00:00
Randy Witt 8b8baf5de3 lib/oeqa/selftest/lic-checksum: Rename test_foo
test_foo is renamed to test_nonmatching_checksum. It was a mistake to
submit it with the old name.

There was also some extra whitespace removed.

(From OE-Core rev: 95eed3038f48337d06a3eba0f6e355f3f78c6974)

Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-03-20 11:27:51 +00:00
Paul Eggleton 6f6e866ba2 oe-selftest: add missing dependency to test_recipetool_create_git
libmatchbox links to libjpeg if it is present so just explicitly build
it and then check it appears in DEPENDS.

(From OE-Core rev: 00ca890d8a56c4c05ce5bda87b3d9d1452ddfa36)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-03-20 11:27:49 +00:00