Commit Graph

27 Commits

Author SHA1 Message Date
Robert Yang
15cdacb8c0 oeqa: Cleanup /usr/bin/env python
(From OE-Core rev: eb79217b8761816a21c8f7bed3c5379c1b9230ea)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-06-30 22:40:52 +01:00
Richard Purdie
ffae400179 meta/lib+scripts: Convert to SPDX license headers
This adds SPDX license headers in place of the wide assortment of things
currently in our script headers. We default to GPL-2.0-only except for the
oeqa code where it was clearly submitted and marked as MIT on the most part
or some scripts which had the "or later" GPL versioning.

The patch also drops other obsolete bits of file headers where they were
encoountered such as editor modelines, obsolete maintainer information or
the phrase "All rights reserved" which is now obsolete and not required in
copyright headers (in this case its actually confusing for licensing as all
rights were not reserved).

More work is needed for OE-Core but this takes care of the bulk of the scripts
and meta/lib directories.

The top level LICENSE files are tweaked to match the new structure and the
SPDX naming.

(From OE-Core rev: f8c9c511b5f1b7dbd45b77f345cb6c048ae6763e)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-05-09 16:31:55 +01:00
Richard Purdie
c7592b0147 oeqa: Drop OETestID
These IDs refer to testopia which we're no longer using. We would now use the test
names to definitively reference tests and the IDs can be dropped, along with their
supporting code.

(From OE-Core rev: 8e2d0575e4e7036b5f60e632f377a8ab2b96ead8)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-05-09 16:31:55 +01:00
Kai Kang
83ade722e1 selftest/wic: update test case test_qemu
This test case boots the image in qemu and checks for mounted partitions.
But the outputs of mount are different between sysvinit and systemd:

sysvinit:
/dev/root /\r\n/dev/sda1 /boot\r\n/dev/sda3 /media\r\n/dev/sda4 /mnt
systemd:
/dev/sda1 /boot\r\n/dev/sda2 /\r\n/dev/sda3 /media\r\n/dev/sda4 /mnt

So check mounted partitions by egrep rather than check output of runqemu.

(From OE-Core rev: 8e3311d45ec68d74e934e966f67cf5102634981c)

Signed-off-by: Kai Kang <kai.kang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-16 15:35:07 +00:00
Richard Purdie
d9087c7c47 selftest/wic: Fix/cleanup class setup code
The code was using Wic instead of WicTestCase for image_is_ready and
native_sysroot which was confusing some tests. Fix image_is_ready.

For native_sysroot, convert the only user to just run the call itself
as there is no point in executing this for all the other tests which
don't use the value.

Whilst here, move _get_image_env_path to the base class alongside
its parent variabe and fix it to use WicTestCase.

