aboutsummaryrefslogtreecommitdiff
path: root/tests/hostname.test
diff options
context:
space:
mode:
Diffstat (limited to 'tests/hostname.test')
-rwxr-xr-xtests/hostname.test11
1 files changed, 3 insertions, 8 deletions
diff --git a/tests/hostname.test b/tests/hostname.test
index ba65a398..d94f480a 100755
--- a/tests/hostname.test
+++ b/tests/hostname.test
@@ -4,14 +4,9 @@
#testing "name" "command" "result" "infile" "stdin"
-HOST="$(cat /proc/sys/kernel/hostname)"
+HOST="$(cat /proc/sys/kernel/hostname 2>/dev/null)"
+skipnot [ $? -eq 0 ]
testing "get" "hostname" "$HOST\n" "" ""
-if [ "$(id -u)" -ne 0 ]
-then
- echo "$SHOWSKIP: groupdel (not root)"
- return 2>/dev/null
- exit
-fi
-
+skipnot [ $(id -u) -eq 0 ]
testing "set" 'hostname "2>&1 | tee"; hostname; hostname "$HOST"' "2>&1 | tee\n" "" ""