]> code.ossystems Code Review - openembedded-core.git/log
openembedded-core.git
5 years agodropbear: set CVE_PRODUCT
Chen Qi [Wed, 6 Nov 2019 15:37:47 +0000 (17:37 +0200)]
dropbear: set CVE_PRODUCT

(From OE-Core rev: 3c247a4a166cabf7ddfea403cf272b3fb4e00872)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
5 years agonasm: add CVE_PRODUCT
Chen Qi [Wed, 6 Nov 2019 15:37:46 +0000 (17:37 +0200)]
nasm: add CVE_PRODUCT

(From OE-Core rev: e61c42ee49029ae8ffec58128dd083031305d9e5)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Conflicts:
meta/recipes-devtools/nasm/nasm_2.14.02.bb

5 years agoxserver-xorg: set CVE_PRODUCT
Chen Qi [Wed, 6 Nov 2019 15:37:45 +0000 (17:37 +0200)]
xserver-xorg: set CVE_PRODUCT

(From OE-Core rev: 8995f2c7d6f2f6f760811976af77e949d505a5d8)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
5 years agocve-check: failure to parse versions should be more visible
Ross Burton [Wed, 6 Nov 2019 15:37:44 +0000 (17:37 +0200)]
cve-check: failure to parse versions should be more visible

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
5 years agocve-check: ensure all known CVEs are in the report
Ross Burton [Wed, 6 Nov 2019 15:37:43 +0000 (17:37 +0200)]
cve-check: ensure all known CVEs are in the report

CVEs that are whitelisted or were not vulnerable when there are version
comparisons were not included in the report, so alter the logic to ensure that
all relevant CVEs are in the report for completeness.

(From OE-Core rev: 98256ff05fcfe9d5ccad360582c36eafb577c264)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
5 years agocve-update-db-native: fix https proxy issues
Chin Huat Ang [Wed, 6 Nov 2019 15:37:42 +0000 (17:37 +0200)]
cve-update-db-native: fix https proxy issues

When https_proxy is set, use proxy opener to open CVE metadata and
database URLs, otherwise fallback to the urllib.request.urlopen.

Also fix a minor issue where the json database which has been gzip
decompressed as byte object should be decoded as utf-8 string as
expected by update_db.

(From OE-Core rev: 95438d52b732bec217301fbfc2fb019bbc3707c8)

Signed-off-by: Chin Huat Ang <chin.huat.ang@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
5 years agocve-update-db-native: clean up JSON fetching
Ross Burton [Wed, 6 Nov 2019 15:37:41 +0000 (17:37 +0200)]
cve-update-db-native: clean up JSON fetching

Currently the code fetches the compressed JSON, writes it to a temporary file,
uncompresses that with gzip and passes the fake file object to update_db().

Instead, uncompress the gzip'd data in memory and pass the JSON directly to
update_db().

(From OE-Core rev: 9422745979256c442f533770203f62ec071c18fb)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
5 years agocve-update-db-native: improve metadata parsing
Ross Burton [Wed, 6 Nov 2019 15:37:40 +0000 (17:37 +0200)]
cve-update-db-native: improve metadata parsing

The metadata parser is fragile: first it coerces a bytes() to a str() (so the
string is b'LastModifiedDate:2019...'), assumes the first line is the date, and
then uses a regex to parse (which then includes the trailing quote as part of
the date).

Clean this up by parsing the bytes as UTF-8 (ASCII is probably fine, but this is
safer), iterate through the lines and split on colons to find the right
key/value pair.

(From OE-Core rev: bb4e53af33d6ca1e9346464adbdc1b39c47530f3)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
5 years agocve-update-db-native: use executemany() to optimise CPE insertion
Ross Burton [Wed, 6 Nov 2019 15:37:39 +0000 (17:37 +0200)]
cve-update-db-native: use executemany() to optimise CPE insertion

Instead of calling execute() repeatedly, rewrite the function to be a generator
and use executemany() for performance.

(From OE-Core rev: b309840b6aa3423b909a43499356e929c8761318)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
5 years agocve-update-db: actually inherit native
Ross Burton [Wed, 6 Nov 2019 15:37:38 +0000 (17:37 +0200)]
cve-update-db: actually inherit native

The recipe was called -native but didn't inherit native.

(From OE-Core rev: f0d822fad2a163d1ee32ed3b4c0359245140e19b)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
5 years agocve-update-db-native: use os.path.join instead of +
Ross Burton [Wed, 6 Nov 2019 15:37:37 +0000 (17:37 +0200)]
cve-update-db-native: use os.path.join instead of +

(From OE-Core rev: 4b301030cf9cf7a981dcff85a50e915c045e3130)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
5 years agocve-update-db-native: Remove hash column from database.
Pierre Le Magourou [Wed, 6 Nov 2019 15:37:36 +0000 (17:37 +0200)]
cve-update-db-native: Remove hash column from database.

djb2 hash algorithm was found to do collisions, so the database was
sometime missing data. Remove this hash mechanism, clear and populate
elements from scratch in PRODUCTS table if the current year needs an
update.

(From OE-Core rev: 78de2cb39d74b030cd4ec811bf6f9a6daa003d19)

