1 atf_test_case sethostname
2 atf_test_case addsshkey
7 export NUAGE_FAKE_ROOTDIR="$(pwd)"
8 atf_check /usr/libexec/flua $(atf_get_srcdir)/sethostname.lua
9 if [ ! -f etc/rc.conf.d/hostname ]; then
10 atf_fail "hostname not written"
12 atf_check -o inline:"hostname=\"myhostname\"\n" cat etc/rc.conf.d/hostname
16 atf_check /usr/libexec/flua $(atf_get_srcdir)/addsshkey.lua
17 if [ ! -f .ssh/authorized_keys ]; then
18 atf_fail "ssh key not added"
20 atf_check -o inline:"mykey\n" cat .ssh/authorized_keys
21 atf_check /usr/libexec/flua $(atf_get_srcdir)/addsshkey.lua
22 atf_check -o inline:"mykey\nmykey\n" cat .ssh/authorized_keys
26 export NUAGE_FAKE_ROOTDIR="$(pwd)"
27 if [ $(id -u) -ne 0 ]; then
28 atf_skip "root required"
31 printf "root:*:0:0::0:0:Charlie &:/root:/bin/csh\n" > etc/master.passwd
32 pwd_mkdb -d etc etc/master.passwd
33 printf "wheel:*:0:root\n" > etc/group
34 atf_check -e inline:"Argument should be a table\nArgument should be a table\n" /usr/libexec/flua $(atf_get_srcdir)/adduser.lua
35 test -d home/impossible_username || atf_fail "home not created"
36 atf_check -o inline:"impossible_username::1001:1001::0:0:impossible_username User:/home/impossible_username:/bin/sh\n" grep impossible_username etc/master.passwd
40 export NUAGE_FAKE_ROOTDIR="$(pwd)"
42 printf "wheel:*:0:root\n" > etc/group
43 atf_check -e inline:"Argument should be a table\nArgument should be a table\n" /usr/libexec/flua $(atf_get_srcdir)/addgroup.lua
44 atf_check -o inline:"impossible_groupname:*:1001:\n" grep impossible_groupname etc/group
47 atf_init_test_cases() {
48 atf_add_test_case sethostname
49 atf_add_test_case addsshkey
50 atf_add_test_case adduser
51 atf_add_test_case addgroup