summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDaan De Meyer <daan.j.demeyer@gmail.com>2024-05-13 15:08:07 +0200
committerDaan De Meyer <daan.j.demeyer@gmail.com>2024-05-14 12:43:28 +0200
commitd760e2a8c3908bf2fc980bf7fb9a200ab4641669 (patch)
treee8e5f9251d308b2d9cf37bef07a1b7a983cbb801 /test
parentTEST-64-UDEV-STORAGE: Add missing udevadm settle (diff)
downloadsystemd-d760e2a8c3908bf2fc980bf7fb9a200ab4641669.tar.xz
systemd-d760e2a8c3908bf2fc980bf7fb9a200ab4641669.zip
TEST-64-UDEV-STORAGE: Check for tgt and tgtd services
On Debian/Ubuntu, the unit is named tgt.service instead of tgtd.service, so let's make sure we take that into account. On CentOS, tgtd.service is not available, so let's skip the test if we can't find the service.
Diffstat (limited to 'test')
-rwxr-xr-xtest/units/TEST-64-UDEV-STORAGE.sh14
1 files changed, 11 insertions, 3 deletions
diff --git a/test/units/TEST-64-UDEV-STORAGE.sh b/test/units/TEST-64-UDEV-STORAGE.sh
index 728d57cb3f..aed322fe85 100755
--- a/test/units/TEST-64-UDEV-STORAGE.sh
+++ b/test/units/TEST-64-UDEV-STORAGE.sh
@@ -850,9 +850,17 @@ testcase_iscsi_lvm() {
ls -l "${devices[@]}"
- # Start the target daemon
- systemctl start tgtd
- systemctl status tgtd
+ # Start the target daemon (debian names it tgt.service so make sure we handle that)
+ if systemctl list-unit-files tgt.service; then
+ systemctl start tgt
+ systemctl status tgt
+ elif systemctl list-unit-files tgtd.service; then
+ systemctl start tgtd
+ systemctl status tgtd
+ else
+ echo "This test requires tgtd but it is not installed, skipping ..." | tee --append /skipped
+ exit 77
+ fi
echo "iSCSI LUNs backed by devices"
# See RFC3721 and RFC7143