Signed-off-by: Pierre Le Magourou <pierre.lemagourou@softbankrobotics.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
5 years agocve-update-db: Use NVD CPE data to populate PRODUCTS table
Pierre Le Magourou [Wed, 6 Nov 2019 15:37:35 +0000 (17:37 +0200)]
cve-update-db: Use NVD CPE data to populate PRODUCTS table

Instead of using expanded list of affected versions that is not
reliable, use the 'cpe_match' node in the 'configurations' json node.

For cve-check to correctly match affected CVE, the sqlite database need to
contain operator_start, operator_end and the corresponding versions fields.

(From OE-Core rev: f7676e9a38d595564922e5f59acbc69c2109a78f)

Signed-off-by: Pierre Le Magourou <pierre.lemagourou@softbankrobotics.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
5 years agocve-update-db-native: use SQL placeholders instead of format strings
Ross Burton [Wed, 6 Nov 2019 15:37:34 +0000 (17:37 +0200)]
cve-update-db-native: use SQL placeholders instead of format strings

(From OE-Core rev: 91770338f76ef35f3c4eeac216eb9d2b3188e575)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
5 years agocve-check: Replace CVE_CHECK_CVE_WHITELIST by CVE_CHECK_WHITELIST
Pierre Le Magourou [Wed, 6 Nov 2019 15:37:33 +0000 (17:37 +0200)]
cve-check: Replace CVE_CHECK_CVE_WHITELIST by CVE_CHECK_WHITELIST

CVE_CHECK_WHITELIST does not contain version anymore, as it was not
used. This variable should be set per recipe.

(From OE-Core rev: 7069302a4ccbb5b72e1902f284cf078516fd7294)

Signed-off-by: Pierre Le Magourou <pierre.lemagourou@softbankrobotics.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
5 years agocve-check: allow comparison of Vendor as well as Product
Ross Burton [Wed, 6 Nov 2019 15:37:32 +0000 (17:37 +0200)]
cve-check: allow comparison of Vendor as well as Product

Some product names are too vague to be searched without also matching the
vendor, for example Flex could be the parser compiler we ship, or Adobe Flex, or
Apache Flex, or IBM Flex.

If entries in CVE_PRODUCT contain a colon then split it as vendor:product to improve the search.

Also don't use .format() to construct SQL as that can lead to security
issues. Instead, use ? placeholders and lets sqlite3 handle the escaping.

(From OE-Core rev: e6bf90009877d00243417898700d2320fd87b39c)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
5 years agocve-check.bbclass: initialize to_append
Mikko Rapeli [Wed, 6 Nov 2019 15:37:31 +0000 (17:37 +0200)]
cve-check.bbclass: initialize to_append

Fixes build failure with core-image-minimal:

Exception: UnboundLocalError: local variable 'to_append' referenced before assignment

(From OE-Core rev: 270ac00cb43d0614dfe1c95f960c76e9e5fa20d4)

Signed-off-by: Mikko Rapeli <mikko.rapeli@bmw.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
5 years agoglibc: exclude child recipes from CVE scanning
Ross Burton [Wed, 6 Nov 2019 15:37:30 +0000 (17:37 +0200)]
glibc: exclude child recipes from CVE scanning

As glibc will be scanned for CVEs, we don't need to scan glibc-locale,
glibc-mtrace, and glibc-scripts which are all separate recipes for technical
reasons.

Exclude the recipes by setting CVE_PRODUCT in the recipe, instead of using the
global whitelist.

(From OE-Core rev: 1f9a963b9ff7ebe052ba54b9fcbdf7d09478dd17)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
5 years agocve-check-tool: remove
Ross Burton [Wed, 6 Nov 2019 15:37:29 +0000 (17:37 +0200)]
cve-check-tool: remove

(From OE-Core rev: 5388ed6d1378d647a65912dbd537f9ef3cb5760a)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
5 years agocve-check: remove redundant readline CVE whitelisting
Ross Burton [Wed, 6 Nov 2019 15:37:28 +0000 (17:37 +0200)]
cve-check: remove redundant readline CVE whitelisting

CVE-2014-2524 is a readline CVE that was fixed in 6.3patch3 onwards, but the
tooling wasn't able to detect this version.  As we now ship readline 8 we don't
need to manually whitelist it, and if we did then the whitelisting should be in
the readline recipe.

(From OE-Core rev: 07bb8b25e172aa5c8ae96b6e8eb4ac901b835219)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
5 years agocve-check: Update unpatched CVE matching
Pierre Le Magourou [Wed, 6 Nov 2019 15:37:27 +0000 (17:37 +0200)]
cve-check: Update unpatched CVE matching

Now that cve-update-db added CPE information to NVD database. We can
check for unpatched versions with operators '<', '<=', '>', and '>='.

(From OE-Core rev: bc0195be1b15bcffe60127bc5e8b7011a853c2ed)

Signed-off-by: Pierre Le Magourou <pierre.lemagourou@softbankrobotics.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
5 years agocve-check: Depends on cve-update-db-native
Pierre Le Magourou [Wed, 6 Nov 2019 15:37:26 +0000 (17:37 +0200)]
cve-check: Depends on cve-update-db-native

do_populate_cve_db is a native task.

(From OE-Core rev: 4078da92b49946848cddebe1735f301af161e162)

Signed-off-by: Pierre Le Magourou <pierre.lemagourou@softbankrobotics.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Conflicts:
meta/conf/distro/include/maintainers.inc

