aboutsummaryrefslogtreecommitdiffhomepage
path: root/cmd/sharefs/test
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-12-27 02:25:18 +0900
committerOphestra <cat@gensokyo.uk>2025-12-27 02:30:28 +0900
commit6d3bd27220c80eb58a11b75054fbbcf67e50cc28 (patch)
tree68dd700e8988c9591cc8b703d0146292962ff07e /cmd/sharefs/test
parenta27305cb4aa4e382b9474175139ab72bff220fd6 (diff)
cmd/sharefs: expand fuse_main
This change should not change behaviour other than making output more consistent. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'cmd/sharefs/test')
-rw-r--r--cmd/sharefs/test/test.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/cmd/sharefs/test/test.py b/cmd/sharefs/test/test.py
index 9b30379c..cd1d8972 100644
--- a/cmd/sharefs/test/test.py
+++ b/cmd/sharefs/test/test.py
@@ -1,6 +1,13 @@
start_all()
machine.wait_for_unit("multi-user.target")
+# To check sharefs version:
+print(machine.succeed("/etc/sharefs -V"))
+
+# Make sure sharefs did not terminate:
+machine.wait_for_unit("sharefs.service")
+
+machine.succeed("mkdir /mnt")
def check_bad_opts_output(opts, want, privileged=False):
output = machine.fail(("" if privileged else "sudo -u alice -i ") + f"/etc/sharefs -f -o source=/proc/nonexistent,{opts} /mnt 2>&1")
if output != want:
@@ -26,12 +33,17 @@ check_bad_opts_output("allow_other", "sharefs: setuid and setgid must not be 0\n
check_bad_opts_output("setuid=1023", "sharefs: setuid and setgid must not be 0\n", privileged=True)
check_bad_opts_output("setgid=1023", "sharefs: setuid and setgid must not be 0\n", privileged=True)
+# Make sure nothing actually got mounted:
+machine.fail("umount /mnt")
+machine.succeed("rmdir /mnt")
+
# Benchmark sharefs:
machine.succeed("fs_mark -v -d /sdcard/fs_mark -l /tmp/fs_log.txt")
machine.copy_from_vm("/tmp/fs_log.txt", "")
# Check permissions:
-machine.succeed("ls /var/lib/hakurei/sdcard/fs_mark")
+machine.succeed("sudo -u sharefs touch /var/lib/hakurei/sdcard/fs_mark/.check")
+machine.succeed("sudo -u sharefs rm /var/lib/hakurei/sdcard/fs_mark/.check")
machine.succeed("sudo -u alice rm -rf /sdcard/fs_mark")
machine.fail("ls /var/lib/hakurei/sdcard/fs_mark")