Commit Graph

81 Commits

Author SHA1 Message Date
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
Armin Kuster
b49916c252 ltp_compliance: add new runtime
test runtimes in sec.
AIO: 14
MEM: 94
MSG: 89
SEM: 30
SIG: 194
THR: 399
TMR: 867
TPS: 23

(From OE-Core rev: e099204c34d1cf90ae4bb44fb0f56e72904c664a)

Signed-off-by: Armin Kuster <akuster808@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-04-29 14:16:30 +01:00
Armin Kuster
f45d63b484 ltp: add runtime test
This adds the framework for running ltp tests.

Here are some times:
math: 61
syscalls: 3957
dio: 18472
io: 29
mm: 551
ipc: 48
sched: 165
nptl: 46
pty: 37
containers: 52
controllers: 9625
filecaps: 27
cap_bounds: 27
fcntl-locktests: 29
connectors: 27
timers: 37
commands: 165
net.ipv6_lib: 30
input: 29
fs_perms_simple: 31
fs: 3476
fsx: 30
fs_bind: 28
fs_ext4: 28
cve: 675

(From OE-Core rev: 1ec677549d490a29a7c713610db4a56be7b55e26)

Signed-off-by: Armin Kuster <akuster808@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-04-29 14:16:30 +01:00
Naveen Saini
7519b0fc32 parselogs.py: ignore regulatory.db load failure messages for x86*
[YOCTO #13098]

(From OE-Core rev: 9c20f8c6e4bb5157550e347ffd6ef790eb6a1200)

Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-03-03 15:38:13 +00:00
Mingli Yu
6f0b28f009 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>
2019-02-20 11:30:35 +00:00
Alexander Kanavin
84e9159827 lib/oeqa/runtime/cases/gi.py: fix deprecation warning
With newest Python, the following is printed:

PyGIDeprecationWarning: GObject.markup_escape_text is deprecated; use GLib.markup_escape_text instead)

(From OE-Core rev: 7b4302d84e6c9833089bd575c1083fe826082387)

Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-02-02 11:06:00 +00:00
Richard Purdie
927320844f oeqa/runtime/ptest: Ensure OOM errors are logged
Currently processed being killed by the OOM killer may not be spotted by
ptest-runner. After we complete the tests, check the logs and report if there
were any. This ensures the user is aware of OOM conditions affecting the
ptest results.