5 years agocve-update-db: Catch request.urlopen errors.
Pierre Le Magourou [Wed, 6 Nov 2019 15:37:25 +0000 (17:37 +0200)]
cve-update-db: Catch request.urlopen errors.

If the NVD url is not accessible, print a warning on top of the CVE
report, and continue. The database will not be fully updated, but
cve_check can still run on the previous database.

(From OE-Core rev: 0325dd72714f0b447558084f481b77f0ec850eed)

Signed-off-by: Pierre Le Magourou <pierre.lemagourou@softbankrobotics.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
5 years agocve-update-db: do_populate_cve_db depends on do_fetch
Pierre Le Magourou [Wed, 6 Nov 2019 15:37:24 +0000 (17:37 +0200)]
cve-update-db: do_populate_cve_db depends on do_fetch

To be able to populate NVD database on a fetchall
(bitbake <image> --run-all=fetch), set the do_populate_cve_db task to be
executed before do_fetch.

Do not get CVE_CHECK_DB_DIR, CVE_CHECK_DB_FILE and CVE_CHECK_TMP_FILE
variable because do_populate_cve_db can be called in a context where
cve-check class is not loaded.

(From OE-Core rev: 975793e3825a2a9ca6dc0e43577f680214cb7993)

Signed-off-by: Pierre Le Magourou <pierre.lemagourou@softbankrobotics.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
5 years agocve-update-db: Manage proxy if needed.
Pierre Le Magourou [Wed, 6 Nov 2019 15:37:23 +0000 (17:37 +0200)]
cve-update-db: Manage proxy if needed.

If https_proxy environment variable is defined, manage proxy to be able
to download meta and json data feeds from https://nvd.nist.gov

(From OE-Core rev: 09be21f4d1793b1e26e78391f51bfc0a27b76deb)

Signed-off-by: Pierre Le Magourou <pierre.lemagourou@softbankrobotics.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
5 years agocve-check: be idiomatic
Ross Burton [Wed, 6 Nov 2019 15:37:22 +0000 (17:37 +0200)]
cve-check: be idiomatic

Instead of generating a series of indexes via range(len(list)), just iterate the
list.

(From OE-Core rev: 27eb839ee651c2d584db42d23bcf5dd764eb33f1)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
5 years agocve-update-db: Use std library instead of urllib3
Pierre Le Magourou [Wed, 6 Nov 2019 15:37:21 +0000 (17:37 +0200)]
cve-update-db: Use std library instead of urllib3

urllib3 was used in this recipe but it was not set as a
dependency. As it is not specifically needed, rewrite the recipe with
urllib from the standard library.

(From OE-Core rev: c0eabd30d7b9c2517f4ec9229640be421ecc8a5e)

Signed-off-by: Pierre Le Magourou <pierre.lemagourou@softbankrobotics.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
5 years agoflac: also add flac to CVE_PRODUCT
Chen Qi [Wed, 6 Nov 2019 15:37:20 +0000 (17:37 +0200)]
flac: also add flac to CVE_PRODUCT

flac uses both 'flac' and 'libflac' as cve product.

(From OE-Core rev: 3a043a078f6cc89bcc097823fa37cd1311805ae7)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
5 years agocve-check: Consider CVE that affects versions with less than operator
Pierre Le Magourou [Wed, 6 Nov 2019 15:37:19 +0000 (17:37 +0200)]
cve-check: Consider CVE that affects versions with less than operator

In the NVD json CVE feed, affected versions can be strictly matched to a
version, but they can also be matched with the operator '<='.

Add a new condition in the sqlite query to match affected versions that
are defined with the operator '<='. Then use LooseVersion to discard all
versions that are not relevant.

(From OE-Core rev: 3bf63bc60848d91e90c23f6d854d22b78832aa2d)

Signed-off-by: Pierre Le Magourou <pierre.lemagourou@softbankrobotics.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
5 years agocve-check: Manage CVE_PRODUCT with more than one name
Pierre Le Magourou [Wed, 6 Nov 2019 15:37:18 +0000 (17:37 +0200)]
cve-check: Manage CVE_PRODUCT with more than one name

In some rare cases (eg. curl recipe) the CVE_PRODUCT contains more than
one name.

(From OE-Core rev: 7f62a20b32a3d42f04ec58786a7d0db68ef1bb05)

Signed-off-by: Pierre Le Magourou <pierre.lemagourou@softbankrobotics.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
5 years agocve-check: Remove dependency to cve-check-tool-native
Pierre Le Magourou [Wed, 6 Nov 2019 15:37:17 +0000 (17:37 +0200)]
cve-check: Remove dependency to cve-check-tool-native

Use the new update-cve-db recipe to update database.

(From OE-Core rev: bc144b028f6f51252f4359248f6921028bcb6780)

Signed-off-by: Pierre Le Magourou <pierre.lemagourou@softbankrobotics.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
5 years agocve-update-db: New recipe to update CVE database
Pierre Le Magourou [Wed, 6 Nov 2019 15:37:16 +0000 (17:37 +0200)]
cve-update-db: New recipe to update CVE database

cve-check-tool-native do_populate_cve_db task was using deprecated NVD
xml data feeds, cve-update-db uses NVD json data feeds.

Sqlite database schema was updated to take into account CVSSv3 CVE
scores and operator in affected product versions.
A new META table was added to store the last modification date of the
NVD json data feeds.

