nix: configure sharefs via fileSystems
Some checks failed
Test / Create distribution (push) Successful in 43s
Test / Sandbox (push) Successful in 2m27s
Test / Hakurei (push) Successful in 3m24s
Test / ShareFS (push) Successful in 3m25s
Test / Hpkg (push) Successful in 4m7s
Test / Hakurei (race detector) (push) Successful in 5m33s
Test / Sandbox (race detector) (push) Successful in 4m36s
Test / Flake checks (push) Failing after 1m36s
Some checks failed
Test / Create distribution (push) Successful in 43s
Test / Sandbox (push) Successful in 2m27s
Test / Hakurei (push) Successful in 3m24s
Test / ShareFS (push) Successful in 3m25s
Test / Hpkg (push) Successful in 4m7s
Test / Hakurei (race detector) (push) Successful in 5m33s
Test / Sandbox (race detector) (push) Successful in 4m36s
Test / Flake checks (push) Failing after 1m36s
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>
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user