diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-10 20:49:53 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-10 20:49:53 +0000 |
commit | 87aefc960557c2fb6fdf9ea4c1ac0e7983f68f68 (patch) | |
tree | 263fc56d7d40512aaa09193905008a3f4e3b0018 /debian/tests/hostnamed | |
parent | Adding upstream version 255.4. (diff) | |
download | systemd-87aefc960557c2fb6fdf9ea4c1ac0e7983f68f68.tar.xz systemd-87aefc960557c2fb6fdf9ea4c1ac0e7983f68f68.zip |
Adding debian version 255.4-1.debian/255.4-1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/tests/hostnamed')
-rwxr-xr-x | debian/tests/hostnamed | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/debian/tests/hostnamed b/debian/tests/hostnamed new file mode 100755 index 0000000..1b22869 --- /dev/null +++ b/debian/tests/hostnamed @@ -0,0 +1,22 @@ +#!/bin/sh +set -e + +. `dirname $0`/assert.sh + +ORIG_HOST=`cat /etc/hostname` +echo "original hostname: $ORIG_HOST" + +# should activate daemon and work +STATUS="`hostnamectl`" +assert_in "Static hostname: $ORIG_HOST" "$STATUS" +assert_in "Kernel:.* `uname -r`" "$STATUS" + +# change hostname +assert_eq "`hostnamectl set-hostname testhost 2>&1`" "" +assert_eq "`cat /etc/hostname`" "testhost" +assert_in "Static hostname: testhost" "`hostnamectl`" + +# reset to original +assert_eq "`hostnamectl set-hostname $ORIG_HOST 2>&1`" "" +assert_eq "`cat /etc/hostname`" "$ORIG_HOST" +assert_in "Static hostname: $ORIG_HOST" "`hostnamectl`" |