aboutsummaryrefslogtreecommitdiff
path: root/tests/id.test
blob: f62938f0caca6abb4f47e1279d5883ba1d297ff5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/bin/bash

[ -f testing.sh ] && . testing.sh

#testing "name" "command" "result" "infile" "stdin"

testing "id 0" "id 0" "uid=0(root) gid=0(root) groups=0(root)\n" "" ""
testing "id root" "id root" "uid=0(root) gid=0(root) groups=0(root)\n" "" ""
testing "id -G root" "id -G root" "0\n" "" ""
testing "id -g root" "id -g root" "0\n" "" ""
testing "id -u root" "id -u root" "0\n" "" ""
testing "id no-such-user" "id no-such-user 2>/dev/null ; echo \$?" "1\n" "" ""
testing "id 9999999" "id 9999999 2>/dev/null ; echo \$?" "1\n" "" ""