Skip to content

Commit f29d9b7

Browse files
committed
test: attempt to reproduce issue from #39
Signed-off-by: Michael McCracken <mikmccra@cisco.com>
1 parent 528a53f commit f29d9b7

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

test/priv-mount.bats

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,42 @@ function setup() {
4040

4141
}
4242

43+
@test "RO mount/umount/remount/umount of good image works" {
44+
run atomfs-cover --debug mount ${BATS_SUITE_TMPDIR}/oci:test-squashfs $MP
45+
assert_success
46+
assert_file_exists $MP/1.README.md
47+
assert_file_exists $MP/random.txt
48+
assert_dir_exists $ATOMFS_TEST_RUN_DIR/meta/$MY_MNTNSNAME/
49+
50+
run atomfs-cover --debug umount $MP
51+
assert_success
52+
53+
# mount point and meta dir should exist but be empty:
54+
assert_dir_exists $MP
55+
assert [ -z $( ls -A $MP) ]
56+
assert_dir_exists $ATOMFS_TEST_RUN_DIR/meta/$MY_MNTNSNAME/
57+
assert [ -z $( ls -A $ATOMFS_TEST_RUN_DIR/meta/$MY_MNTNSNAME/ ) ]
58+
59+
# rinse, repeat:
60+
61+
run atomfs-cover --debug mount ${BATS_SUITE_TMPDIR}/oci:test-squashfs $MP
62+
assert_success
63+
assert_file_exists $MP/1.README.md
64+
assert_file_exists $MP/random.txt
65+
assert_dir_exists $ATOMFS_TEST_RUN_DIR/meta/$MY_MNTNSNAME/
66+
67+
run atomfs-cover --debug umount $MP
68+
assert_success
69+
70+
# mount point and meta dir should exist but be empty:
71+
assert_dir_exists $MP
72+
assert [ -z $( ls -A $MP) ]
73+
assert_dir_exists $ATOMFS_TEST_RUN_DIR/meta/$MY_MNTNSNAME/
74+
assert [ -z $( ls -A $ATOMFS_TEST_RUN_DIR/meta/$MY_MNTNSNAME/ ) ]
75+
76+
}
77+
78+
4379
@test "mount with missing verity data fails" {
4480
run atomfs-cover --debug mount ${BATS_SUITE_TMPDIR}/oci-no-verity:test-squashfs $MP
4581
assert_failure

0 commit comments

Comments
 (0)