]> code.ossystems Code Review - openembedded-core.git/log
openembedded-core.git
6 years agoresulttool/report: Handle missing metadata sections more cleanly
Richard Purdie [Wed, 27 Feb 2019 16:51:56 +0000 (16:51 +0000)]
resulttool/report: Handle missing metadata sections more cleanly

Currently some older results files cause the code to give tracebacks.
Handle these missing sections more cleanly.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
6 years agoresulttool/store: Handle results files for multiple revisions
Richard Purdie [Wed, 27 Feb 2019 11:59:54 +0000 (11:59 +0000)]
resulttool/store: Handle results files for multiple revisions

Currently we cant store results if the results files span multiple
different build revisons. Remove this limitation by iterating.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
6 years agoresulttool/resultutils: Avoids tracebacks for missing logs
Richard Purdie [Sat, 23 Feb 2019 22:49:11 +0000 (22:49 +0000)]
resulttool/resultutils: Avoids tracebacks for missing logs

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
6 years agoresulttool: Improvements to allow integration to the autobuilder
Richard Purdie [Sat, 16 Feb 2019 18:13:00 +0000 (18:13 +0000)]
resulttool: Improvements to allow integration to the autobuilder

This is a combined patch of the various tweaks and improvements I
made to resulttool:

* Avoid subprocess.run() as its a python 3.6 feature and we
  have autobuilder workers with 3.5.

* Avoid python keywords as variable names

* Simplify dict accesses using .get()

* Rename resultsutils -> resultutils to match the resultstool ->
  resulttool rename

* Formalised the handling of "file_name" to "TESTSERIES" which the code
  will now add into the json configuration data if its not present, based
  on the directory name.

* When we don't have failed test cases, print something saying so
  instead of an empty table

* Tweak the table headers in the report to be more readable (reference
  "Test Series" instead if file_id and ID instead of results_id)

* Improve/simplify the max string length handling

* Merge the counts and percentage data into one table in the report
  since printing two reports of the same data confuses the user

* Removed the confusing header in the regression report

* Show matches, then regressions, then unmatched runs in the regression
  report, also remove chatting unneeded output

* Try harder to "pair" up matching configurations to reduce noise in
  the regressions report

* Abstracted the "mapping" table concept used to pairing in the
  regression code to general code in resultutils

* Created multiple mappings for results analysis, results storage and
  'flattening' results data in a merge

* Simplify the merge command to take a source and a destination,
  letting the destination be a directory or a file, removing the need for
  an output directory parameter

* Add the 'IMAGE_PKGTYPE' and 'DISTRO' config options to the regression
  mappings

* Have the store command place the testresults files in a layout from
  the mapping, making commits into the git repo for results storage more
  useful for simple comparison purposes

* Set the oe-git-archive tag format appropriately for oeqa results
  storage (and simplify the commit messages closer to their defaults)

* Fix oe-git-archive to use the commit/branch data from the results file

* Cleaned up the command option help to match other changes

* Follow the model of git branch/tag processing used by oe-build-perf-report
  and use that to read the data using git show to avoid branch change

* Add ptest summary to the report command

* Update the tests to match the above changes

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
6 years agoscripts/resulttool: enable manual execution and result creation
Mazliana [Thu, 14 Feb 2019 05:50:38 +0000 (13:50 +0800)]
scripts/resulttool: enable manual execution and result creation

Integrated “manualexecution” operation to resulttool scripts.
Manual execution script is a helper script to execute all manual
test cases in baseline command, which consists of user guideline
steps and the expected results. The last step will ask user to
provide their input to execute result. The input options are
passed/failed/blocked/skipped status. The result given will be
written in testresults.json including log error from the user
input and configuration if there is any.The output test result
for json file is created by using OEQA library.

The configuration part is manually key-in by the user. The system
allow user to specify how many configuration they want to add and
they need to define the required configuration name and value pair.
In QA perspective, "configuration" means the test environments and
parameters used during QA setup before testing can be carry out.
Example of configurations: image used for boot up, host machine
distro used, poky configurations, etc.

The purpose of adding the configuration is to standardize the
output test result format between automation and manual execution.

To use these scripts, first source oe environment, then run the
entry point script to look for help.
        $ resulttool

To execute manual test cases, execute the below
        $ resulttool manualexecution <manualjsonfile>

By default testresults.json store in <build_dir>/tmp/log/manual/

