aboutsummaryrefslogtreecommitdiffhomepage
path: root/cmd/sharefs
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-12-27 22:52:12 +0900
committerOphestra <cat@gensokyo.uk>2025-12-27 23:14:08 +0900
commite42ea32dbe9283d14a7c0e8746059bc5ef97f6cd (patch)
tree9ddc8d4bb6438d00a8e04b1cdf07df5e3570f7eb /cmd/sharefs
parente7982b4ee9cc935d6b89f291087524cdee229d09 (diff)
nix: configure sharefs via fileSystems
Turns out this did not work because in the vm test harness, virtualisation.fileSystems completely and silently overrides fileSystems, causing its contents to not even be evaluated anymore. This is not documented as far as I can tell, and is not obvious by any stretch of the imagination. The current hack is cargo culted from nix-community/impermanence and hopefully lasts until this project fully replaces nix. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'cmd/sharefs')
-rw-r--r--cmd/sharefs/test/configuration.nix5
-rw-r--r--cmd/sharefs/test/test.py10
2 files changed, 6 insertions, 9 deletions
diff --git a/cmd/sharefs/test/configuration.nix b/cmd/sharefs/test/configuration.nix
index 388071b6..e1f43b72 100644
--- a/cmd/sharefs/test/configuration.nix
+++ b/cmd/sharefs/test/configuration.nix
@@ -1,4 +1,4 @@
-{ pkgs, config, ... }:
+{ pkgs, ... }:
{
users.users = {
alice = {
@@ -17,9 +17,6 @@
environment = {
# For benchmarking sharefs:
systemPackages = [ pkgs.fsmark ];
-
- # For sharefs option checks without adding to PATH:
- etc.sharefs.source = "${config.environment.hakurei.package}/libexec/sharefs";
};
virtualisation = {
diff --git a/cmd/sharefs/test/test.py b/cmd/sharefs/test/test.py
index 666feb5a..4b925c9c 100644
--- a/cmd/sharefs/test/test.py
+++ b/cmd/sharefs/test/test.py
@@ -2,14 +2,14 @@ start_all()
machine.wait_for_unit("multi-user.target")
# To check sharefs version:
-print(machine.succeed("/etc/sharefs -V"))
+print(machine.succeed("sharefs -V"))
-# Make sure sharefs did not terminate:
-machine.wait_for_unit("sharefs.service")
+# Make sure sharefs started:
+machine.wait_for_unit("sdcard.mount")
machine.succeed("mkdir /mnt")
def check_bad_opts_output(opts, want, source="/etc", privileged=False):
- output = machine.fail(("" if privileged else "sudo -u alice -i ") + f"/etc/sharefs -f -o source={source},{opts} /mnt 2>&1")
+ output = machine.fail(("" if privileged else "sudo -u alice -i ") + f"sharefs -f -o source={source},{opts} /mnt 2>&1")
if output != want:
raise Exception(f"unexpected output: {output}")
@@ -40,7 +40,7 @@ machine.succeed("rmdir /mnt")
# Unprivileged mount/unmount:
machine.succeed("sudo -u alice -i mkdir /home/alice/{sdcard,persistent}")
-machine.succeed("sudo -u alice -i /etc/sharefs -o source=/home/alice/persistent /home/alice/sdcard")
+machine.succeed("sudo -u alice -i sharefs -o source=/home/alice/persistent /home/alice/sdcard")
machine.succeed("sudo -u alice -i touch /home/alice/sdcard/check")
machine.succeed("sudo -u alice -i umount /home/alice/sdcard")
machine.succeed("sudo -u alice -i rm /home/alice/persistent/check")