2aacef
From 5488431dcbea41bec11f0b1ad0a3769489f68c39 Mon Sep 17 00:00:00 2001
2aacef
From: Frantisek Sumsal <fsumsal@redhat.com>
2aacef
Date: Wed, 23 Nov 2022 15:16:41 +0100
2aacef
Subject: [PATCH] test: skip test_ntp if systemd-timesyncd is not available
2aacef
2aacef
We don't ship timesyncd on RHEL, so let's skip the test there.
2aacef
2aacef
rhel-only
2aacef
Related: #2138081
2aacef
---
2aacef
 test/units/testsuite-45.sh | 5 +++++
2aacef
 1 file changed, 5 insertions(+)
2aacef
2aacef
diff --git a/test/units/testsuite-45.sh b/test/units/testsuite-45.sh
2aacef
index 24e888c587..7e757e4b00 100755
2aacef
--- a/test/units/testsuite-45.sh
2aacef
+++ b/test/units/testsuite-45.sh
2aacef
@@ -201,6 +201,11 @@ wait_mon() {
2aacef
 }
2aacef
 
2aacef
 test_ntp() {
2aacef
+    if ! systemctl list-unit-files -q systemd-timesyncd.service; then
2aacef
+        echo "systemd-timesyncd is not available, skipping the test..."
2aacef
+        return 0
2aacef
+    fi
2aacef
+
2aacef
     # timesyncd has ConditionVirtualization=!container by default; drop/mock that for testing
2aacef
     if systemd-detect-virt --container --quiet; then
2aacef
         systemctl disable --quiet --now systemd-timesyncd