summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2021-03-26 11:13:56 +0100
committerZdenek Kabelac <zkabelac@redhat.com>2021-03-26 11:13:56 +0100
commit85fae836c09daf457f3f8f14e3eae2179cfd2ffa (patch)
tree512683db1dd201e756470ecf0ec7a02e1908f356
parent9bcc76b63c14566e5ced09ac18129e1c9a98e8e4 (diff)
downloadlvm2-85fae836c09daf457f3f8f14e3eae2179cfd2ffa.tar.gz
tests: add basic validation of running services
For determinist test results lvm2/dm service shall not be present and running in the system as it may randomize test results. In case they are found present, this test ends with warning (not failure).
-rw-r--r--test/shell/000-basic.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/shell/000-basic.sh b/test/shell/000-basic.sh
index 1e511d1f0..a7b80c72b 100644
--- a/test/shell/000-basic.sh
+++ b/test/shell/000-basic.sh
@@ -34,3 +34,15 @@ get_devs
# ensure we do not crash on a bug in config file
aux lvmconf 'log/prefix = 1""'
not lvs "${DEVICES[@]}"
+
+# validate testing machine with its services is in expected state and will not interfere with tests
+if systemctl -a >out 2>/dev/null ; then
+ for i in dm-event lvm2-lvmpolld lvm2-monitor ; do
+ echo $i
+ grep $i out | not grep -v masked || {
+ cat out
+ should not echo "Present unmasked $i service/socket may randomize testing results!"
+ echo "+++++ Stop & Mask with systemctl +++++"
+ }
+ done
+fi