(From OE-Core rev: 3e83364ed7031d53f281216214b04c7acace844a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-30 12:44:34 +01:00
Richard Purdie
b84b073396 selftest/wic: clean up runCmd error code handling
runCmd handles checking exit 0 internally unless specified otherwise and its
error messages are much more useful including the failed command output.

Clean up the unneeded 0 exit code checks in the wic tests.

(From OE-Core rev: 394f7d4efe80e390e2c9b0be5e6d10954395a82b)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-25 16:48:27 +01:00
Richard Purdie
e3dcd61337 selftest/wic: Improve error message for test_fixed_size
Currently this can fail with a message like 127 != 0 which is unhelpful.

If we remove the ignore_status=False, the debugging from runCmd is much
more helpful printing status.output.

Also remove the now unneeded exit code check.

(From OE-Core rev: 1aa7471b11aedc68de5116c461fe73152e3985fd)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-25 16:48:27 +01:00
Richard Purdie
05c32d2de1 oeqa/selftest/wic: Split tests into two class groups
This improves test parallelism.

(From OE-Core rev: 26e04b23ba1b6942aa7c7df478d41dfe7b73e6e0)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-16 13:21:35 +01:00
Richard Purdie
eacc12c2ec oeqa/selftest/wic: Ensure initramfs exists for test_iso_image
AssertionError: Command 'wic create mkhybridiso --image-name core-image-minimal -o /var/tmp/wic.oe-selftest/' returned non-zero exit status 1:

ERROR: _exec_cmd: gzip -f -9 -c /var/tmp/wic.oe-selftest/tmp.wic.drhn6edm/initrd.cpio > /var/tmp/wic.oe-selftest/tmp.wic.drhn6edm/initrd.cpio.gz returned '1' instead of 0
output: gzip: /var/tmp/wic.oe-selftest/tmp.wic.drhn6edm/initrd.cpio: No such file or directory

This is because in a clean build directory, the initramfs may not be rebuilt.
Add a call to ensure it is built to avoid the error.

(From OE-Core rev: 2a80fa234d31992691a157425e8990db30158fd1)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-16 13:21:35 +01:00
Richard Purdie
5e8367e17f oeqa/selftest/wic: Use a subdir of builddir, not /var/
Using /var/ leave wic open to races with other processes on the system, use
a subdir of builddir instead to avoid this.

(From OE-Core rev: e07ec908ce7f26143a7bdf0a07a1230c0fd6ac87)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-16 13:21:34 +01:00
Alexander Kanavin
210f9c0ae0 btrfs-tools: update to 4.15.1
Drop upstreamed 0001-Fix-build-with-musl-missing-header-include-for-dev_t.patch

Add ftw-subdir-walk.patch as it resolves the RECIPE_NO_UPDATE_REASON.

Add --disable-zstd as libzstd isn't provided in oe-core.

Fix wic testcase, as the minimal fs size is now bigger.

(From OE-Core rev: 94b645aa77a4193371e8c77ddc477ec00d858961)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-05-04 13:28:02 +01:00
Joshua Lock
a2fee27d0a oeqa/selftest/cases/wic: update OETestID decorator for test_qemu
Test case ID 1422 is not correct for this issue, the correct test
case ID for test_qemu is 1424.

(From OE-Core rev: d214b1dc9339c4873156934f5291b9373a11471f)

Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-12-21 10:21:00 +00:00
Tom Rini
d0de33c5d4 meta-selftest: wic: Add test for --use-uuid / --fsuuid
- Mount a '/media' partition to wic-image-minimal.wks with a known UUID.
- In test_qemu, sort our output from checking the output of 'mount' as
  it may not be stable.  Also, do not check the exit code as passing any
  output to cut ensures a 0 exit code.
- Check for a 'UUID=' line in /etc/fstab with out expected output.

(From OE-Core rev: 6d9396b26218f3234701944f385d5c36face8121)

Signed-off-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-12-18 18:03:58 +00:00
Ed Bartosh
e1d59cbab4 wic: selftest: add test_wic_rm_ext test case
Tested if 'wic rm' correctly removes files from the ext4 partition
of the wic image.

(From OE-Core rev: 693b555e4f419b5d24f9f86c44354866492f8bb0)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-11 17:30:29 +01:00
Ed Bartosh
f5a679e9b1 wic: selftest: add test_wic_cp_ext test case
Tested if 'wic cp' correctly copies files to the ext4 partition
of the wic image.

(From OE-Core rev: 7970907c72d9533fd63d2c8796bbeb9be86b3fc3)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-11 17:30:29 +01:00
Ed Bartosh
d3739ff0e2 wic: selftest: add test_wic_ls_ext test case
Tested if 'wic ls' correctly lists directory contents
of the ext* partition.

(From OE-Core rev: 6ae3ff957b5c28c7853966cd5a7665772c594546)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-11 17:30:29 +01:00
Jose Perez Carranza
1d5d4165a5 oeqa/selftest: Add missing IDs to various test cases
Add decorator @OETestID() with Tesopia TC-ID to the test cases
that did not have it properly set.

[YOCTO #11873]

(From OE-Core rev: aa5b9edbd9c4495befe1912a5b401b536be39d5b)

Signed-off-by: Jose Perez Carranza <jose.perez.carranza@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-11 17:30:28 +01:00
Ed Bartosh
390dcbf2e1 wic: setlftest: test expanding MBR image
Added test_expand_mbr_image test case to the wic oe-selftest suite.
The test expands directdisk wic image to 1Gb target, checks if it's
expanded correctly and boots it in qemu to make sure the image
is bootable, i.e. bootloader, kernel, boot and root partitions
are still functional.

(From OE-Core rev: 83739174be5b3fabd7df559a35ac6407d82a6280)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-27 22:30:07 +01:00
Ed Bartosh
c8a4feacd8 oe-selftest: wic: fix test_quemu
This test case boots the image in qemu and checks for mounted
partitions. As /boot is mounted automatically the test case fails.
Fixed this by adding /boot to the list of mounted partitions.

(From OE-Core rev: e5ba124b01ff6883a08c91daa47343dd09f6260d)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-07-30 08:46:19 +01:00
Ed Bartosh
3a4a738bc5 oe-selftest: wic: change mkfs.btrfs options
test_mkfs_extraopts test case fails on ab with error caused
by using -K --mixed options:
 output: extent-tree.c:2696: btrfs_reserve_extent: BUG_ON `ret` triggered, value -28

For this test case it's not important to use particular options,
so changing options to anything less influential is OK.

Changed extra options for mkfs.btrfs to '--quiet' to fix the failure.

(From OE-Core rev: 6a1489f8deb2b26181ca340a0f6ef62aa18a5188)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-07-27 22:36:52 +01:00
Ed Bartosh
7916a5f013 oe-selftest: wic: add test_mkfs_extraopts test case
Test new wks option --mkfs-extraopts with all filesystems
supported by wic.

(From OE-Core rev: 79e853c450708e1e06684cf1216337cbad964770)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-07-21 22:51:38 +01:00
Ed Bartosh
5a514183e1 selftest: fixed 5 wic test cases
Added core-image-minimal -> syslinux dependency to ensure
syslinux artifacts are available from core-image-minimal
build. This should fix test_iso_image, test_bootloader_config and
test_default_output_dir test cases.

Used --native-sysroot in test_image_vars_dir_long and
test_image_vars_dir_short test cases to point out to wic-tools
native sysrtoot.

(From OE-Core rev: b7bcc4ba756aa3941c89999e9d6761738ea5bb05)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-07-17 14:01:37 +01:00
Jose Perez Carranza
ab0780dfea selftest: Add Testopia ID to test cases
Add decorator @OETestID() with proper Tesopia TC ID to the test cases
that did not have it set.

(From OE-Core rev: d7bc697534db911a3ce98537d772d87482a0f702)

Signed-off-by: Jose Perez Carranza <jose.perez.carranza@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-06-23 11:44:12 +01:00
Ed Bartosh
1de1a34a64 selftest: add test_wic_rm test case
Added test case for "wic rm" functionality.
    - remove file from vfat partition
    - remove directory from vfat partition

(From OE-Core rev: fc42914d426ad2dad8c3026668726c003b3ab10b)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-06-14 10:18:30 +01:00
Ed Bartosh
bb94a25b85 selftest: add test_wic_cp test case
Added test case for "wic cp" functionality.
     - copy file to vfat partition
     - copy directory to vfat partition

(From OE-Core rev: cb416d1feea042bcdedc9f522d588fef2c4929bc)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-06-14 10:18:29 +01:00
Ed Bartosh
4917798395 selftest: add new test case test_wic_ls
Tested 'wic ls' functionality:
 - list of image partitions
 - list of directory content of vfat partition

(From OE-Core rev: 3b271f6a40d7ef93fff9700dd8ac98bddd92d581)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-06-14 10:18:29 +01:00
Leonardo Sandoval
157c3be2ca oeqa/selftest/cases: Migrate test cases into the new oe-qa framework
New framework has different classes/decorators so adapt current test cases to
support these. Changes include changes on base classes and decorators.

Also include paths in selftest/__init__.py isn't needed because the
loader is the standard unittest one.

(From OE-Core rev: ddbbefdd124604d10bd47dd0266b55a764fcc0ab)

Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-06-06 19:02:43 +01:00