summaryrefslogtreecommitdiff
path: root/debian/tests/id
diff options
context:
space:
mode:
Diffstat (limited to 'debian/tests/id')
-rw-r--r--debian/tests/id18
1 files changed, 18 insertions, 0 deletions
diff --git a/debian/tests/id b/debian/tests/id
new file mode 100644
index 0000000..4a0a8a3
--- /dev/null
+++ b/debian/tests/id
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+real_id=$(id -u)
+fake_id=$(fakeroot id -u)
+
+case "${real_id}:${fake_id}" in
+ (0:0)
+ echo >&2 "test run under root: failure"
+ exit 1
+ ;;
+ (*:0)
+ echo "id: OK"
+ ;;
+ (*)
+ echo >&2 "unexpected result (${real_id}:${fake_id}): failure"
+ exit 2
+ ;;
+esac