id.test: hacks to pass on Raspberry Pi OS.

The rest of `make tests` all pass on a Raspberry Pi 400.
This commit is contained in:
Elliott Hughes 2020-12-05 13:11:52 -08:00 committed by Rob Landley
parent 75b89012c9
commit 49c02dbe43

View File

@ -5,13 +5,15 @@
#testing "name" "command" "result" "infile" "stdin"
# Systems with SELinux will have security context cruft,
# and BSDs call the root group "wheel" instead.
CLEAN="sed 's/ context=.*//g' | sed 's/wheel/root/g'"
# BSDs call the root group "wheel" instead,
# and Raspberry Pi OS has root also in the 117(lpadmin) group.
CLEAN="sed 's/ context=.*//g' | sed 's/wheel/root/g' | \
sed 's/117//g' | sed -E 's/\(?lpadmin\)?//g' | sed 's/[ ,]$//'"
testing "0" "id 0 | $CLEAN" "uid=0(root) gid=0(root) groups=0(root)\n" "" ""
testing "root" "id root | $CLEAN" \
"uid=0(root) gid=0(root) groups=0(root)\n" "" ""
testing "-G root" "id -G root" "0\n" "" ""
testing "-G root" "id -G root | $CLEAN" "0\n" "" ""
testing "-nG root" "id -nG root | $CLEAN" "root\n" "" ""
testing "-g root" "id -g root" "0\n" "" ""
testing "-ng root" "id -ng root | $CLEAN" "root\n" "" ""