summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrantisek Sumsal <frantisek@sumsal.cz>2023-04-15 19:51:44 +0200
committerFrantisek Sumsal <frantisek@sumsal.cz>2023-04-16 09:21:13 +0200
commita51ba8e31a8d68d3d27711d173e55b7cfc48e6d9 (patch)
treecb9266ab7100395905b5da580ddc58beb2d37a7f
parenttest: add a simple test for secure-bits stuff (diff)
downloadsystemd-a51ba8e31a8d68d3d27711d173e55b7cfc48e6d9.tar.xz
systemd-a51ba8e31a8d68d3d27711d173e55b7cfc48e6d9.zip
test: add a couple of basic sanity tests for timedatectl
-rwxr-xr-xtest/units/testsuite-45.sh22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/units/testsuite-45.sh b/test/units/testsuite-45.sh
index ebc6c7c144..73608756bf 100755
--- a/test/units/testsuite-45.sh
+++ b/test/units/testsuite-45.sh
@@ -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