2 # install server and client, do some mounts, verify that it boots and works
5 if ! [ -x /tmp/autopkgtest-reboot ]; then
6 echo "SKIP: testbed does not support rebooting"
12 cat <<EOF >> /etc/exports
13 /home localhost(rw,no_root_squash,no_subtree_check)
14 /var/log/ localhost(ro,no_root_squash,subtree_check)
17 # set up client mounts
18 mkdir -p /mnt/nfs_home /mnt/nfs_log
19 cat << EOF >> /etc/fstab
20 localhost:/home /mnt/nfs_home nfs defaults,nofail 0 0
21 localhost:/var/log /mnt/nfs_log nfs defaults,nofail 0 0
31 # ensure we have our mounts
32 mount | grep 'localhost:.*nfs_home' || fail "nfs_home not mounted"
33 mount | grep 'localhost:.*nfs_log' || fail "nfs_log not mounted"
35 # test that we can write to NFS export and get it in /home
36 [ ! -e /home/hello.txt ] || fail "/home/hello.txt already exists"
37 echo world > /mnt/nfs_home/hello.txt
39 [ -e /home/hello.txt ] || fail "/home/hello.txt does not exist"
40 [ "$(cat /home/hello.txt)" = "world" ] || fail "/home/hello.txt has wrong contents"
42 # test that we can write to /home and get it in NFS
45 [ ! -e /mnt/nfs_home/hello.txt ] || fail "/mnt/nfs_home/hello.txt exists after removal"
47 # read-only, should fail
48 ! touch /mnt/nfs_log/pwned 2>/dev/null || fail "writing to r/o /mnt/nfs_log succeeded"
50 # our systemd jobs have a rather delicate dependency structure and run
51 # early; ensure that we did not run into any cycles
52 if [ -d /run/systemd/system ]; then
53 if journalctl | grep 'Found ordering cycle'; then
54 journalctl -p warning || true
55 fail "found ordering cycle in units"
60 if [ -z "$ADT_REBOOT_MARK" ]; then
62 /tmp/autopkgtest-reboot boot1