[YOCTO #12651]

Signed-off-by: Mazliana <mazliana.mohamad@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
6 years agoresulttool: enable merge, store, report and regression analysis
Yeoh Ee Peng [Thu, 14 Feb 2019 05:50:37 +0000 (13:50 +0800)]
resulttool: enable merge, store, report and regression analysis

OEQA outputs test results into json files and these files were
archived by Autobuilder during QA releases. Example: each oe-selftest
run by Autobuilder for different host distro generate a
testresults.json file.

These scripts were developed as a test result tools to manage
these testresults.json file.

Using the "store" operation, user can store multiple testresults.json
files as well as the pre-configured directories used to hold those files.

Using the "merge" operation, user can merge multiple testresults.json
files to a target file.

Using the "report" operation, user can view the test result summary
for all available testresults.json files inside a ordinary directory
or a git repository.

Using the "regression-file" operation, user can perform regression
analysis on testresults.json files specified. Using the "regression-dir"
and "regression-git" operations, user can perform regression analysis
on directory and git accordingly.

These resulttool operations expect the testresults.json file to use
the json format below.
{
    "<testresult_1>": {
        "configuration": {
            "<config_name_1>": "<config_value_1>",
            "<config_name_2>": "<config_value_2>",
            ...
            "<config_name_n>": "<config_value_n>",
        },
        "result": {
            "<testcase_namespace_1>": {
                "status": "<PASSED or FAILED or ERROR or SKIPPED>",
                "log": "<failure or error logging>"
            },
            "<testcase_namespace_2>": {
                "status": "<PASSED or FAILED or ERROR or SKIPPED>",
                "log": "<failure or error logging>"
            },
            ...
            "<testcase_namespace_n>": {
                "status": "<PASSED or FAILED or ERROR or SKIPPED>",
                "log": "<failure or error logging>"
            },
        }
    },
    ...
    "<testresult_n>": {
        "configuration": {
            "<config_name_1>": "<config_value_1>",
            "<config_name_2>": "<config_value_2>",
            ...
            "<config_name_n>": "<config_value_n>",
        },
        "result": {
            "<testcase_namespace_1>": {
                "status": "<PASSED or FAILED or ERROR or SKIPPED>",
                "log": "<failure or error logging>"
            },
            "<testcase_namespace_2>": {
                "status": "<PASSED or FAILED or ERROR or SKIPPED>",
                "log": "<failure or error logging>"
            },
            ...
            "<testcase_namespace_n>": {
                "status": "<PASSED or FAILED or ERROR or SKIPPED>",
                "log": "<failure or error logging>"
            },
        }
    },
}

To use these scripts, first source oe environment, then run the
entry point script to look for help.
    $ resulttool

To store test result from oeqa automated tests, execute the below
    $ resulttool store <source_dir> <git_branch>

To merge multiple testresults.json files, execute the below
    $ resulttool merge <base_result_file> <target_result_file>

To report test report, execute the below
    $ resulttool report <source_dir>

To perform regression file analysis, execute the below
    $ resulttool regression-file <base_result_file> <target_result_file>

To perform regression dir analysis, execute the below
    $ resulttool regression-dir <base_result_dir> <target_result_dir>

To perform regression git analysis, execute the below
    $ resulttool regression-git <source_dir> <base_branch> <target_branch>

[YOCTO# 13012]
[YOCTO# 12654]

Signed-off-by: Yeoh Ee Peng <ee.peng.yeoh@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
6 years agolttng-tools: update to 2.9.11
Jonathan Rajotte-Julien [Wed, 13 Mar 2019 20:53:32 +0000 (20:53 +0000)]
lttng-tools: update to 2.9.11

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
6 years agolttng-modules: update to 2.10.9
Jonathan Rajotte-Julien [Wed, 13 Mar 2019 20:53:31 +0000 (20:53 +0000)]
lttng-modules: update to 2.10.9

Pertinent fix for OE-Core since 2.10.6:
    Fix: out of memory error handling
    Fix: access migrate_disable field directly
    Prevent allocation of buffers if exceeding available memory

2.10.9 also contains the necessary fix to support kernel up to 5.0.

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
6 years agolttng-ust: update to 2.10.3
Jonathan Rajotte-Julien [Wed, 13 Mar 2019 20:53:30 +0000 (20:53 +0000)]
lttng-ust: update to 2.10.3

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
6 years agocoreutils: 8.29: fix native build
Stefan Müller-Klieser [Thu, 14 Mar 2019 15:43:30 +0000 (16:43 +0100)]
coreutils: 8.29: fix native build

This fixes the native build on glibc 2.28 hosts, by backporting two
gnulib patches from master.

Signed-off-by: Stefan Müller-Klieser <s.mueller-klieser@phytec.de>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
6 years agobusybox: backport fix for issues introduced by CVE-2011-5325.patch
Martin Jansa [Sun, 10 Mar 2019 20:12:01 +0000 (20:12 +0000)]
busybox: backport fix for issues introduced by CVE-2011-5325.patch

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
6 years agologrotate.py: restore /etc/logrotate.d/wtmp
Mingli Yu [Wed, 13 Feb 2019 05:43:28 +0000 (13:43 +0800)]
logrotate.py: restore /etc/logrotate.d/wtmp

During the test logrotate.LogrotateTest.test_1_logrotate_setup,
there is below logic:
 # mkdir $HOME/logrotate_dir
 # sed -i "s#wtmp {#wtmp {\n    olddir $HOME/logrotate_dir#" /etc/logrotate.d/wtmp

After all logrotate.LogrotateTest finished, only cleanup
$HOME/logrotate_dir as below, but don't restore
the config file /etc/logrotate.d/wtmp.
[snip]
def tearDownClass(cls):
    cls.tc.target.run('rm -rf $HOME/logrotate_dir')
[snip]

That's to say, there is one additional line added
to /etc/logrotate.d/wtmp and will make the logrotate
service start failed when run systemd.SystemdBasicTests.test_systemd_failed

Take an example as below when run test as root:
 # cat /etc/logrotate.d/wtmp
 # no packages own wtmp -- we'll rotate it here
 /var/log/wtmp {
    olddir /root/logrotate_dir
    missingok
    monthly
    create 0664 root utmp
    minsize 1M
    rotate 1
 }

 # ls /root/logrotate_dir
 ls: cannot access '/root/logrotate_dir': No such file or directory

 # systemctl start logrotate
 Job for logrotate.service failed because the control process exited with error code.
 See "systemctl status logrotate.service" and "journalctl -xe" for details.

 # systemctl status logrotate
  logrotate.service - Rotate log files
   Loaded: loaded (/lib/systemd/system/logrotate.service; static; vendor preset>
   Active: failed (Result: exit-code) since Wed 2019-02-13 03:35:19 UTC; 7s ago
     Docs: man:logrotate(8)
           man:logrotate.conf(5)
   Process: 540 ExecStart=/usr/sbin/logrotate /etc/logrotate.conf (code=exited, status=1/FAILURE)
   Main PID: 540 (code=exited, status=1/FAILURE)

  Feb 13 03:35:18 qemumips systemd[1]: Starting Rotate log files...
  Feb 13 03:35:19 qemumips logrotate[540]: error: wtmp:9 error verifying olddir path /root/logrotate_dir: No such file or directory
  Feb 13 03:35:19 qemumips logrotate[540]: error: found error in file wtmp, skipping
  Feb 13 03:35:19 qemumips systemd[1]: logrotate.service: Main process exited, code=exited, status=1/FAILURE
  Feb 13 03:35:19 qemumips systemd[1]: logrotate.service: Failed with result 'exit-code'.
  Feb 13 03:35:19 qemumips systemd[1]: Failed to start Rotate log files.

Add the logic to restore /etc/logrotate.d/wtmp to
make the cleanup complete to fix the above issue.

(From OE-Core rev: a2db9320d97d12d87524ff16a329f9c38a8da33f)

Signed-off-by: Mingli Yu <Mingli.Yu@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
6 years agosystemd: fix CVE-2019-6454
George McCollister [Mon, 25 Feb 2019 16:37:13 +0000 (10:37 -0600)]
systemd: fix CVE-2019-6454

Apply patches from systemd_237-3ubuntu10.13 to fix CVE-2019-6454.
CVE-2019-6454 is an issue in which systemd (PID1) can be crashed
with a specially formed D-Bus message.

For information see:
https://usn.ubuntu.com/3891-1/
https://git.launchpad.net/ubuntu/+source/systemd/commit/?h=applied/ubuntu/bionic-updates&id=d7584b894afcaa8a4a1abb69db2a9c81a6276e80

Signed-off-by: George McCollister <george.mccollister@gmail.com>
6 years agosystemd: fix CVE-2018-6954
George McCollister [Mon, 25 Feb 2019 16:37:12 +0000 (10:37 -0600)]
systemd: fix CVE-2018-6954

Apply patches to fix CVE-2018-6954

NVD description from https://nvd.nist.gov/vuln/detail/CVE-2018-6954

systemd-tmpfiles in systemd through 237 mishandles symlinks present in
non-terminal path components, which allows local users to obtain
ownership of arbitrary files via vectors involving creation of a
directory and a file under that directory, and later replacing that
directory with a symlink. This occurs even if the fs.protected_symlinks
sysctl is turned on.

Patches from systemd_237-3ubuntu10.13.debian.

These patches shouldn't be required on newer OE releases since they use
systemd v239 or higher.

Signed-off-by: George McCollister <george.mccollister@gmail.com>
6 years agosystemd: Security fix CVE-2018-16866
Marcus Cooper [Mon, 25 Feb 2019 16:37:11 +0000 (10:37 -0600)]
systemd: Security fix CVE-2018-16866

Affects < v240

Signed-off-by: Marcus Cooper <marcusc@axis.com>
>From v2 patch on openembedded-core@lists.openembedded.org
Incresed file name number from 0026 to 0027.

Signed-off-by: George McCollister <george.mccollister@gmail.com>
6 years agosystemd: Security fix CVE-2018-16865
George McCollister [Mon, 25 Feb 2019 16:37:10 +0000 (10:37 -0600)]
systemd: Security fix CVE-2018-16865

Affects < v240

Based on thud commit d5d2b821fc85b8cf39f683061ac2a45bddd2139f
The second patch in the thud commit doesn't apply against 237. Use the
version of the second patch CVE-2018-16865_2.patch from
systemd_237-3ubuntu10.13.debian.

Signed-off-by: George McCollister <george.mccollister@gmail.com>
6 years agosystemd: Security fix CVE-2018-16864
George McCollister [Mon, 25 Feb 2019 16:37:09 +0000 (10:37 -0600)]
systemd: Security fix CVE-2018-16864

Affects < v240

Based on thud commit 403e74b07b6f3c4a2444e68c74a8434fb17aee49
The patch in the thud commit doesn't compile against 237. Use the
version of this patch, CVE-2018-16864.patch from
systemd_237-3ubuntu10.13.debian.

Signed-off-by: George McCollister <george.mccollister@gmail.com>
6 years agosystemd: fix CVE-2018-15688
Chen Qi [Mon, 25 Feb 2019 16:37:08 +0000 (10:37 -0600)]
systemd: fix CVE-2018-15688

Backport patch to fix the following CVE.

CVE: CVE-2018-15688

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Cherry-picked from thud 13591d7224393dc0ae529a03cdf74aceb3540ce9

Signed-off-by: George McCollister <george.mccollister@gmail.com>
6 years agosystemd: fix CVE-2018-15687
George McCollister [Mon, 25 Feb 2019 16:37:07 +0000 (10:37 -0600)]
systemd: fix CVE-2018-15687

Backport patch to fix the following CVE.

CVE: CVE-2018-15687

Based on thud commit eeb621aa19f690971caf862290a172a115578ba1
The patch in the thud commit doesn't compile against 237. Use the
version of this patch,  CVE-2018-15687.patch from
systemd_237-3ubuntu10.13.debian.

Signed-off-by: George McCollister <george.mccollister@gmail.com>
6 years agosystemd: fix CVE-2018-15686
Chen Qi [Mon, 25 Feb 2019 16:37:06 +0000 (10:37 -0600)]
systemd: fix CVE-2018-15686

Backport patch to fix the following CVE.

CVE: CVE-2018-15686

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Cherry-picked from thud 0ef70603bc983315eb0e8a97958d995a31198c35

Signed-off-by: George McCollister <george.mccollister@gmail.com>
6 years agosystemd: Fix typo in root home variable.
ROGEZ Matthieu [Mon, 11 Feb 2019 15:27:43 +0000 (15:27 +0000)]
systemd: Fix typo in root home variable.

This regression has been introduced while upgrading to version 237
(commit 906230a73b3ccfa4afd2a19a6b0aa18cd1d5fa08)
and seems to only affect sumo version.

Signed-off-by: Matthieu Rogez <matthieu.rogez@fivesgroup.com>
6 years agooeqa/runtime/dnf: Fix test error when static libs are enabled
Richard Purdie [Tue, 5 Jun 2018 22:38:39 +0000 (22:38 +0000)]
oeqa/runtime/dnf: Fix test error when static libs are enabled

The test works by excluding curl-dev which curl-staticdev depends upon.
When static libraries aren't disabled, this leads to an odd looking test
failure.

Simply exclude curl-staticdev as well in case its enabled to make sure
the test always works.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
6 years agorun-postinsts: for dpkg/opkg, do not rely on /etc/*-postinsts
Stefan Agner [Wed, 16 May 2018 09:13:51 +0000 (11:13 +0200)]
run-postinsts: for dpkg/opkg, do not rely on /etc/*-postinsts

Start opkg/dpkg as soon as the respective package managers status
file is present, no matter whether /etc/$pm-postinsts exists. This
decouples the implicit link between postinsts scripts in /etc and
the package manager: Currently the package manager is only started
if those scripts are present, although the package manager does not
use those scripts at all! Package managers install their own set of
postinst scripts.

The behavior when using rpm packages stays the same.

Note that using the package managers capability to execute postinst
scripts is preferred for good reasons: It makes sure that the
package managers database reflects that the packages have been
completely installed and configured.

This change allows to drop installation of the postinsts scripts
when package management is present. This will be done in a separate
change.

Note: Before commit 5aae19959a44 ("rootfs.py: Change logic to
unistall packages") rootfs.py did not install /etc/$pm-postinsts
when package management is installed! The change caused YOCTO #8235
which lead to the behavior change of run-postinsts in first place.

Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
6 years agopackage_rpm/archiver: Apply bandaid to src.rpm creation
Richard Purdie [Tue, 5 Feb 2019 13:33:37 +0000 (13:33 +0000)]
package_rpm/archiver: Apply bandaid to src.rpm creation

| error: create archive failed on file /media/build1/poky/build/tmp/work/all-poky-linux/xcursor-transparent-theme/0.1.1+gitAUTOINC+23c8af5ba4-r0/deploy-sources/allarch-poky-linux/xcursor-transparent-theme-0.1.1+gitAUTOINC+23c8af5ba4-r0/xcursor-transparent-theme-0.1.1+git0+23c8af5ba4-r0.src.rpm: cpio: read failed - No such file or directory
| Building target platforms: noarch-poky-linux
| Building for target noarch-poky-linux

This is caused by:

$ cat log.task_order

do_cleansstate (24289): log.do_cleansstate.24289
do_deploy_archives_setscene (24395): log.do_deploy_archives_setscene.24395
do_fetch (24407): log.do_fetch.24407
[..]
do_package_write_rpm (25448): log.do_package_write_rpm.25448
do_package_qa (25451): log.do_package_qa.25451

So do_deploy_archives can run from sstate, created a .src.rpm in WORKDIR/deploy-sources,
then it was removed when rpm was running. This leads to a broken Source line in the
spec file as the original file was found by the os.listdir().

This fix is just a bandaid over much more fundamental problems sadly.

(From OE-Core rev: a10020ace4c3cd863c782760f7cbecea557ec6e7)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
6 years agoarchiver/package_rpm: Fix the worst src.rpm generation race
Richard Purdie [Tue, 5 Feb 2019 22:14:26 +0000 (22:14 +0000)]
archiver/package_rpm: Fix the worst src.rpm generation race

The package_rpm code is writing outside the task's sstate directory into
the sstate of do_deploy_archives. This is "out of spec" since if the
task is installed from sstate, the files are not restored. This means
the files may appear/disappear, things are not deterministic and there are
races.

Extend the do_package_write_rpm code to handle writing the src.rpm into
place to avoid these issues. There are other problems but this avoids races
around this file.

(From OE-Core rev: c6e151ba7fe0f14044537cf0ab2cac436f1496e3)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
6 years agolibtool-cross: Handle ccache sstate 'infection' issues
Richard Purdie [Fri, 10 Aug 2018 10:10:15 +0000 (10:10 +0000)]
libtool-cross: Handle ccache sstate 'infection' issues

On a system without ccache, f you:

INHERIT += "ccache"
bitbake libtool-cross
<remove INHERIT>
bitbake apmd

then it fails due to being unable to find ccache. The references to ccache are
coded into libtool-cross but the sstate checksum doesn't reflect this due to the
way the class is coded (output should be the same regardless).

The simplest solution is to remove references to ccache from the libtool script.
The output then works regardless of whether ccache is present or not. The
libtool-cross script is only used in a handful of cases (most of the time its
dynamically generated by autoconf) so any performance issue is minor.

(From OE-Core rev: ed550a49d2114c56e5bc033ecd0e83073d2d4067)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
6 years agolibtool: Fix patch status tag
Richard Purdie [Wed, 1 Aug 2018 09:27:45 +0000 (10:27 +0100)]
libtool: Fix patch status tag

(From OE-Core rev: 28fc470e5e10ee9cce893d037ed5e518bc5612f5)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
6 years agolibtool: Fix problem with libtoolize in multilib installations
Richard Purdie [Mon, 30 Jul 2018 17:00:01 +0000 (17:00 +0000)]
libtool: Fix problem with libtoolize in multilib installations

Without this patch /usr/bin/libtoolize is different for each multilib
since their host-triplets are different, despite there being no difference in
the functionality of libtoolize itself.

This change just patches out the problematic line since its just a comment for the user
in help text. Ugly but solves the problem. This fixes issues where libtool and
libXX-libtool couldn't be installed into the same system.

(From OE-Core rev: f70040fd3ca3508d33ed24c749c0b8095b020dab)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
6 years agomultilib_script: Add support for multilib scripts
Richard Purdie [Mon, 30 Jul 2018 13:09:29 +0000 (13:09 +0000)]
multilib_script: Add support for multilib scripts

Whilst the package managers handle multilib ELF binaries well, they don't
handle scripts in the *bindir directories well. This adds support for
marking these up so that they can be handled using update-alternatives.

Its done this way so that non-multilib systems don't see any changes and
there is standardisation amongst the multilibs on how the alternatives are
named and prioritiesd. The priotitisation code needs to be added but this
change means there is somewhere to add it.

Recipe needs to set MULTILIB_SCRIPTS in the form <pkgname>:<scriptname>, e.g.
MULTILIB_SCRIPTS = "${PN}-dev:${bindir}/file1 ${PN}:${base_bindir}/file2"
to indicate which script files to process from which packages.

libtool is used a as a reference to stop the libtool scripts conflicting
in a multilib case and allows the kernel-devsrc change to be merged.

(From OE-Core rev: 18e837433d07cfdce4019c13f682c6676425a2ad)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
6 years agoimage_types: use cpio-native to build cpio images
Ross Burton [Thu, 29 Nov 2018 11:42:15 +0000 (11:42 +0000)]
image_types: use cpio-native to build cpio images

As per the previous commit, upstream cpio has a bug which means it crashes on
append. If the image being built has already had testimage ran then cpio-native
will be in the sysroot.  It's also possible that some distributions are shipping
this broken CVE patch too.

Now that our cpio-native is fixed, until we can be sure that the host cpio isn't
broken depend on cpio-native if building a cpio image.

[ YOCTO #13042 ]

(From OE-Core rev: c3b9aedcbe538d7fa74bd814644b4899769dec46)

(From OE-Core rev: a75eba71145efa1c3d206c5e5c00608a50f013bc)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
6 years agocpio: fix crash when appending to archives
Ross Burton [Thu, 29 Nov 2018 11:42:14 +0000 (11:42 +0000)]
cpio: fix crash when appending to archives

The upstream fix for CVE-2016-2037 introduced a read from uninitialized memory
bug when appending to an existing archive, which is an operation we perform when
building an image.

(From OE-Core rev: 046e3e1fca925febf47b3fdd5d4e9ee2e1fad868)

(From OE-Core rev: 2ff6ab2e2944c6a53523b4b1611e1d22f6393500)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
6 years agooe-selftest: devtool: Support meta being a symbolic link
Peter Kjellerstedt [Sat, 20 Oct 2018 23:20:59 +0000 (01:20 +0200)]
oe-selftest: devtool: Support meta being a symbolic link

oe-selftest's devtool tests have been broken since commit 2457cd57
(oe-selftest: devtool: avoid parallel races by using temporary copy of
core) if meta is a symbolic link.

(From OE-Core rev: daba6c5a991b370709d17e51305334f55a3858ec)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
6 years agooe-selftest: devtool: avoid parallel races by using temporary copy of core
Paul Eggleton [Thu, 26 Jul 2018 14:27:44 +0000 (16:27 +0200)]
oe-selftest: devtool: avoid parallel races by using temporary copy of core

Some of the devtool tests make changes to files under meta/ -
legitimately since we want these tests to be working with real recipes
and associated files. Unfortunately with the new oe-selftest
parallelisation this can break other tests if files go missing at the
wrong time (among other scenarios). To avoid this issue, simply take a
copy of the core repository and use that for these tests. (We copy the
entire repository since changing the path of meta/ influences COREBASE
and thus we need to have things like scripts/ alongside as well).

(From OE-Core rev: 2457cd57b4195924ef127f497efa2f34f411e660)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
6 years agoOnly add uninative and checksum if inherited uninative class
Jeremy Puhlman [Wed, 25 Apr 2018 21:18:27 +0000 (14:18 -0700)]
Only add uninative and checksum if inherited uninative class

The checksum value is only calculated if the uninative class is
inherited, so check for inherit before adding it to local.conf

(From OE-Core rev: 3b5b832589d943700b273e3a4d83561be0c47f36)

Signed-off-by: Jeremy Puhlman <jpuhlman@mvista.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
6 years agooeqa/utils/httpserver: Rework to avoid hangs and improve logging
Richard Purdie [Fri, 16 Nov 2018 09:33:28 +0000 (09:33 +0000)]
oeqa/utils/httpserver: Rework to avoid hangs and improve logging

testimage.bbclass installs a SIGTERM handler which conflicts with the
use of multiprocessing here. This is paritcularly problematic if the http
service is terminated before its started and hence before its had a chance
to reset the default signal handler (as the code was written).

Instead, temporarily remove testimage's handler whilst forking the http process
which means the correct handler is installed and won't deadlock.

Also take the opportunity to add in some log messages about the server start
and shutdown so that future debugging is easier and its clearer what the code
is doing.

(From OE-Core rev: cc0471439aa0085ca87deccf061c5b676ef12388)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
6 years agooeqa/runtime/dnf: Make sure test_dnf_install does not skipped
Yeoh Ee Peng [Wed, 29 Aug 2018 09:48:21 +0000 (17:48 +0800)]
oeqa/runtime/dnf: Make sure test_dnf_install does not skipped

During debugging dnf issue, we found that the test_dnf_install
PASSED the testing even though the environment does not allow
dnf install to run successfully. Further debugging had identified
that current test_dnf_install will execute dnf install even when
the package to be installed already exist, thus dnf install
will just skipped and this test will PASSED even though it was
not.

To solve this, added additional logic to check if the package
to be installed already exist, if yes then remove the package
before actually run dnf install. This will make sure dnf install
was tested as expected.

(From OE-Core rev: 4f662b253f7313c4e02bfafb527cdac076b6309a)

Signed-off-by: Yeoh Ee Peng <ee.peng.yeoh@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
6 years agoperl: add testdepends for ssh
Armin Kuster [Wed, 30 Jan 2019 03:24:13 +0000 (19:24 -0800)]
perl: add testdepends for ssh

fixes:

 DEBUG: [Running]$ ssh -l root -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o LogLevel=ERROR 192.168.7.4 export PATH=/usr/sbin:/sbin:/usr/bin:/bin; perl -e '$_="Uryyb, jbeyq"; tr/a-zA-Z/n-za-mN-ZA-M/;print'
| DEBUG: time: 1548816904.4024463, endtime: 1548817204.397057
| DEBUG: Partial data from SSH call: ssh: connect to host 192.168.7.4 port 22: Connection refused

for master/thud/sumo

Signed-off-by: Armin Kuster <akuster808@gmail.com>
6 years agooeqa: rationalise Perl tests
Ross Burton [Thu, 19 Jul 2018 16:12:40 +0000 (17:12 +0100)]
oeqa: rationalise Perl tests

As with the Python test, this can be both better and faster.  No need to copy a
file, just run a one-liner.

(From OE-Core rev: c6eef46747fe58bb2310be4f06d2fa9b67901d72)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
6 years agooeqa/utils/buildproject: Only clean files if we've done something
Richard Purdie [Fri, 9 Nov 2018 12:48:39 +0000 (12:48 +0000)]
oeqa/utils/buildproject: Only clean files if we've done something

We should only be wiping out things on target if the tests have
actually run.

(From OE-Core rev: d38c3eac0a5a1a9b0eb98385832e92f48145655e)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
6 years agooeqa/selftest/runqemu: Enable kvm when QEMU_USE_KVM is set
Robert Yang [Fri, 4 Jan 2019 07:15:45 +0000 (15:15 +0800)]
oeqa/selftest/runqemu: Enable kvm when QEMU_USE_KVM is set

(From OE-Core rev: 564de3681353fe8e203425388e8be9703a89d2da)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
6 years agooeqa/qemu & runtime: qemu do not need ip input from external
Yeoh Ee Peng [Thu, 22 Nov 2018 09:10:43 +0000 (17:10 +0800)]
oeqa/qemu & runtime: qemu do not need ip input from external

Qemu do not use the ip input from external. It will
retrieve ip from QemuRunner instance and assign
ip value.

(From OE-Core rev: 14d99dc6c39c963ba3e0d9a30274846bd5369210)

Signed-off-by: Yeoh Ee Peng <ee.peng.yeoh@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
6 years agooeqa/runtime/cases: Improve dependencies of kernel/gcc/build tests
Richard Purdie [Fri, 9 Nov 2018 09:55:40 +0000 (09:55 +0000)]
oeqa/runtime/cases: Improve dependencies of kernel/gcc/build tests

Mark up these tests as needing a compiler, make and kernel source code
as appropriate, the image feature requirements can then be retired.

(From OE-Core rev: 9f64e6c25abdf494fb511e9cd401f8dcaa08be2a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
6 years agooeqa/runtime/cases: Improve test dependency information
Richard Purdie [Thu, 8 Nov 2018 19:55:17 +0000 (19:55 +0000)]
oeqa/runtime/cases: Improve test dependency information

Add the OEHasPackage decorator to a variety of tests so they determine
automatically if they should run against a given image.

To ensure tests can do this we need to move target operations such
as scp commands into the tests and out of the class startup/teardown.

(From OE-Core rev: 60d6580b85714b8960a964e775d76a7f937f5e5a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
6 years agooeqa/runtime/python: clean up Python test
Ross Burton [Mon, 16 Jul 2018 12:12:38 +0000 (13:12 +0100)]
oeqa/runtime/python: clean up Python test

Currently this is three test cases:

1) test_python_exists.  Fail if python3 isn't in PATH.
2) test_python_stdout.  Run a Python script and check the output is as expected
3) test_python_testfile.  Check that a file test_python_stdout wrote to exists.

(1) should be a setup and skip the test module if it isn't present.
(2) and (3) should be merged, there's no point copying over a two line Python
file, and the test doesn't verify that the file doesn't exist in the first
place.

Rewrite the test to check that Python is present in a class setup so the entire
test is skipped if it isn't and do some simple rot13 to verify that bytecode is
being executed correctly.

(From OE-Core rev: a35be5f32b4fe70b18ac1e2eccfd94558cecfbba)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
6 years agooeqa/runtime/cases/python: use python 3 rather than python 2
Alexander Kanavin [Wed, 4 Apr 2018 11:13:21 +0000 (14:13 +0300)]
oeqa/runtime/cases/python: use python 3 rather than python 2

For example, core-image-sato skipped the test alltogether, as it
no longer pulls in Python 2.x at all.

(From OE-Core rev: 5ad0fe9ac6b6362011a17afaa7bee8e788093915)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
6 years agorunqemu-gen-tapdevs: Allow run --help without sudo
Robert Yang [Fri, 28 Dec 2018 08:58:58 +0000 (00:58 -0800)]
runqemu-gen-tapdevs: Allow run --help without sudo

Then we can get user's UID and GID rather than hardcode to 1000, e.g.:

- Without sudo
$ runqemu-gen-tapdevs --help
[snip]
$ sudo ../poky/scripts/runqemu-gen-tapdevs 15220 100 4 tmp/sysroots-components/x86_64/qemu-helper-native/usr/bin
[snip]

- With sudo
$ sudo ../poky/scripts/runqemu-gen-tapdevs --help
[snip]
$ sudo ../poky/scripts/runqemu-gen-tapdevs 15220 100 4 tmp/sysroots-components/x86_64/qemu-helper-native/usr/bin
[snip]

(From OE-Core rev: 446e7da7e56f9de3602498b5ef40e9e0f8f71837)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
6 years agorunqemu: clean up subprocess usage
Ross Burton [Fri, 21 Sep 2018 15:11:32 +0000 (16:11 +0100)]
runqemu: clean up subprocess usage

Where possible pass lists instead of strings, don't use a subshell, and call
check*() instead of using Popen directly.

(From OE-Core rev: d2374623444752af1ad748ed36b68ea58f629bf6)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
6 years agooeqa/runtime/cases/rpm.py: change to use base-passwd-doc
Chen Qi [Thu, 14 Jun 2018 04:52:32 +0000 (12:52 +0800)]
oeqa/runtime/cases/rpm.py: change to use base-passwd-doc

The test cases assume that rpm-doc is built out, as it says it its
comment. This is not always true. And it sometimes results in
following error.

  |     cls.tc.target.copyTo(test_file, dst)
  | UnboundLocalError: local variable 'test_file' referenced before assignment

Change to use base-passwd-doc, as this package is more likely to be
built out than rpm-doc.

(From OE-Core rev: 2e23543b48921182307065c1fa9e8b9d7fbb3cdc)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
6 years agooeqa: replace Alex Kanavin's @intel email address with a personal one
Alexander Kanavin [Mon, 4 Jun 2018 08:21:51 +0000 (11:21 +0300)]
oeqa: replace Alex Kanavin's @intel email address with a personal one

As I will be leaving Intel, this address will no longer be valid,
so swap it for my personal one for now.

(From OE-Core rev: ea58ff101e28dfda3410de66d775df3d8a1e5a96)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
6 years agooeqa: make it work for multiple users
Robert Yang [Thu, 10 Jan 2019 07:49:49 +0000 (15:49 +0800)]
oeqa: make it work for multiple users

There are failures when multiple users run oe-selftest on the same
host:

PermissionError: [Errno 13] Permission denied: '/tmp/oe-saved-
tests/201812250324_qemu'

This is because /tmp/oe-saved-tests was created by user A, while user B tries
to write data in it, then the error will happen. This patch can fix the
problem.

Move the dumped data to ${LOG_DIR}/runtime-hostdump/ rather than
/tmp/oe-saved-tests/ to fix the problem.

(From OE-Core rev: e219fe5329599cd6c3682f521eaee3852a2c8980)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
6 years agometa/classes/testimage.bbclass: Only validate IMAGE_FSTYPES when is QEMU
Aníbal Limón [Wed, 2 Jan 2019 16:08:13 +0000 (10:08 -0600)]
meta/classes/testimage.bbclass: Only validate IMAGE_FSTYPES when is QEMU

When use simpleremote target the flash/boot process is executed
manually, the IMAGE_FSTYPES validation is only needed when execute
testimage against qemu.

The supported_fstypes comes from oeqa.core.target.qemu module.

(From OE-Core rev: e7dc5963adbacc091fe8943119262166977623ad)

Signed-off-by: Aníbal Limón <anibal.limon@linaro.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
6 years agotestimage.bbclass: remove boot parameter systemd.log_target
Kai Kang [Tue, 25 Dec 2018 09:39:43 +0000 (04:39 -0500)]
testimage.bbclass: remove boot parameter systemd.log_target

Boot parameter systemd.log_target=console affects command journalctl's
output and causes oe selftest case test_systemd_boot_time fail to pass.

| Error at obtaining the boot time from journalctl
| RESULTS:
| RESULTS - systemd.SystemdJournalTests.test_systemd_boot_time - Testcase -1: SKIPPED (0.74s)

systemd.log_target=console was introduced by oe-core commit a0bb649 and
work with parameter systemd.log_level to enable systemd debug.
systemd.log_level has been removed already, so remove systemd.log_target
too to make case test_systemd_boot_time pass.

(From OE-Core rev: caa776bdcf8ea34c857f45970370bf771075f4bc)

Signed-off-by: Kai Kang <kai.kang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
6 years agotestimage: Add possibility to pass parmeters to qemu
Erik Botö [Fri, 14 Dec 2018 18:53:42 +0000 (19:53 +0100)]
testimage: Add possibility to pass parmeters to qemu

Add a variable called TEST_QEMUPARAMS in testimage.bbclass to make it
possible to pass parameters to qemu. This can be useful for e.g.
increasing the amount of RAM available during testimage runs.

(From OE-Core rev: 1a9163f5779d233c884c8fd50e0812eabab4fdf3)

Signed-off-by: Erik Botö <erik.boto@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
6 years agotestimage: Add support for slirp
Yeoh Ee Peng [Thu, 22 Nov 2018 09:10:46 +0000 (17:10 +0800)]
testimage: Add support for slirp

Enable testimage to support qemu slirp. Configure "QEMU_USE_SLIRP"
& "TEST_SERVER_IP" variables to enable slirp.

[YOCTO#10713]

(From OE-Core rev: 3df9ee85ce7fe52f0893fd33aea3bf1fcc6ead0a)

Signed-off-by: Yeoh Ee Peng <ee.peng.yeoh@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
6 years agotestimage: Enable autorunning of the package manager testsuites
Richard Purdie [Fri, 16 Nov 2018 09:39:30 +0000 (09:39 +0000)]
testimage: Enable autorunning of the package manager testsuites

Now that the hangs in httpservice are fixed we can let these tests
auto skip as appropriate.

(From OE-Core rev: 42a0d70291d551578e21f590fcb85ca72a78ccb5)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
6 years agotestimage: Further cleanup DEFAULT_TEST_SUITES
Richard Purdie [Fri, 9 Nov 2018 09:59:19 +0000 (09:59 +0000)]
testimage: Further cleanup DEFAULT_TEST_SUITES

Now the test markup of the development tools tests is complete, this
can be further tweaked to auto run the correct tests.

(From OE-Core rev: bd4f8d12fe1f9f2643ee9e68fa2bb981134294fb)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
6 years agotestimage: Simplfy DEFAULT_TEST_SUITES logic
Richard Purdie [Thu, 8 Nov 2018 19:57:49 +0000 (19:57 +0000)]
testimage: Simplfy DEFAULT_TEST_SUITES logic

Now that the tests have correct markup to automatically determine which images
they can run against, clean up the default test suites logic to be simpler
and not image specific.

Some cleanup of the compiler tests still needs to be completed but this
is a good first step.

The only downside to this is more noise during testing as we now see
many skipped messages for simple images like core-image-minimal.

The auto type is being removed since it currently breaks badly due to the
socat mandatory inclusion from the meta-selftest layer which is a problem
which needs to be addressed seperately.

(From OE-Core rev: 4966bc33845752eb0aeae54b72e8ba0146a7ed52)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
[Fix for sumo context]
Signed-off-by: Armin Kuster <akuster808@gmail.com>
6 years agoruntime/dnf: Add new dnf test cases
Jose Perez Carranza [Thu, 30 Nov 2017 16:23:02 +0000 (10:23 -0600)]
runtime/dnf: Add new dnf test cases

Add test cases to test “exclude” and “installroot“ options, also modify
the logic of filtering packages on the feed to have all the packages
needed by the tests.

[YOCTO #10744]

(From OE-Core rev: 1121806603c6f621d084b692216f3f616a0768dc)

Signed-off-by: Jose Perez Carranza <jose.perez.carranza@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
6 years agokernel: don't assign the build user/host
Federico Sauter [Wed, 5 Dec 2018 14:22:32 +0000 (14:22 +0000)]
kernel: don't assign the build user/host

The KBUILD_BUILD_USER and KBUILD_BUILD_HOST variables were
assigned at the kernel class level, which made it impossible
to override them in the local configuration.

By setting only the default values of those variables in the
kernel class, it is now possible to override them as expected.

(From OE-Core rev: a3e8cdf9c3ba966fa4b5a21235540eb0b00fb487)

Signed-off-by: Federico Sauter <federico.sauter@ableton.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
6 years agooeqa: Fix for QEMU_USE_KVM
Robert Yang [Fri, 4 Jan 2019 07:15:43 +0000 (15:15 +0800)]
oeqa: Fix for QEMU_USE_KVM

Fixed:
MACHINE = "qemux86"
QEMU_USE_KVM = "qemux86"
IMAGE_CLASSES += "testimage"

$ oe-selftest -r runqemu.RunqemuTests.test_boot_rootfs

[snip]
  File "/buildarea1/lyang1/poky/meta/lib/oe/types.py", line 122, in boolean
    raise ValueError("Invalid boolean value '%s'" % value)
ValueError: Invalid boolean value 'qemux86'

Now QEMU_USE_KVM can only be boolean, can not contain MACHINE any more, kvm
will be enabled if target_arch == build_arch or both of them are x86 archs.

(From OE-Core rev: 7c1a8a624cad8d967635c6cb5f99cf655bde3d44)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
6 years agopatch: reproducibility: Fix host umask leakage
Douglas Royds [Thu, 20 Dec 2018 23:10:22 +0000 (12:10 +1300)]
patch: reproducibility: Fix host umask leakage

Some patch files create entirely new files, so their permissions are subject to
the host umask. If such a file is later installed into a package with no change
in permissions, it breaks the reproducibility of the package.

This was observed on libpam, for instance: The patch file
pam-security-abstract-securetty-handling.patch creates a new file
(tty_secure.c). This file is later copied into the -dbg package with no change
in permissions.

(From OE-Core rev: 2a2bbd755b330cd63f7f6e2f2b374a3ae065b37a)

Signed-off-by: Douglas Royds <douglas.royds@taitradio.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
6 years agoscripts/oe-git-archive: fix non-existent key referencing error
Yeoh Ee Peng [Fri, 4 Jan 2019 06:46:01 +0000 (14:46 +0800)]
scripts/oe-git-archive: fix non-existent key referencing error

Without installing gitpython package, oe-git-archive will face error
below, where it was referencing key that was non-existent inside
metadata object.

Traceback (most recent call last):
  File "<poky_dir>/scripts/oe-git-archive", line 271, in <module>
    sys.exit(main())
  File "<poky_dir>/scripts/oe-git-archive", line 229, in main
    'commit_count': metadata['layers']['meta']['commit_count'],
KeyError: 'commit_count'

Fix this error by adding exception catch when referencing
non-existent key (based on inputs provided by Richard Purdie).

[YOCTO# 13082]

(From OE-Core rev: 9a3cc9b8523b78dda6c3f3f2e12798b2b907d7e5)

Signed-off-by: Yeoh Ee Peng <ee.peng.yeoh@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
6 years agopackage.bbclass: fix python unclosed file ResourceWarning
Chen Qi [Tue, 18 Dec 2018 06:53:43 +0000 (14:53 +0800)]
package.bbclass: fix python unclosed file ResourceWarning

Fix the following warning.

  ResourceWarning: unclosed file <_io.TextIOWrapper name='/.../systemd/1_239-r0/debugsources.list' mode='a' encoding='UTF-8'>

(From OE-Core rev: 91810a57f0edd8b37c5f3f989a5aca69d9a40b37)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
[Fixup for sumo context]
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
6 years agopackage: Rework PACKAGELOCK based upon sstate for do_packagedata
Richard Purdie [Wed, 18 Jul 2018 12:54:05 +0000 (13:54 +0100)]
package: Rework PACKAGELOCK based upon sstate for do_packagedata

I think this lock dates from before we had sstate for do_packagedata.

Since WORKDIR is recipe specific and we write into WORKDIR, we no longer need
any write locks in the do_packagedata code itself, its handled by the sstate
task lock for the final copy in at the end. The final write lock can be simply
removed.

The only time we need read locking is when actually reading data from the
shared directory. We can therefore reduce the window the lock is held
significantly as well, hence improving the speed of packagedata tasks running
in parallel.

(From OE-Core rev: f7106cdf2190d9ec59132a1cb2bb431d653cd9c5)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
6 years agotestimage.bbclass: fix qemu_use_kvm handling
Emmanuel Roullit [Wed, 5 Sep 2018 19:49:58 +0000 (21:49 +0200)]
testimage.bbclass: fix qemu_use_kvm handling

QEMU_USE_KVM can either be a boolean or a whitespace separated list
of kvm supported machines.
For the 'intel-corei7-64' machine, defined in meta-intel, kvm could not be
used as the 'x86' substring is not part of its machine name.

By changing the order of this 'or' statement and setting
the 'QEMU_USE_KVM' variable to 'intel-corei7-64', it is possible to run the
'testimage' task with kvm support successfully.

(From OE-Core rev: a22789253aa653dc50fb159b40910248c2f98dd4)

Signed-off-by: Emmanuel Roullit <emmanuel.roullit@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
6 years agotestimage/testsdk/selftest: Avoid platform.distro_identifier deprecation warnings
Richard Purdie [Thu, 15 Nov 2018 14:38:19 +0000 (14:38 +0000)]
testimage/testsdk/selftest: Avoid platform.distro_identifier deprecation warnings

Use our own lsb function instead as used elsewhere by the codebase.

(From OE-Core rev: acac45a6fd604d28ef7c23d67482af3d7e8bcfe3)

(From OE-Core rev: 570256a64af5a3fa994a20a5cc4c74d59ffc361f)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
6 years agooeqa/utils/qemurunner: set timeout to 60s for run_serial
Robert Yang [Thu, 3 Jan 2019 08:16:32 +0000 (16:16 +0800)]
oeqa/utils/qemurunner: set timeout to 60s for run_serial

The 5s timeout for non-kvm is too short, especially when the load is high,
which leads to unexpected errors, so set timeout to 60s by default.

(From OE-Core rev: 8197d0f638a760fc03062c7a9009117d083d7ead)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
6 years agotzdata/tzcode-native: update to 2018i
Armin Kuster [Wed, 2 Jan 2019 16:36:10 +0000 (08:36 -0800)]
tzdata/tzcode-native: update to 2018i

2018i:

  Briefly:
    São Tomé and Príncipe switches from +01 to +00 on 2019-01-01.

  Changes to future timestamps

    Due to a change in government, São Tomé and Príncipe switches back
    from +01 to +00 on 2019-01-01 at 02:00.  (Thanks to Vadim
    Nasardinov and Michael Deckers.)

2018h:
Briefly:
    Qyzylorda, Kazakhstan moved from +06 to +05 on 2018-12-21.
    New zone Asia/Qostanay because Qostanay, Kazakhstan didn't move.
    Metlakatla, Alaska observes PST this winter only.
    Guess Morocco will continue to adjust clocks around Ramadan.
    Add predictions for Iran from 2038 through 2090.

  Changes to future timestamps

    Guess that Morocco will continue to fall back just before and
    spring forward just after Ramadan, the practice since 2012.
    (Thanks to Maamar Abdelkader.)  This means Morocco will observe
    negative DST during Ramadan in main and vanguard formats, and in
    rearguard format it stays in the +00 timezone and observes
    ordinary DST in all months other than Ramadan.  As before, extend
    this guesswork to the year 2037.  As a consequence, Morocco is
    scheduled to observe three DST transitions in some Gregorian years
    (e.g., 2033) due to the mismatch between the Gregorian and Islamic
    calendars.

    The table of exact transitions for Iranian DST has been extended.
    It formerly cut off before the year 2038 in a nod to 32-bit time_t.
    It now cuts off before 2091 as there is doubt about how the Persian
    calendar will treat 2091.  This change predicts DST transitions in
    2038-9, 2042-3, and 2046-7 to occur one day later than previously
    predicted.  As before, post-cutoff transitions are approximated.

  Changes to past and future timestamps

    Qyzylorda (aka Kyzylorda) oblast in Kazakhstan moved from +06 to
    +05 on 2018-12-21.  This is a zone split as Qostanay (aka
    Kostanay) did not switch, so create a zone Asia/Qostanay.

    Metlakatla moved from Alaska to Pacific standard time on 2018-11-04.
    It did not change clocks that day and remains on -08 this winter.
    (Thanks to Ryan Stanley.)  It will revert to the usual Alaska
    rules next spring, so this change affects only timestamps
    from 2018-11-04 through 2019-03-10.

  Change to past timestamps

    Kwajalein's 1993-08-20 transition from -12 to +12 was at 24:00,
    not 00:00.  I transcribed the time incorrectly from Shanks.
    (Thanks to Phake Nick.)

    Nauru's 1979 transition was on 02-10 at 02:00, not 05-01 at 00:00.
    (Thanks to Phake Nick.)

    Guam observed DST irregularly from 1959 through 1977.
    (Thanks to Phake Nick.)

    Hong Kong observed DST in 1941 starting 06-15 (not 04-01), then on
    10-01 changed standard time to +08:30 (not +08).  Its transition
    back to +08 after WWII was on 1945-09-15, not the previous day.
    Its 1904-10-30 change took effect at 01:00 +08 (not 00:00 LMT).
    (Thanks to Phake Nick, Steve Allen, and Joseph Myers.)  Also,
    its 1952 fallback was on 11-02 (not 10-25).

    This release contains many changes to timestamps before 1946 due
    to Japanese possession or occupation of Pacific/Chuuk,
    Pacific/Guam, Pacific/Kosrae, Pacific/Kwajalein, Pacific/Majuro,
    Pacific/Nauru, Pacific/Palau, and Pacific/Pohnpei.
    (Thanks to Phake Nick.)

    Assume that the Spanish East Indies was like the Philippines and
    observed American time until the end of 1844.  This affects
    Pacific/Chuuk, Pacific/Kosrae, Pacific/Palau, and Pacific/Pohnpei.

  Changes to past tm_isdst flags

    For the recent Morocco change, the tm_isdst flag should be 1 from
    2018-10-27 00:00 to 2018-10-28 03:00.  (Thanks to Michael Deckers.)
    Give a URL to the official decree.  (Thanks to Matt Johnson.)

(From OE-Core rev: 100d0d0f24cabedd1a89b69ac8ffb05d85663761)

Signed-off-by: Armin Kuster <akuster808@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
6 years agotzcode-native: update to 2018g
Armin Kuster [Sun, 28 Oct 2018 23:38:32 +0000 (23:38 +0000)]
tzcode-native: update to 2018g

  Changes to code

    When generating TZif files with leap seconds, zic no longer uses a
    format that trips up older 32-bit clients, fixing a bug introduced
    in 2018f.  (Reported by Daniel Fischer.)  Also, the zic workaround
    for QTBUG-53071 now also works for TZif files with leap seconds.

    The translator to rearguard format now rewrites the line
    "Rule Japan 1948 1951 - Sep Sat>=8 25:00 0 S" to
    "Rule Japan 1948 1951 - Sep Sun>=9  1:00 0 S".
    This caters to zic before 2007 and to Oracle TZUpdater 2.2.0
    and earlier.  (Reported by Christos Zoulas.)

  Changes to past time zone abbreviations

    Change HDT to HWT/HPT for WWII-era abbreviations in Hawaii.
    This reverts to 2011h, as the abbreviation change in 2011i was
    likely inadvertent.

  Changes to documentation

    tzfile.5 has new sections on interoperability issues.

(From OE-Core rev: a24d0c174411a32a2793c89980ca87c4f9d98bc4)

Signed-off-by: Armin Kuster <akuster808@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
6 years agotzdata: update to 2018g
Armin Kuster [Mon, 29 Oct 2018 01:29:32 +0000 (01:29 +0000)]
tzdata: update to 2018g

  Changes to code

    When generating TZif files with leap seconds, zic no longer uses a
    format that trips up older 32-bit clients, fixing a bug introduced
    in 2018f.  (Reported by Daniel Fischer.)  Also, the zic workaround
    for QTBUG-53071 now also works for TZif files with leap seconds.

    The translator to rearguard format now rewrites the line
    "Rule Japan 1948 1951 - Sep Sat>=8 25:00 0 S" to
    "Rule Japan 1948 1951 - Sep Sun>=9  1:00 0 S".
    This caters to zic before 2007 and to Oracle TZUpdater 2.2.0
    and earlier.  (Reported by Christos Zoulas.)

  Changes to past time zone abbreviations

    Change HDT to HWT/HPT for WWII-era abbreviations in Hawaii.
    This reverts to 2011h, as the abbreviation change in 2011i was
    likely inadvertent.

  Changes to documentation

    tzfile.5 has new sections on interoperability issues.

(From OE-Core rev: 32e5dd919a61b1c245fb6a867d0ea4a71d394aca)

Signed-off-by: Armin Kuster <akuster808@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
6 years agooeqa/utils/qemurunner: Print output when failed to login
Robert Yang [Thu, 27 Dec 2018 08:59:43 +0000 (00:59 -0800)]
oeqa/utils/qemurunner: Print output when failed to login

This is useful for debugging.

(From OE-Core rev: da527d73f5eeae0f29b5f99aab757491d3f87ec7)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
6 years agobusybox: Put klogd/syslogd alternative links in syslog package
Richard Purdie [Wed, 5 Sep 2018 16:39:31 +0000 (17:39 +0100)]
busybox: Put klogd/syslogd alternative links in syslog package

Currently these are in ${PN} and ${PN}-syslog may get replaced by
other packages but update-alternatives would error in the postinst
if other files were installed first. Avoid the problems by putting
the links in the correct package.

(From OE-Core rev: ef11c54ba99af261a70ec31091216cdd1556da24)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
6 years agotestsdk: Improvements to the json logging
Richard Purdie [Mon, 29 Oct 2018 13:49:24 +0000 (13:49 +0000)]
testsdk: Improvements to the json logging

Tweak the preceeding commit to:
* Add STARTTIME to the identifier to make it unique
* Add MACHINE to the identifier
* Use LOG_DIR
* Store the layer config in a more natural json format
* Drop '_' function prefixes

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
6 years agotestimage: Improvements to the json logging
Richard Purdie [Mon, 29 Oct 2018 13:49:14 +0000 (13:49 +0000)]
testimage: Improvements to the json logging

Tweak the preceeding commit to:

* Add STARTTIME to the identifier to make it unique
* Log DISTRO
* Use LOG_DIR
* Store the layer config in a more natural json format
* Drop '_' function prefixes

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
6 years agooeqa/selftest/esdk: Fix typo causing test failure
Richard Purdie [Thu, 6 Dec 2018 23:25:49 +0000 (23:25 +0000)]
oeqa/selftest/esdk: Fix typo causing test failure

2018-12-06 23:19:24,564 - oe-selftest - INFO - Traceback (most recent call last):
  File "/media/build1/poky-sumo/meta/lib/oeqa/core/case.py", line 32, in _oeSetUpClass
    clss.setUpClassMethod()
  File "/media/build1/poky-sumo/meta/lib/oeqa/selftest/cases/eSDK.py", line 78, in setUpClass
    cls.tmpdir_eSDKQA = cls.tempdirobj.name
AttributeError: type object 'oeSDKExtSelfTest' has no attribute 'tempdirobj'

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
6 years agodefault-versions.inc: Make PREFERRED_VERSION_openssl* overwritable
Stefan Lendl [Tue, 27 Nov 2018 13:19:45 +0000 (14:19 +0100)]
default-versions.inc: Make PREFERRED_VERSION_openssl* overwritable

defaultsetup.conf and therefore default-versions.inc is sourced pretty late in bitbake.conf.
default-versions.inc overwrites previous assignments of PREFERRED_VERSION_openssl.
Assigning it with ?= allows other .conf files to assign correctly.
in particular assignment in conf/local.conf and machine config is used instead of default.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
6 years agooeqa/selftest/esdk: Ensure parent directory exists
Richard Purdie [Thu, 6 Dec 2018 14:06:34 +0000 (14:06 +0000)]
oeqa/selftest/esdk: Ensure parent directory exists

INFO - ======================================================================
INFO - ERROR: setUpClass (eSDK.oeSDKExtSelfTest)
INFO - ----------------------------------------------------------------------
INFO - Traceback (most recent call last):
  File "/home/pokybuild/yocto-worker/oe-selftest-debian/build/meta/lib/oeqa/core/case.py", line 32, in _oeSetUpClass
    clss.setUpClassMethod()
  File "/home/pokybuild/yocto-worker/oe-selftest-debian/build/meta/lib/oeqa/selftest/cases/eSDK.py", line 76, in setUpClass
    cls.tmpdirobj = tempfile.TemporaryDirectory(prefix="selftest-esdk-", dir=bb_vars["WORKDIR"])
  File "/usr/lib/python3.5/tempfile.py", line 929, in __init__
    self.name = mkdtemp(suffix, prefix, dir)
  File "/usr/lib/python3.5/tempfile.py", line 507, in mkdtemp
    _os.mkdir(file, 0o700)
FileNotFoundError: [Errno 2] No such file or directory: '/home/pokybuild/yocto-worker/oe-selftest-debian/build/build/tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0-r0/selftest-esdk-q7ln84gc'

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
6 years agoimage-buildinfo,oeqa/selftest/containerimage: Ensure image-buildinfo doesn't break...
Richard Purdie [Fri, 9 Nov 2018 11:24:47 +0000 (11:24 +0000)]
image-buildinfo,oeqa/selftest/containerimage: Ensure image-buildinfo doesn't break tests

Having image-buildinfo enabled causes containerimage.ContainerImageTests.test_expected_files
to fail due to the presence of an unexpected file:
  ['./',
   './etc/',
-  './etc/build',
   './etc/default/',
   './etc/default/postinst',

Tweak the class to allow it to be disabled and disable it from the test just in
case it was enabled.

(From OE-Core rev: af67bf422a4df5b7e07894512ff73a5f493682ab)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
6 years agooeqa/utils/metadata: Allow to function without the git module
Richard Purdie [Mon, 29 Oct 2018 13:46:52 +0000 (13:46 +0000)]
oeqa/utils/metadata: Allow to function without the git module

The python git module may or may not be enabled, allow this code to
function without it, falling back to the same method as metadata_scm.bbclass
uses. This will be cleaned up in the next round of feature development.

(From OE-Core rev: 6350586ba9f4a4107a2d457590824cd4d662d5b9)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
6 years agooeqa/selftest: Standardize json logging output directory
Yeoh Ee Peng [Wed, 7 Nov 2018 07:08:31 +0000 (15:08 +0800)]
oeqa/selftest: Standardize json logging output directory

Currently sdk & sdkext will output json file to LOG_DIR, while
selftest will output json file to TOPDIR/log.

Standardize selftest json output file to LOG_DIR.

Signed-off-by: Yeoh Ee Peng <ee.peng.yeoh@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
6 years agooeqa/selftest: Improvements to the json logging
Richard Purdie [Mon, 29 Oct 2018 13:49:02 +0000 (13:49 +0000)]
oeqa/selftest: Improvements to the json logging

Tweak the preceeding commit to:

* Add STARTTIME to the identifier to make it unique
* Use LOG_DIR
* Store the layer config in a more natural json format
* Drop '_' function prefixes

(From OE-Core rev: 173f59acf9722e2ef27fdd49c20f7d3d664917eb)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
6 years agotestsdk.bbclass: write testresult to json files
Yeoh Ee Peng [Tue, 23 Oct 2018 05:57:22 +0000 (13:57 +0800)]
testsdk.bbclass: write testresult to json files

As part of the solution to replace Testopia to store testresult,
OEQA sdk and sdkext need to output testresult into json files, where
these json testresult files will be stored into git repository
by the future test-case-management tools.

By default, json testresult file will be written to "oeqa"
directory under the "WORKDIR" directory.

To configure multiple instances of bitbake to write json testresult
to a single testresult file at custom directory, user will define
the variable "OEQA_JSON_RESULT_DIR" with the custom directory for
json testresult.

Signed-off-by: Yeoh Ee Peng <ee.peng.yeoh@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
6 years agotestimage.bbclass: write testresult to json files
Yeoh Ee Peng [Tue, 23 Oct 2018 05:57:21 +0000 (13:57 +0800)]
testimage.bbclass: write testresult to json files

As part of the solution to replace Testopia to store testresult,
OEQA testimage need to output testresult into json files, where
these json testresult files will be stored into git repository
by the future test-case-management tools.

By default, json testresult file will be written to "oeqa"
directory under the "WORKDIR" directory.

To configure multiple instances of bitbake to write json testresult
to a single testresult file at custom directory, user will define
the variable "OEQA_JSON_RESULT_DIR" with the custom directory for
json testresult.

Signed-off-by: Yeoh Ee Peng <ee.peng.yeoh@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
6 years agooeqa/selftest/context: write testresult to json files
Yeoh Ee Peng [Tue, 23 Oct 2018 05:57:20 +0000 (13:57 +0800)]
oeqa/selftest/context: write testresult to json files

As part of the solution to replace Testopia to store testresult,
OEQA selftest need to output testresult into json files, where
these json testresult files will be stored into git repository
by the future test-case-management tools.

By default, json testresult file will be written to "oeqa"
directory under the oe-selftest log directory.

To configure multiple instances of bitbake to write json testresult
to a single testresult file at custom directory, user will define
the variable "OEQA_JSON_RESULT_DIR" with the custom directory for
json testresult.

Signed-off-by: Yeoh Ee Peng <ee.peng.yeoh@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
6 years agooeqa/runner: Sort the test result output by result class
Richard Purdie [Tue, 13 Nov 2018 21:11:50 +0000 (21:11 +0000)]
oeqa/runner: Sort the test result output by result class

We want to see failures/errors listed last since this is the most easily
visible part of the log on consoles or autobuilder output and makes
human processing easier rather than having to scroll up and scan for
a single failure.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
6 years agooeqa/runner: Always show a summary of success/fail/error/skip counts
Richard Purdie [Tue, 13 Nov 2018 21:10:43 +0000 (21:10 +0000)]
oeqa/runner: Always show a summary of success/fail/error/skip counts

Its useful to have the counts of success/failure/error/skipped at the end of the
results to allow for easier human reading of what happened.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
6 years agooeqa/runtime/ptest: Inject results+logs into stored json results file
Richard Purdie [Fri, 2 Nov 2018 13:13:43 +0000 (13:13 +0000)]
oeqa/runtime/ptest: Inject results+logs into stored json results file

This allows the ptest results from ptest-runner, run in an image to be
transferred over to the resulting json results output.

Each test is given a pass/skip/fail so individual results can be monitored
and the raw log output from the ptest-runner is also dumped into the
results json file as this means after the fact debugging becomes much easier.

Currently the log output is not split up per test but that would make a good
future enhancement.

I attempted to implement this as python subTests however it failed as the
output was too confusing, subTests don't support any kind of log
output handling, subTest successes aren't logged and it was making things
far more complex than they needed to be.

We mark ptest-runner as "EXPECTEDFAILURE" since its unlikely every ptest
will pass currently and we don't want that to fail the whole image test run.
Its assumed there would be later analysis of the json output to determine
regressions. We do have to change the test runner code so that
'unexpectedsuccess' is not a failure.

Also, the test names are manipuated to remove spaces and brackets with
"_" used as a replacement and any duplicate occurrences truncated.

(From OE-Core rev: a13e088942e2a3c3521e98954a394e61a15234e8)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
6 years agooeqa/core/runner: write testresult to json files
Yeoh Ee Peng [Tue, 23 Oct 2018 05:57:19 +0000 (13:57 +0800)]
oeqa/core/runner: write testresult to json files

As part of the solution to replace Testopia to store testresult,
OEQA need to output testresult into single json file, where json
testresult file will be stored in git repository by the future
test-case-management tools.

The json testresult file will store more than one set of results,
where each set of results was uniquely identified by the result_id.
The result_id would be like "runtime-qemux86-core-image-sato", where
it was a runtime test with target machine equal to qemux86 and running
on core-image-sato image. The json testresult file will only store
the latest test content for a given result_id. The json testresult
file contains the configuration (eg. COMMIT, BRANCH, MACHINE, IMAGE),
result (eg. PASSED, FAILED, ERROR), test log, and result_id.

Based on the destination json testresult file directory provided,
it could have multiple instances of bitbake trying to write json
testresult to a single testresult file, using locking a lockfile
alongside the results file directory to prevent races.

Also the library class inside this patch will be reused by the future
test-case-management tools to write json testresult for manual test
case executed.

(From OE-Core rev: 00e03b5004f1eb6d59295544b3a8620504278f51)

Signed-off-by: Yeoh Ee Peng <ee.peng.yeoh@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
6 years agooeqa/core/runner: refactor for OEQA to write json testresult
Yeoh Ee Peng [Thu, 18 Oct 2018 09:11:05 +0000 (17:11 +0800)]
oeqa/core/runner: refactor for OEQA to write json testresult

Refactor the original _getDetailsNotPassed method to return
testresult details (test status and log), which will be reused
by future OEQA code to write json testresult.

Take the opportunity to consolidate and simplify the logic used
to gather test status and log within the TestResult instance.

(From OE-Core rev: 79ee7d1c371a86edeb61c99679985118da657e5d)

Signed-off-by: Yeoh Ee Peng <ee.peng.yeoh@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
6 years agooeqa: Remove xmlrunner
Richard Purdie [Fri, 13 Jul 2018 12:13:10 +0000 (13:13 +0100)]
oeqa: Remove xmlrunner

This isn't present on modern distros by default and doesn't work with
testtools, needing multiple code paths in the code. Remove it in favour
of finding a better replacement for results collection/analysis.

(From OE-Core rev: 8001d933a8dc86004db014777f094d718086687d)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
6 years agooeqa/runner: Simplify code
Richard Purdie [Wed, 11 Jul 2018 11:54:20 +0000 (11:54 +0000)]
oeqa/runner: Simplify code

There doesn't appear to be any reason we need this _results indirection
any more so remove it.

(From OE-Core rev: b618261811c48ff3b98eab1b340a8cd09ef183c6)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
6 years agooeqa/core/threaded: Remove in favour of using concurrenttests
Richard Purdie [Thu, 12 Jul 2018 11:10:38 +0000 (11:10 +0000)]
oeqa/core/threaded: Remove in favour of using concurrenttests

We have several options for parallel processing in oeqa, parallel
execution of modules, threading and mulitple processes for the runners.

After much experimentation is appears the most scalable and least
invasive approach is multiple processes using concurrenttestsuite
from testtools. This means we can drop the current threading code
which is only used by the sdk test execution.

oeqa/decorator/depends: Remove threading code

Revert "oeqa/sdk: Enable usage of OEQA thread mode"
This reverts commit adc434c0636b7dea2ef70c8d2c8e61cdb5c703b1.

Revert "oeqa/core/tests: Add tests of OEQA Threaded mode"
This reverts commit a4eef558c9933eb32413b61ff80a11b999951b40.

Revert "oeqa/core/decorator/oetimeout: Add support for OEQA threaded mode"
This reverts commit d3d4ba902dee8b19fa1054330cffdf73f9b81fe7.

(From OE-Core rev: a98ab5e560e73b6988512fbae5cefe9e42ceed53)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
6 years agooeqa/runner: Ensure we don't print misleading results output
Richard Purdie [Wed, 11 Jul 2018 11:46:01 +0000 (11:46 +0000)]
oeqa/runner: Ensure we don't print misleading results output

The current code assumes if something isn't a failure of some
kind, it was a pass. When test case IDs weren't matching, this lead
to very confusing output where things would fail, then be listed as
passing.

This adds code to track successes, ensuring we don't end up in this
position again with unmatched entries being listed as UNKNOWN.

(From OE-Core rev: 4374c296d8963e4f6a1aa7bef7983ad0a1c2fcff)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
6 years agooeqa/core/runner: Improve test case comparision
Richard Purdie [Wed, 11 Jul 2018 11:03:31 +0000 (11:03 +0000)]
oeqa/core/runner: Improve test case comparision

We can directly compare the test case IDs rather than representations,
then if we're using subunit to split the tests, the comparisions still
work as intended.

(From OE-Core rev: 72e5f46f75454ba4c445c65c1cbc616a9e72fc6e)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
6 years agooeqa/selftest/context: Improve log file handling
Richard Purdie [Thu, 29 Nov 2018 12:07:53 +0000 (12:07 +0000)]
oeqa/selftest/context: Improve log file handling

The existing logfile is simply placed in the current directory. Since the test
changes cwd to BUILDDIR, the symlink to the log can be placed in an invalid
directory. We also see trackbacks if the symlink is invalid.

Improve things by:

* Placing logs in LOG_DIR (or BUILDDIR if unset).
* Using a full path to the log meaning the log and link are placed in the same directory.
* Using lexists instead of exists so invalid symlinks are handled correctly.

(From OE-Core rev: 750ece11bed0e62a11e0003d1d16a81f7c219761)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
6 years agooeqa/utils/qemurunner.py: Fix python regex warnings
Richard Purdie [Wed, 14 Nov 2018 11:34:02 +0000 (11:34 +0000)]
oeqa/utils/qemurunner.py: Fix python regex warnings

Fix the warnings:

meta/lib/oeqa/utils/qemurunner.py:250: DeprecationWarning: invalid escape sequence \.
  ips = re.findall("((?:[0-9]{1,3}\.){3}[0-9]{1,3})", cmdline.split("ip=")[1])
meta/lib/oeqa/utils/qemurunner.py:343: DeprecationWarning: invalid escape sequence \-
  if re.search("root@[a-zA-Z0-9\-]+:~#", output):
poky/meta/lib/oeqa/utils/qemurunner.py:350: DeprecationWarning: invalid escape sequence \-
  if re.search("root@[a-zA-Z0-9\-]+:~#", output):
meta/lib/oeqa/utils/qemurunner.py:448: DeprecationWarning: invalid escape sequence \-
  if re.search("[a-zA-Z0-9]+@[a-zA-Z0-9\-]+:~#", data):

by correctly marking the regexs.

(From OE-Core rev: 8e6987735002560fca714f77ea8ece9d4b28f7fa)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
6 years agooeqa/selftest/context: Replace deprecated imp module usage
Richard Purdie [Wed, 14 Nov 2018 11:32:49 +0000 (11:32 +0000)]
oeqa/selftest/context: Replace deprecated imp module usage

Avoid the warning:

meta/lib/oeqa/selftest/context.py:8: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
  import imp

In this case importlib is a direct replacement.

(From OE-Core rev: db7a60c36a2d3eefc61ae6e1ede01680dc932035)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
6 years agooeqa/utils/commands: Avoid unclosed file warnings
Richard Purdie [Tue, 13 Nov 2018 22:43:25 +0000 (22:43 +0000)]
oeqa/utils/commands: Avoid unclosed file warnings

Avoid warnings such as:

meta/lib/oeqa/utils/commands.py:213: ResourceWarning: unclosed file <_io.BufferedReader name=4>
  return runCmd(cmd, ignore_status, timeout, output_log=output_log, **options)

(From OE-Core rev: 6a68c42de08cffbadb59ebda63fa5e19f6e5acef)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
6 years agooeqa/loader: Fix deprecation warning
Richard Purdie [Tue, 13 Nov 2018 21:16:54 +0000 (21:16 +0000)]
oeqa/loader: Fix deprecation warning

Clean up the warning:
meta/lib/oeqa/core/loader.py:27: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() or inspect.getfullargspec()
  _failed_test_args = inspect.getargspec(unittest.loader._make_failed_test).args

(From OE-Core rev: d2deb66830be2d44532fea3d5db763b57778252a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
6 years agooeqa/selftest/esdk: run selftest inside workdir not /tmp
Ross Burton [Mon, 3 Dec 2018 20:35:15 +0000 (20:35 +0000)]
oeqa/selftest/esdk: run selftest inside workdir not /tmp

We've seen issues with rootfs size calculations and we've seen systems
like opensuse which have btrfs mounted on /tmp causing selftest failures.

(From OE-Core rev: 61be3cd748d1b7321a1fc4cfe84efa9b26a6aee0)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>