(From OE-Core rev: 20a441d53817f80e0ce1597e77f6e794422ac49a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-02-02 11:05:59 +00:00
Armin Kuster
1a4d265ac0 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

(From OE-Core rev: a590e7805e3bec5dd995f7ea0b9e79a21f82b48b)

Signed-off-by: Armin Kuster <akuster808@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-31 23:23:27 +00:00
Richard Purdie
7b17274c30 oeqa/logparser: Various misc cleanups
Get rid of further unneeded code complications:

* value mappings we could just direct use
* ftools when we can write files easily ourself
* test result status filtering we don't use
* variable overwriting module imports

(From OE-Core rev: d6065f136f6d353c3054cc3f440a4e259509f876)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-31 23:23:26 +00:00
Richard Purdie
54d4694f32 oeqa/logparser: Improve results handling
Merge the results handling into the ptest log parser as a seperate
method.

Drop the weird "pass.skip.fail." prefix to the results filename, its
just bizarre.

Drop the code turning a list into a regex then searching the regex for
an item, "x in y" is perfectly capable.

Use a dict, sort the keys as needed and drop the list sorting code.

(From OE-Core rev: f317800e950b4a37b4034133bc52e0c47f04dc29)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-31 23:23:26 +00:00
Richard Purdie
3731033435 oeqa/utils/logparser: Add in support for duration, exitcode and logs by section
Allow parsing of the ptest duration, exit code and timeout keywords
from the logs, returning data on each section.

Also include the logs broken out per section.

(From OE-Core rev: a9a67dccaa5be0f06eedcab46dcff7cbf9202850)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-31 23:23:26 +00:00
Richard Purdie
88f390bcb6 oeqa/logparser: Reform the ptest results parser
Now we have a dedicated ptest parser, merge in the remaining ptest
specific pieces to further clarify and simplify the code, moving to
a point where we can consider extending/enhancing it.

(From OE-Core rev: 05991bb5bc8018275d03fdeecee3d5a757840c7c)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-31 23:23:26 +00:00
Richard Purdie
4ee85b1cd6 oeqa/logparser: Further simplification/clarification
Rename the paster to be ptest specific and apply some further cleanups
to the code to simplify and clarify what its doing.

(From OE-Core rev: 45a5886f1ec458d4c306b8d68fd31d568bc36b47)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-31 23:23:26 +00:00
Richard Purdie
95427c47ab oeqa/utils/logparser: Simplify ptest log parsing code
logparser is only used by ptest. Its slightly overcomplicated as it was
intended to be reusable but wasn't. Simplify it as a dedicated parser is
likely to me more readable and maintainable.

(From OE-Core rev: c7478345b2b4a85cb1fec40e762633871f0e94cb)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-31 23:23:26 +00:00
Richard Purdie
fa2db6a72a oeqa/runtime/ptest: Avoid traceback for tests with no section
Some tests end up without a section, avoid tracebacks trying to use
None as a string in that case.

(From OE-Core rev: 86fb5d898a29761f120c2eaa538a32cf2e078487)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-31 23:23:26 +00:00
Hongzhi.Song
ba346e6aeb runtime/ksample.py: correct a syntax and perfect item about architecture
(From OE-Core rev: 997ab2f5b9faaf656d677392224325f2a2cbc966)

Signed-off-by: Hongzhi.Song <hongzhi.song@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-24 17:45:25 +00:00
Yi Zhao
d150f6f5e7 parselogs.py: ignore failure messages for beaglebone edgerouter and mpc8315e-rdb
(From OE-Core rev: fb74c4cd4d123da270e58578644857c9a37b6c64)

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-22 14:35:58 +00:00
Hongzhi.Song
90206d9ece oeqa/runtime/ksample.py: skip kprobe case except x86 and powerpc
A new commit was introduced to kernel, which caused kprobe sample case
failed on arm.
[kernel commit: e46daee53bb50b, ARM: 8806/1: kprobes: Fix false positive
with FORTIFY_SOURCE]

And according to author, the case just works on x86 and powerpc.
So we just promise that the case can pass on x86 and powerpc.

(From OE-Core rev: 1a5b14bc3fe29618beea016ab2b32f55c19dd6ad)

Signed-off-by: Hongzhi.Song <hongzhi.song@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-18 16:24:40 +00:00
Chen Qi
77f291c7dc parselogs.py: whilelist one more amba error message
When using linux-yocto-dev, we will have one more amba error message
for qemuarm, so ignore it too.

(From OE-Core rev: 37cb293cf0f4194ec923d3bc4ebb9645f07536c0)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-16 15:35:07 +00:00
Richard Purdie
11340de05b 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: 0762b6021b87ceb1f37952f3a6d64a36e99ae6a5)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-11-16 11:46:07 +00:00
Richard Purdie
cd81cd155b 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>
2018-11-14 11:14:40 +00:00
Richard Purdie
633bd85270 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>
2018-11-14 11:14:40 +00:00
Yeoh Ee Peng
f3b1155f2b oeqa/runtime: Add tests for gstreamer CLI
We should not be finding GStreamer issues right around
release time but that's what we seem to do.

Port gstreamer tests from Intel Ref Kit.
https://github.com/intel/intel-iot-refkit/blob/master/meta-iotqa/
lib/oeqa/runtime/multimedia/gstreamer/gstreamer_cli.py

Add tests for gstreamer commandline tools (gst-inspect-1.0
& gst-launch-1.0).

