]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: add a couple of basic sanity tests for timedatectl
authorFrantisek Sumsal <frantisek@sumsal.cz>
Sat, 15 Apr 2023 17:51:44 +0000 (19:51 +0200)
committerFrantisek Sumsal <frantisek@sumsal.cz>
Sun, 16 Apr 2023 07:21:13 +0000 (09:21 +0200)
test/units/testsuite-45.sh

index ebc6c7c1444252f252f659ecfb8adb30808d2dc9..73608756bf80760576dbb1a7a143ddfd49e210b4 100755 (executable)
@@ -7,6 +7,27 @@ set -o pipefail
 # shellcheck source=test/units/assert.sh
 . "$(dirname "$0")"/assert.sh
 
+test_timedatectl() {
+    timedatectl --no-pager --help
+    timedatectl --version
+
+    timedatectl
+    timedatectl --no-ask-password
+    timedatectl status --machine=testuser@.host
+    timedatectl status
+    timedatectl show
+    timedatectl show --all
+    timedatectl show -p NTP
+    timedatectl show -p NTP --value
+    timedatectl list-timezones
+
+    if ! systemd-detect-virt -qc; then
+        systemctl enable --runtime --now systemd-timesyncd
+        timedatectl timesync-status
+        timedatectl show-timesync
+    fi
+}
+
 restore_timezone() {
     if [[ -f /tmp/timezone.bak ]]; then
         mv /tmp/timezone.bak /etc/timezone
@@ -256,6 +277,7 @@ EOF
 
 : >/failed
 
+test_timedatectl
 test_timezone
 test_adjtime
 test_ntp