(From OE-Core rev: 546d14135c50c6a571dfbf3baf6e9b22ce3d58e0)

Signed-off-by: Pierre Le Magourou <pierre.lemagourou@softbankrobotics.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Conflicts:
meta/conf/distro/include/maintainers.inc

5 years agouninative: Switch from bz2 to xz
Richard Purdie [Wed, 29 May 2019 07:40:09 +0000 (08:40 +0100)]
uninative: Switch from bz2 to xz

(From OE-Core rev: 29fc9210b973be68de474e75068e4c72371afe5a)

(From OE-Core rev: b6645596f2d2faf8f1fdfbedfe1edd004fbce6bc)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
5 years agoyocto-uninative: Update to 2.5 release
Richard Purdie [Wed, 29 May 2019 14:40:02 +0000 (15:40 +0100)]
yocto-uninative: Update to 2.5 release

This includes libstdc++ changes from gcc 9.X.

It also switches uninative from bz2 to xz compression.

(From OE-Core rev: 7ed16ec033366aea175ac4ecf7cd82656c4141bb)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
6 years agodevtool: Split tests into multiple classes sumo
Richard Purdie [Fri, 13 Jul 2018 21:59:22 +0000 (21:59 +0000)]
devtool: Split tests into multiple classes

This allows better parallelism between the different tests as currently
this block takes the longest time to execute. devtool tests are still
all grouped into the "devtool" module for ease of exection.

This also makes it easier to execute some subset of devtool tests for
testing devtool changes.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
6 years agooeqa: Default to buffer mode for tests
Richard Purdie [Sat, 14 Jul 2018 14:50:48 +0000 (14:50 +0000)]
oeqa: Default to buffer mode for tests

Currently some tests run in buffer mode and some don't. Those that don't can
corrupt stdout/stderr. Switch to using buffer mode everywhere so we're consistent.

If there is useful output on stdout/stderr, it will be displayed if the test
fails.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
6 years agooeqa/selftest/devtool: Ensure dbus is built befoe running test
Richard Purdie [Fri, 13 Jul 2018 22:16:28 +0000 (22:16 +0000)]
oeqa/selftest/devtool: Ensure dbus is built befoe running test

If dbus isn't build first the dbus dependency of dbus-wait can't be detected
through pkgconfig and the test fails:

AssertionError: {'DEPENDS': {'dbus'}} != {}
- {'DEPENDS': {'dbus'}}
+ {} : Some expected variables not found in recipe: {'DEPENDS': {'dbus'}}

Ensure dbus is built and present in the sysroot.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
6 years agologging: use warning instead warn
Chen Qi [Thu, 19 Jul 2018 05:47:18 +0000 (13:47 +0800)]
logging: use warning instead warn

The warn method is deprecated. We should use the documented warning instead.

Quoting from the python's official doc:
"""
Note: There is an obsolete method warn which is functionally identical to warning.
      As warn is deprecated, please do not use it - use warning instead.
"""

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
6 years agolib/oe: Fix collections ABCs DeprecationWarning in Python 3.7+
Khem Raj [Wed, 8 Aug 2018 22:49:13 +0000 (15:49 -0700)]
lib/oe: Fix collections ABCs DeprecationWarning in Python 3.7+

- Prefer collections.abc (new in Python 3.3) over collections for abstract base classes

- In Python 3.8, the abstract base classes in collections.abc will no longer be exposed in
  the regular collections module. This will help create a clearer distinction between
  the concrete classes and the abstract base classes."

- https://docs.python.org/3.7/whatsnew/3.7.html#deprecated

- see https://github.com/python/cpython/commit/c66f9f8d3909f588c251957d499599a1680e2320

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
6 years agowic: use explicit errno import
Ross Burton [Mon, 5 Nov 2018 11:23:03 +0000 (11:23 +0000)]
wic: use explicit errno import

os.errno doesn't work in Python 3.7 and shouldn't have ever worked, so use
import errno explicitly.

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster@mvista.com>
6 years agowic/engine: Fix missing parted autobuilder failures
Richard Purdie [Fri, 15 Feb 2019 07:57:25 +0000 (07:57 +0000)]
wic/engine: Fix missing parted autobuilder failures

OE-Core rev: a88bcbae850a2e6d182291d3f8e167aabdbe4842 broke the ability
to find parted as it may be in sbin which is not in PATH for some users
on some distros.

Iterate on the original patch to fix this and also fix the original problem.

