action #88648
closedcoordination #66400: [qe-core][epic][qem][systemd] test fails in 1_systemd
[qe-core][qem][systemd] qa_test_systemd fails in check-lvm2-lvmetad and check-named
100%
Description
The systemd testsuite (qa_test_systemd
) fails in
check-named
for sle 15, sle 15sp1 and sle 15sp2. The servicenamed.service
does not exist in those products.check-lvm2-lvmetad
for sle 15sp2. The servicelvm2-lvmetad.service
does not exist in this product.
The problem is a bit different than one might first think, because the default behavior of the testsuite should be to SKIP those missing service tests rather than fail.
But how do we know what the default behavior should be?
To answer this, let's check sle 12sp5:
In this product, the named.service
does not exist, similar to sle 15 and above. However the check-named
testcase is SKIPPED here.
The /usr/share/qa/tools/test_systemd_run
script (that runs the testsuite) in short runs /usr/share/qa/qa_test_systemd/check-service.sh
against all to-be-tested services as listed in /usr/share/qa/qa_test_systemd/tcf/qa_systemd.tcf
.
/usr/share/qa/qa_test_systemd/check-service.sh
contains a function function get_loaded()
that gets the Loaded:
status of the service that is being tested. Later in the code, if this status is "not-found"
, then the script exits with exit 22
. This results in the current service test being skipped.
So for 12sp5 if we would be testing a service called imaginary-service
, get_loaded()
would run
# systemctl status imaginary-service
imaginary-service.service
Loaded: not-found (Reason: No such file or directory)
Active: inactive (dead)
So after grepping
the Loaded
status (which is "not-found"
), it would skip the test for imaginary-service.service
However for sle 15 and above the output of systemctl has changed:
Here we get
systemctl status imaginary-service
Unit imaginary-service.service could not be found.
Which means that get_loaded
cannot grep the Loaded
status and exits with exit 1
, resulting in a failing testcase.
Given the above, there are two potential actions to address the aforementioned fails:
- The testsuite behavior should be fixed for the sle 15 products, namely how the
get_loaded
function gets the loaded status. - I also believe (but I am not sure if it is the correct route) that apart from the above change, the tests for the services that are no longer found (
check-lvm2-lvmetad
andcheck-named
) should be removed from theqa_systemd.tcf
of the qa_test_systemd versions that correspond to those products