[YOCTO #11418]

(From OE-Core rev: 3e77f845b517e3f4b3e7d09d088a9a80bf171653)

Signed-off-by: Yeoh Ee Peng <ee.peng.yeoh@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-11-14 11:14:39 +00:00
Richard Purdie
fcf55f58ae 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>
2018-11-07 23:08:55 +00:00
Chen Qi
8d29bd8ad0 ksample.py: fix error message
The current error message is like:

  kobject-example.kodoesn't exist

Add a space so that it looks like:

  kobject-example.ko doesn't exist

(From OE-Core rev: 30f2cdd0a3ee0874bebd135e35ab591f630e8adc)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-10-12 16:57:21 +01:00
Richard Purdie
aa2b645bf2 oeqa/runtime/opkg: Ensure the test works on multilib
After allarch was disabled in multilib, this test broke. Fix the test to account
for that change.

(From OE-Core rev: 6f692d86c2c6742c67aba93fa24b930af02d8e85)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-10-11 23:06:35 +01:00
Yeoh Ee Peng
5ebf30be9d 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>
2018-09-04 11:03:55 +01:00
Richard Purdie
652d25c09d oeqa/runtime/ldd: Clean up test
* Merge the two tests together as having them separate is pointless
* Test that ldd runs correctly
* Add in a dependency on the "ldd" package being installed instead of
  the sdk tools feature

(From OE-Core rev: 80db456387fb63ee74d53a9719ab3997432f4c80)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-08-23 07:50:00 +01:00
Bruce Ashfield
9af0f1a46b kernel-devsrc: restructure for out of tree (and on target) module builds
The existing kernel-devsrc package starts with a full copy of the kernel
source and then starts to strip out elements that are not required.

This results in extra time (I/O) and extra space being taken up in the
final package. The main purpose of the kernel-devsrc package has been to
build modules against the running kernel, not to include a full copy of
the source code for re-building the kernel. The end result was a
600M kernel-devsrc package.

This restructuring of the package uses an approach similar to other
distros, where the kernel-devsrc package is for building against the
running kernel and uses a curated set of copied infrastructure, versus
a mass copy of the entire kernel.

The differences in this approach versus other is largely due to the
architecture support and the split build/source directory of the
kernel.

The result is a kernel-devsrc package of about 10M, which is capable
of running "make scripts" and compiling kernel modules against the
running kernel.

Along with the changes to the copying of the infrascture, we also
have the following changes:

 - a better/more explicit listing of dependencies for on-target
   builds of "make scripts" or "make modules_prepare"

 - The kernel source is installed into /lib/modules/<version>/build
   and a symlink created from /usr/src/kernel to the new location.
   This aligns with the standard location for module support
   code

 - There is also a symlink from /lib/modules/<version>/source -> build
   to reserve a spot for a new package that is simply the kernel
   source. That package is not part of this update.

(From OE-Core rev: 007ef1f468110b2698a27ea9a6d43fed5a0a9fc2)

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-08-19 16:35:22 +01:00
Hongzhi.Song
704e725bba runtime selftest: limit kernel hw bp arches
1. So far, only qemux86[-64] support hw breakpoint, no matter whether or
not with kvm.

qemuppc: The oe-core configuration uses a PPC G4 system as the
default cpu but qemu doesn't simulate the hw breakpoint register for G4.

qemuarm: The arch more than v7 supports hw breakpoint, however arm use
v5 as default.

qemuarm64: We temporarily drop qemuarm64 for the moment. Normally it
will print debug info once, but endlessly when we trigger the break
point. Now it is hard to located the issue, but we will confirm it
later.

qemumips*: Kernel dosen't support hw bp for mips.

2. Syslog maybe not started, so we use dmesg to confirm.

3. Running 'ls' to trigger the hardware breakpoint test.

(From OE-Core rev: 176e50fb177dc40e439700d5f3f838dd7eaaa427)

Signed-off-by: Hongzhi.Song <hongzhi.song@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-08-16 22:40:28 +01:00
Hongzhi.Song
742a801536 runtime selftest: test_trace_events_sample of ksample.py
The debug info can not be written to trace buffer immediately
by thread. So we should sleep some seconds.

(From OE-Core rev: 5ccf8150b4c65f2feac16cc2881188f14d9e5390)

Signed-off-by: Hongzhi.Song <hongzhi.song@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-08-16 22:40:28 +01:00
Chen Qi
fd85436b04 parselogs.py: output correct log location
The log entry in results is altered to remove 'target_logs'. This
causes wrong log location in output.

e.g.
   AssertionError: 1 != 0 : Log: /path/to/image/1.0-r0/postinstall.log

But when user wants to check the log, the user will find the log is
not present. The actual log file is /path/to/image/1.0-r0/target_logs/postinstall.log.

So fix to use the correct log location.

(From OE-Core rev: df3a2e21648d6b649ebda7e6032afbd63c939f2b)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-08-14 11:36:31 +01:00
Chen Qi
e77d45609a oe_syslog.py: fix for syslog-ng
When using syslog-ng as the syslog provider, oe_syslog test case fails
because it cannot find the syslog daemon. This is because it greps for
'syslogd' but syslog-ng's daemon is 'syslog-ng'. So fix it to check both
'syslogd' and 'syslog-ng'.

Also, when the test case fails, what I get is:
| AssertionError: 1 != 0 : No syslogd process; ps output:
<empty here>

This does not help user. The output is actually from the 'PS | GREP' command.
And when the 'PS | GREP' command fails, the output is always empty. So also fix
this problem. After the change, it looks like:
| AssertionError: False is not true : No syslog daemon process; ps output:
|   PID USER       VSZ STAT COMMAND
|     1 root     16476 S    {systemd} /sbin/init
|     2 root         0 SW   [kthreadd]
|     3 root         0 IW   [kworker/0:0]
...

(From OE-Core rev: b180fbd9d93db1c6351e183fbc08fc81cdc240c0)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-08-08 10:51:59 +01:00
Chen Qi
e8143566cc systemd.py: increase default bus timeout
Use SYSTEMD_BUS_TIMEOUT to set default timeout to 240s to avoid
timeout problem on slow qemu machines.

(From OE-Core rev: a5b1dcabdd84915eb0527be4e7bd64ab46860d9d)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-31 22:47:36 +01:00
Chen Qi
fc2eea3d28 parselogs.py: ignore network interface name changing failure
The following error from systemd-udevd is not harmful. It's just
because our qemu targets are using eth0.

  Error changing net interface name 'eth0' to 'enp0s3': Device or resource busy

Note that systemd is using a different network interface naming scheme
from traditional ethX naming scheme. To make this error message go away,
we could symlink /etc/udev/rules.d/80-net-setup-link.rules to /dev/null
to recover traditional naming scheme. But I'm not sure if this will
cause regression in user experience for systemd users of OE.

So just ignore this error message so that parselogs.py test case does not
fail.

(From OE-Core rev: f1735fed088ddda6517fa4ff6fbd6ef683b14878)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-31 22:47:36 +01:00
Chen Qi
b195bff204 oe_syslog.py: fix settings in OEHasPackage decorator
1. For test_syslog_running, we should not restrict it to run for
   only busybox-syslog and sysklogd. So extend it to all syslog
   providers in oe-core and meta-openembedded.

2. For test_syslog_startup_config, fix to make it depend on the
   existence of busybox-syslog. The previous condition "!sysklogd
   && busybox" is incorrect, because busybox may be compiled without
   syslog support, and sysklogd and busybox-syslog conflict with
   each other.

(From OE-Core rev: 119c22342d446e4f638b8d4c81480ebc7b444245)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-31 22:47:35 +01:00
Ross Burton
9de268dd60 oeqa/runtime/scanelf: remove
These tests are intended to search for bad RPATHs and text relocations, but we
do these tests at buildtime and as pax-utils is never installed in any default
images the tests are never executed.

(From OE-Core rev: ff81b58d5f322ea4a24c1b9ed40377c742459149)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-30 12:44:35 +01:00
Ross Burton
19905c78e7 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>
2018-07-26 13:16:40 +01:00
Ross Burton
731ce8c760 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>
2018-07-18 10:18:42 +01:00
Anuj Mittal
ba598c7db3 oeqa/parselogs: remove references to BSPs that no longer exist
These platform specifc BSPs were removed from meta-intel and superseded by
intel-core* BSPs.

(From OE-Core rev: a6fd20fc57da3e1910e775f5994bd71bf79934ea)

Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-18 10:18:41 +01:00
Chen Qi
946a48be9e oeqa/runtime/cases/parselog.py: ignore a message from weston
The following error message when starting core-image-weston is not
critical as long as the image could start up correctly. So extend
the common_errors list for parselog.py test case to ignore this
message.

  logind: cannot setup systemd-logind helper (-61), using legacy fallback

[YOCTO #12835]

(From OE-Core rev: edc244b2f346ad2eb3c90664ec17c904b356b992)

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>
2018-07-05 11:39:06 +01:00
Hongzhi.Song
ec2bb22965 oeqa/runtime: Add testcases for kernel sample
We are going to let runtime test support kernel tests. Now we just add
kernel self-contained sample tests. And we plan to add overall kernel
tests in the future.

This patch is just add kernel samples test which contains about 13 tests
enabled by kernel-sample.scc. So it needs statement,
KERNEL_FEATURES_append += " features/kernel-sample/kernel-sample.scc" in
local.conf.

(From OE-Core rev: be6ef728fd36049ea3822a54909a995bdecf6dd0)

Signed-off-by: Hongzhi.Song <hongzhi.song@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-02 21:37:47 +01:00
Chen Qi
c7fbb0251b 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>
2018-06-18 11:07:57 +01:00
Chen Qi
a77b860335 oeqa/runtime/cases/parselogs.py: ignore a message from watchdog
The following message from watchdog is not an error.

  "error retry time-out = 60 seconds"

Checking watchdog's source codes, we have:

  src/watchdog.c: log_message(LOG_INFO, "error retry time-out = %d seconds", retry_timeout);

It's clear this is an info message, so parselogs should ignore it.

(From OE-Core rev: c90dff78310ab1517555c4df39b3e2d2f59ff06d)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-18 11:07:57 +01:00
Chen Qi
d3f4363223 oeqa/runtime/cases/parselogs.py: extend common_errors list
Add the following line to common_errors list.

  Failed to read /var/lib/nfs/statd/state: Success

This message is not harmful, it does not result in rpc.statd starting
failure.

(From OE-Core rev: 0f2c39149941d95fa979ec675f9dc25655886e2c)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-18 11:07:57 +01:00
Richard Purdie
c1d72abe5e 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.

(From OE-Core rev: 0a77f4b680332a692abf0231e397fab44c59bde3)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-07 08:52:55 +01:00
Alexander Kanavin
ec840e6638 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>
2018-06-07 08:52:55 +01:00
Chen Qi
7937e471b6 oeqa/runtime/cases/multilib.py: fix test_file_connman skipping logic
The test_file_connman should be executed only when 'lib32-connman' is
installed and 'connman' is not installed.

When lib32-connman and connman are both installed, the /usr/sbin/connmand
could be from connman or lib32-connman, depending on the installation
order. What we want to check is the connmand command from lib32-connman,
so we need to make sure that connman is not there to cause chaos.

(From OE-Core rev: bc6839394c06bb695b92b2183337e7381da1e86c)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-04 15:15:00 +01:00
Chen Qi
ce57973fd9 oeqa/runtime/cases/multilib.py: skip if needed packages are not available
1) The test cases use 'readelf' command to do the check. This command
   is from binutils. So skip the test if the needed binutils package is
   not installed.

   The related error message in log.do_testimage is like below.

     Output:  sh: readelf: not found

2) The test case tests /lib/libc.so.6 from lib32-libc6. So skip the test
   if lib32-libc6 is not installed.

   The related error message in log.do_testimage is like below.

     Output:   readelf: Error: 'lib/libc.so.6': No such file

(From OE-Core rev: eae929a5c224f5c3468d6a0466d1bbb3f678a5a1)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-04 15:15:00 +01:00
Chen Qi
b60954ca5f oeqa/runtime/cases/rpm.py: skip if rpm not available
This test case should only run when rpm package is installed.
So skip it if rpm package is not installed. This fixes:

  RESULTS - rpm.RpmBasicTest.test_rpm_help - Testcase 1059: FAILED

(From OE-Core rev: bb909a60c04248d015d988e4454f0a11b1c287da)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-04 15:15:00 +01:00