(From OE-Core rev: af3803e5189d7814f9dbd238fb6dab200f351e1a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
6 years agowic/engine.py: Load paths from PATH environment variable
William Bourque [Mon, 11 Feb 2019 20:00:48 +0000 (15:00 -0500)]
wic/engine.py: Load paths from PATH environment variable

Load self.paths from environment variable and
if it fails, fall back to hardcoded list.
This is required for users that would need to load
different e2fsprogs binaries if their system's ones
are not recent enought

(From OE-Core rev: a88bcbae850a2e6d182291d3f8e167aabdbe4842)

Signed-off-by: William Bourque <wbourque@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
6 years agoscripts/lib/wic/engine: Fix cp's target path for ext* filesystems
Leonardo Augusto [Fri, 8 Feb 2019 16:35:12 +0000 (08:35 -0800)]
scripts/lib/wic/engine: Fix cp's target path for ext* filesystems

Python subprocess' shell=True defaults to /bin/sh[1][2], which
often refers to a POSIX-compliant shell. As the -e flag is
not defined in the POSIX standard[3], some shells may
interpret "-e" as the first argument to the echo command,
causing the rest of the command line to fail.

In this particular case, "echo -e 'cd {}'" is interpreted
as "-e cd {}", which causes the first line of the command
to fail, and causing cp to always place the source file
in the filesystem's root.

Replacing "echo -e" for a printf command makes this
more portable.

This issue only affects "wic cp" for ext* filesystems.

[1] https://docs.python.org/2/library/subprocess.html
[2] https://docs.python.org/3/library/subprocess.html
[3] http://pubs.opengroup.org/onlinepubs/9699919799

(From OE-Core rev: 9a5b703d4e60c3ccdf80b5289b8e6fc91133fcde)

Signed-off-by: Leonardo Augusto <leobsd@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
6 years agowic: search nonarch STAGING_DATADIR for multilib
Kai Kang [Tue, 16 Oct 2018 08:29:14 +0000 (16:29 +0800)]
wic: search nonarch STAGING_DATADIR for multilib

It fails to build multilib image such as lib32-core-image-minimal with
wic by set 'IMAGE_FSTYPES = "wic"':

| ERROR: Couldn't find correct bootimg_dir, exiting

When multilib is enabled, STAGING_DATADIR is expanded with MLPREFIX. But
dependencies of images such as syslinux is still populated to nonarch
STAGING_DATADIR.

Search nonarch STAGING_DATADIR to fix the error.

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 agowic: make engine.py:get_partitions() resilient to parted/dmidecode stderr output
Geoff Parker [Thu, 11 Oct 2018 16:31:26 +0000 (09:31 -0700)]
wic: make engine.py:get_partitions() resilient to parted/dmidecode stderr output

Running wic commands on Debian 10 systems fail in
scripts/lib/wic/engine.py:get_partitions() due to new stderr output captured
when trying to parse the output from /sbin/parted as a non-root user.

The parted command calls the dmidecode utility, which produces this error
as a non-root user:
    /sys/firmware/dmi/tables/smbios_entry_point: Permission denied
    /dev/mem: Permission denied

scripts/lib/wic/engine.py:get_partitions() calls misc.py:exec_cmd(),
a subprocess wrapper which returns a combined stderr and sdtdout.
These messages to stderr confuse the partition table parser in
get_partitions().

This patch has the partition table parser ignore lines before the expected
"BYT;" header string.

Running wic in Debian 9 does not have this issue.

Signed-off-by: Geoff Parker <geoffhp@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
6 years agoscripts/wic: Be consistent about how we call bitbake
Richard Purdie [Thu, 28 Feb 2019 12:24:49 +0000 (12:24 +0000)]
scripts/wic: Be consistent about how we call bitbake

Whilst its tempting to call bitbake_main(), the script also directly executes
bitbake. By doing both this creates all kinds of races. Therefore
change to use subprocess execution in all cases.

(From OE-Core rev: 0507ec4c6069490c9a503e9e2b65f0e7b1962d34)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
6 years agowic: Support for changing the imager.
Davis, Michael [Mon, 8 Oct 2018 19:55:22 +0000 (19:55 +0000)]
wic: Support for changing the imager.

Signed-off-by: Michael Davis <michael.davis@essvote.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 agopkgdata.py: avoid target-sdk-dummy-provides to mess things up
Chen Qi [Wed, 30 Jan 2019 02:56:24 +0000 (10:56 +0800)]
pkgdata.py: avoid target-sdk-dummy-provides to mess things up

Sometimes we meet the following failure for the test_lookup_recipe
test case.

  AssertionError: 'zlib\nbusybox is in the RPROVIDES of target-sdk-provid[32 chars]ummy' != 'zlib\nbusybox'
    zlib
  + busybox- busybox is in the RPROVIDES of target-sdk-provides-dummy:
  - target-sdk-provides-dummy

This is because target-sdk-provides-dummy rprovides busybox.

So clean things up to avoid failure.

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 agoresulttool/manualexecution: Refactor and simplify codebase
Yeoh Ee Peng [Thu, 4 Apr 2019 08:48:38 +0000 (16:48 +0800)]
resulttool/manualexecution: Refactor and simplify codebase

Simplify and removed unnecessary codes.
Refactor to allow pythonic loop.

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 agoresulttool/manualexecution: Fixed step sorted by integer
Yeoh Ee Peng [Thu, 4 Apr 2019 08:48:37 +0000 (16:48 +0800)]
resulttool/manualexecution: Fixed step sorted by integer

Currently the manual execution display step by sorting
the step as string, where steps were not being sorted
correctly when there are more than 9 steps.

Fixed the step sorting by sorting step as integer.

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 agoresulttool/manualexecution: Enable display full steps without press enter
Yeoh Ee Peng [Thu, 4 Apr 2019 08:48:36 +0000 (16:48 +0800)]
resulttool/manualexecution: Enable display full steps without press enter

Current manualexecution required pressing enter button to show each step
information, where this was wasting execution time. Enable display
full steps without needing to any press enter button.

Signed-off-by: Mazliana <mazliana.mohamad@intel.com>
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 agoresulttool/manualexecution: Standardize input check
Yeoh Ee Peng [Thu, 4 Apr 2019 08:48:35 +0000 (16:48 +0800)]
resulttool/manualexecution: Standardize input check

Current input checking does not match the standard input practiced
by QA team. Change the input checking to match the standard
input practiced by the QA team.

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 agoresulttool: Allow extraction of ptest data
Richard Purdie [Sat, 2 Mar 2019 16:34:16 +0000 (16:34 +0000)]
resulttool: Allow extraction of ptest data

Rather than simply discarding the ptest data, change the code to discard
it when writing out the new testresult files, or optionally either preserve
it, or write it as seperate discrete logs.

This means the autobuilder should start writing out individual ptest log
files as well as allowing ueers to extract these manually.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
6 years agoresulttool: Allow store to work on single files
Richard Purdie [Tue, 2 Apr 2019 22:51:02 +0000 (23:51 +0100)]
resulttool: Allow store to work on single files

Store operations using a single file as a source weren't working as the os.walk
command didn't like being given a single file. Fix the store operation to
work for single files.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
6 years agoresulttool: Enable report for single result file
Yeoh Ee Peng [Tue, 2 Apr 2019 06:38:03 +0000 (14:38 +0800)]
resulttool: Enable report for single result file

Current validation check function inside resulttool disallow the
report for single result file although the underlying library
was able to handle both directory and file as source input to report.
Removed the validation check as it was no longer needed and to
enable report for single result file.

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/manual/toaster: updated test id naming
Yeoh Ee Peng [Tue, 19 Mar 2019 01:53:53 +0000 (09:53 +0800)]
oeqa/manual/toaster: updated test id naming

All test id (eg. @alias) inside manual testcase file shall follow the same
test id naming convention from oeqa automated tests (eg. selftest,
runtime, sdk, etc), where the test id consists of
<test_module>.<test_suite>.<test_function>. Furthermore, there shall be
only 1 unique test_module per each manual testcases file, where
test_module match the file name itself.

This file was using test_module name that does not match the file name
itself. Fixed test_module name as well as the test_suite name.

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/manual/toaster: transfer manual toaster test cases to oeqa
Yeoh Ee Peng [Fri, 28 Dec 2018 06:54:44 +0000 (14:54 +0800)]
oeqa/manual/toaster: transfer manual toaster test cases to oeqa

As part of the solution to replace Testopia, manual test cases
need to be migrated to OEQA. These manual test case json files
will serve two use cases.

Use case#1: as input to the future commandline-based manual test
runner script, where this script will display actions and expected
result information in user friendly text, then it will capture
user input for test result and log, finally it will write test
result and log into existing standardize test result json format
from OEQA framework for automated tests.

Use case#2: QA will open and read these json file manually for
planning manual test execution. Any reader interested in
understanding manual test cases will open and read these files.

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/manual/kernel-dev.json: test id updated
sangeeta jain [Thu, 14 Mar 2019 05:14:18 +0000 (13:14 +0800)]
oeqa/manual/kernel-dev.json: test id updated

All test id (eg. @alias) inside manual testcase file shall follow the same test id
naming convention from oeqa automated tests (eg. selftest, runtime, sdk, etc), where
the test id consists of  <test_module>.<test_suite>.<test_function>. Furthermore,
there shall be only 1 unique test_module per each manual testcases file.

This file was using more than 1 unique test_module for testcases. Furthermore,
some of the testcases were defined using different test_suite where it was not needed.
This patch fix the manual testcases file to have only 1 unique test_module
as well as test_suite to simplify test id naming.

Signed-off-by: sangeeta jain <sangeeta.jain@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
6 years agooeqa/manual/compliance-test.json: test id updated and missing test cases added
sangeeta jain [Thu, 14 Mar 2019 04:31:17 +0000 (12:31 +0800)]
oeqa/manual/compliance-test.json: test id updated and missing test cases added

Two changes made in oeqa/manual/compliance-test.json:

1. All test id (eg. @alias) inside manual testcase file shall follow the same test id
naming convention from oeqa automated tests (eg. selftest, runtime, sdk, etc), where
the test id consists of  <test_module>.<test_suite>.<test_function>. Furthermore,
there shall be only 1 unique test_module per each manual testcases file.

This file was using more than 1 unique test_module for testcases. Furthermore, some of
the testcases were defined using different test_suite where it was not needed. This patch
fix the manual testcases file to have only 1 unique test_module as well as test_suite to
simplify test id naming.

2. Added 2 missing test cases for Beaglebone Stress Test.

Signed-off-by: sangeeta jain <sangeeta.jain@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
6 years agooeqa/manual/bsp-hw.json: test id updated and obsolete test cases removed
sangeeta jain [Thu, 14 Mar 2019 02:55:23 +0000 (10:55 +0800)]
oeqa/manual/bsp-hw.json: test id updated and obsolete test cases removed

Two changes made in oeqa/manual/bsp-hw.json:

1. All test id (eg. @alias) inside manual testcase file shall follow the same test id naming
convention from oeqa automated tests (eg. selftest, runtime, sdk, etc), where the
test id consists of  <test_module>.<test_suite>.<test_function>. Furthermore,
there shall be only 1 unique test_module per each manual testcases file.

This file was using more than 1 unique test_module for testcases.
Furthermore, some of the testcases were defined using different test_suite where it was not
needed. This patch fix the manual testcases file to have only 1 unique
test_module as well as test_suite to simplify test id naming.

2. As per review by Intel and Windriver team, 7 testcases were found obsolete. Removed 7 testcases.

Signed-off-by: sangeeta jain <sangeeta.jain@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
6 years agooeqa/manual/bsp-hw.json: add non-IA tests
Mazliana [Fri, 15 Feb 2019 08:29:27 +0000 (16:29 +0800)]
oeqa/manual/bsp-hw.json: add non-IA tests

QA team found that 10 manual bsp test cases from Testopia for
Beaglebone, EdgeRouter, and MPC need to be up streamed

[YOCTO #12650]

Signed-off-by: Mazliana <mazliana.mohamad@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
6 years agooeqa/manual/sdk.json: Updated toolchain tarball to core-image-sato
sangeeta jain [Mon, 28 Jan 2019 08:11:15 +0000 (16:11 +0800)]
oeqa/manual/sdk.json: Updated toolchain tarball to core-image-sato

Manual test step for SDK is updated. Previously toolchain was "poky-glibc-x86_64-core-image-sato-sdk<type-arch>-toolchain-<release-version>.sh"
But toochain for core-image-sato-sdk is not available in releases after 2.1, hence changed it to "poky-glibc-x86_64-core-image-sato-<type-arch>-toolchain-<release-version>.sh

Other less significant update is to add exepcted result in intermediate test steps.

Signed-off-by: sangeeta jain <sangeeta.jain@intel.com>
"poky-glibc-x86_64-core-image-sato-<type-arch>-toolchain-<release-version>.sh"

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
6 years agooeqa/manual: Add manual runtime 'compliance' testcases to json
Sudhir Sharma [Mon, 28 Jan 2019 07:33:28 +0000 (15:33 +0800)]
oeqa/manual: Add manual runtime 'compliance' testcases to json

Added json file for compliance test cases to the manual runtime tests

Signed-off-by: Sudhir Sharma <sudhirx.sharma@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
6 years agooeqa/manual/bsp-qemu.json: Update for QEMU_USE_KVM
Robert Yang [Fri, 4 Jan 2019 07:15:44 +0000 (15:15 +0800)]
oeqa/manual/bsp-qemu.json: Update for QEMU_USE_KVM

Now QEMU_USE_KVM can only be boolean, can not contain MACHINE any more.

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/manual/build-appliance: Drop test which is already automated
Richard Purdie [Fri, 2 Nov 2018 15:57:08 +0000 (15:57 +0000)]
oeqa/manual/build-appliance: Drop test which is already automated

The nightly-build-appliance target already tests this particular build.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
6 years agooeqa/manual: Remove bitbake-selftest execution
Richard Purdie [Thu, 11 Oct 2018 19:19:28 +0000 (20:19 +0100)]
oeqa/manual: Remove bitbake-selftest execution

The autobuilder runs bitbake-selftest already so we don't need
to execute this manually.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
6 years agooeqa/manual: transfer manual test cases from testopia to oeqa
Yeoh Ee Peng [Thu, 11 Oct 2018 09:39:01 +0000 (17:39 +0800)]
oeqa/manual: transfer manual test cases from testopia to oeqa

As part of the solution to replace Testopia, manual test cases
need to be migrated to OEQA. These manual test case json files
will serve two use cases.

Use case#1: as input to the future commandline-based manual test
runner script, where this script will display actions and expected
result information in user friendly text, then it will capture
user input for test result and log, finally it will write test
result and log into existing standardize test result json format
from OEQA framework for automated tests.

Use case#2: QA will open and read these json file manually for
planning manual test execution. Any reader interested in
understanding manual test cases will open and read these files.

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 agobuild-appliance-image: Update to sumo head revision
Richard Purdie [Wed, 27 Mar 2019 23:21:58 +0000 (23:21 +0000)]
build-appliance-image: Update to sumo head revision

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
6 years agooeqa/utils/gitarchive: Handle case where parent is only on origin
Richard Purdie [Mon, 25 Feb 2019 09:26:42 +0000 (09:26 +0000)]
oeqa/utils/gitarchive: Handle case where parent is only on origin

The parent code currently assumed that any parent branch is locally
checked out which may not be the case.

Use the local branch by default but fall back to the origin. This
also means removing the later saftey check as the branch may not exist
locally.

This fixes the autobuilder resulttool test pushing code.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
6 years agobuild-appliance-image: Update to sumo head revision
Richard Purdie [Tue, 26 Mar 2019 15:54:16 +0000 (15:54 +0000)]
build-appliance-image: Update to sumo head revision

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
6 years agoyocto-uninative: Update to 2.4
Richard Purdie [Mon, 25 Mar 2019 23:50:11 +0000 (16:50 -0700)]
yocto-uninative: Update to 2.4

This supports glibc 2.29 which is appearing in distros like Ubuntu 19.04

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
[Fixed up for Sumo context; no aarch64]
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
6 years agooe-build-perf-report/gitarchive: Move common useful functions to library
Richard Purdie [Wed, 20 Feb 2019 17:07:56 +0000 (17:07 +0000)]
oe-build-perf-report/gitarchive: Move common useful functions to library

These functions can be reused by the resulttool code so move to the common
function library for this purpose.

(From OE-Core rev: c66f848938c04e133259c5b6903dc592866ab385)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
6 years agoscripts/oe-git-archive: Separate out functionality to library function
Richard Purdie [Sun, 17 Feb 2019 22:12:40 +0000 (22:12 +0000)]
scripts/oe-git-archive: Separate out functionality to library function

This turns the core of the script into a library function. Ultimately this
will let us call that code with custom 'keywords' rather than relying
on the data parsed from bitbake metadata which can't be used when archiving
historical results.

(From OE-Core rev: 4820ca2b0850e29b04a4fd5659a6e9837d6714d0)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
6 years agooe-build-perf-report: Fix missing buildstats comparisions
Richard Purdie [Mon, 11 Feb 2019 17:45:25 +0000 (17:45 +0000)]
oe-build-perf-report: Fix missing buildstats comparisions

Integers were being compared to strings leading to missing buildstats comparision
data. Fix this.

(From OE-Core rev: 2dbbf598192ae2b3aa488df042f56aa6c6634a00)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
6 years agooe-build-perf-report: Improve branch comparision handling
Richard Purdie [Sat, 9 Feb 2019 17:18:20 +0000 (17:18 +0000)]
oe-build-perf-report: Improve branch comparision handling

When comparing branches, correctly filter the revisions corresponding
to the specific branch specified.

Also use the commit numbers as a way to gauge spatially related commits
for comparision meaning comparisions for out of order build revisions
becomes meaninful.

This should improve the reporting for autobuilder generated builds.

Also improve the branch option help text.

(From OE-Core rev: 9f6f4ab6eec9dca07af7f53da5f737a6167bfb38)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
6 years agooe-build-perf-report: Allow commits from different branches
Richard Purdie [Fri, 8 Feb 2019 13:38:22 +0000 (13:38 +0000)]
oe-build-perf-report: Allow commits from different branches

The code won't currently allow comparisions of two commits on different
branches even if the commits are specified by their hashes.

This updates the code to search two branches for any relavent commits,
hence allowing comparisions to be made. A particularly useful case is
master vs. master-next for example.

(From OE-Core rev: 2d835bb1570c515ae501442f3ce19fae8e249b27)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
6 years agooe-build-perf-report: Allow branch without hostname
Richard Purdie [Fri, 8 Feb 2019 13:37:06 +0000 (13:37 +0000)]
oe-build-perf-report: Allow branch without hostname

Allow the branch to be set without the hostname option. Previously
if hostname wasn't set, branch would be overwritten regardless of
whether it was set or not.

(From OE-Core rev: 3ec43bf4c6c8f7730a67f63ad4e14903f289014e)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
6 years agoresulttool/manualexecution: To output right test case id
Mazliana [Mon, 11 Mar 2019 08:30:33 +0000 (16:30 +0800)]
resulttool/manualexecution: To output right test case id

We found that manualexecution does not capture test suite values
correctly if there are more than one test suite in test cases.
After verification has made we found out we should retrieved
full test cases value <test_module.test_suite.test_case> from
oeqa/manual/ json file rather than split it them into new
variables test_suite and test_cases.

Signed-off-by: Mazliana <mazliana.mohamad@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
6 years agoresulttool/report: Enable roll-up report for a commit
Yeoh Ee Peng [Tue, 12 Mar 2019 05:05:28 +0000 (13:05 +0800)]
resulttool/report: Enable roll-up report for a commit

Enable roll-up all test results belong to a commit
and to provide a roll-up report.

Signed-off-by: Yeoh Ee Peng <ee.peng.yeoh@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
6 years agoscripts/resulttool: Enable manual result store and regression
Yeoh Ee Peng [Thu, 7 Mar 2019 04:49:08 +0000 (12:49 +0800)]
scripts/resulttool: Enable manual result store and regression

To enable store for testresults.json file from manualexecution,
add layers metadata to configuration and add "manual" map to
resultutils.store_map.

To enable regression for manual, add "manual" map to
resultutils.regression_map. Also added compulsory configurations
('MACHINE', 'IMAGE_BASENAME') to manualexecution.

Signed-off-by: Yeoh Ee Peng <ee.peng.yeoh@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
6 years agoresulttool/regression: Ensure regressoin results are sorted
Yeoh Ee Peng [Thu, 28 Feb 2019 01:58:57 +0000 (09:58 +0800)]
resulttool/regression: Ensure regressoin results are sorted

Sorted regression results to provide friendly viewing of report.

Signed-off-by: Yeoh Ee Peng <ee.peng.yeoh@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
6 years agoresulttool/store: Fix missing variable causing testresult corruption
Richard Purdie [Thu, 28 Feb 2019 13:16:47 +0000 (13:16 +0000)]
resulttool/store: Fix missing variable causing testresult corruption

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
6 years ago resulttool/report: Ensure ptest results are sorted
Richard Purdie [Wed, 27 Feb 2019 17:10:19 +0000 (17:10 +0000)]
 resulttool/report: Ensure ptest results are sorted

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
6 years agoresulttool/report: Ensure test suites with no results show up on the report
Richard Purdie [Wed, 27 Feb 2019 17:05:29 +0000 (17:05 +0000)]
resulttool/report: Ensure test suites with no results show up on the report

ptest suites with no results don't show up on the reports even though we have
a duration for them. Fix this so the fact they report no tests is visible.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
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>