Loading nixos/tests/all-tests.nix +1 −1 Original line number Diff line number Diff line Loading @@ -424,7 +424,7 @@ in { ksm = handleTest ./ksm.nix {}; kthxbye = handleTest ./kthxbye.nix {}; kubernetes = handleTestOn ["x86_64-linux"] ./kubernetes {}; kubo = runTest ./kubo.nix; kubo = import ./kubo { inherit recurseIntoAttrs runTest; }; ladybird = handleTest ./ladybird.nix {}; languagetool = handleTest ./languagetool.nix {}; latestKernel.login = handleTest ./login.nix { latestKernel = true; }; Loading nixos/tests/kubo/default.nix 0 → 100644 +5 −0 Original line number Diff line number Diff line { recurseIntoAttrs, runTest }: recurseIntoAttrs { kubo = runTest ./kubo.nix; kubo-fuse = runTest ./kubo-fuse.nix; } nixos/tests/kubo/kubo-fuse.nix 0 → 100644 +42 −0 Original line number Diff line number Diff line { lib, ...} : { name = "kubo-fuse"; meta = with lib.maintainers; { maintainers = [ mguentner Luflosi ]; }; nodes.machine = { config, ... }: { services.kubo = { enable = true; autoMount = true; }; users.users.alice = { isNormalUser = true; extraGroups = [ config.services.kubo.group ]; }; users.users.bob = { isNormalUser = true; }; }; testScript = '' start_all() with subtest("FUSE mountpoint"): machine.fail("echo a | su bob -l -c 'ipfs add --quieter'") # The FUSE mount functionality is broken as of v0.13.0 and v0.17.0. # See https://github.com/ipfs/kubo/issues/9044. # Workaround: using CID Version 1 avoids that. ipfs_hash = machine.succeed( "echo fnord3 | su alice -l -c 'ipfs add --quieter --cid-version=1'" ).strip() machine.succeed(f"cat /ipfs/{ipfs_hash} | grep fnord3") with subtest("Unmounting of /ipns and /ipfs"): # Force Kubo to crash and wait for it to restart machine.systemctl("kill --signal=SIGKILL ipfs.service") machine.wait_for_unit("ipfs.service", timeout = 30) machine.succeed(f"cat /ipfs/{ipfs_hash} | grep fnord3") ''; } nixos/tests/kubo.nix→nixos/tests/kubo/kubo.nix +0 −32 Original line number Diff line number Diff line Loading @@ -18,20 +18,6 @@ }; }; nodes.fuse = { config, ... }: { services.kubo = { enable = true; autoMount = true; }; users.users.alice = { isNormalUser = true; extraGroups = [ config.services.kubo.group ]; }; users.users.bob = { isNormalUser = true; }; }; testScript = '' start_all() Loading Loading @@ -63,23 +49,5 @@ with subtest("Setting dataDir works properly with the hardened systemd unit"): machine.succeed("test -e /mnt/ipfs/config") machine.succeed("test ! -e /var/lib/ipfs/") with subtest("FUSE mountpoint"): fuse.fail("echo a | su bob -l -c 'ipfs add --quieter'") # The FUSE mount functionality is broken as of v0.13.0 and v0.17.0. # See https://github.com/ipfs/kubo/issues/9044. # Workaround: using CID Version 1 avoids that. ipfs_hash = fuse.succeed( "echo fnord3 | su alice -l -c 'ipfs add --quieter --cid-version=1'" ).strip() fuse.succeed(f"cat /ipfs/{ipfs_hash} | grep fnord3") with subtest("Unmounting of /ipns and /ipfs"): # Force Kubo to crash and wait for it to restart fuse.systemctl("kill --signal=SIGKILL ipfs.service") fuse.wait_for_unit("ipfs.service", timeout = 30) fuse.succeed(f"cat /ipfs/{ipfs_hash} | grep fnord3") ''; } pkgs/applications/networking/kubo/default.nix +5 −1 Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ , buildGoModule , fetchurl , nixosTests , callPackage }: buildGoModule rec { Loading Loading @@ -29,7 +30,10 @@ buildGoModule rec { subPackages = [ "cmd/ipfs" ]; passthru.tests.kubo = nixosTests.kubo; passthru.tests = { inherit (nixosTests) kubo; repoVersion = callPackage ./test-repoVersion.nix {}; }; vendorHash = null; Loading Loading
nixos/tests/all-tests.nix +1 −1 Original line number Diff line number Diff line Loading @@ -424,7 +424,7 @@ in { ksm = handleTest ./ksm.nix {}; kthxbye = handleTest ./kthxbye.nix {}; kubernetes = handleTestOn ["x86_64-linux"] ./kubernetes {}; kubo = runTest ./kubo.nix; kubo = import ./kubo { inherit recurseIntoAttrs runTest; }; ladybird = handleTest ./ladybird.nix {}; languagetool = handleTest ./languagetool.nix {}; latestKernel.login = handleTest ./login.nix { latestKernel = true; }; Loading
nixos/tests/kubo/default.nix 0 → 100644 +5 −0 Original line number Diff line number Diff line { recurseIntoAttrs, runTest }: recurseIntoAttrs { kubo = runTest ./kubo.nix; kubo-fuse = runTest ./kubo-fuse.nix; }
nixos/tests/kubo/kubo-fuse.nix 0 → 100644 +42 −0 Original line number Diff line number Diff line { lib, ...} : { name = "kubo-fuse"; meta = with lib.maintainers; { maintainers = [ mguentner Luflosi ]; }; nodes.machine = { config, ... }: { services.kubo = { enable = true; autoMount = true; }; users.users.alice = { isNormalUser = true; extraGroups = [ config.services.kubo.group ]; }; users.users.bob = { isNormalUser = true; }; }; testScript = '' start_all() with subtest("FUSE mountpoint"): machine.fail("echo a | su bob -l -c 'ipfs add --quieter'") # The FUSE mount functionality is broken as of v0.13.0 and v0.17.0. # See https://github.com/ipfs/kubo/issues/9044. # Workaround: using CID Version 1 avoids that. ipfs_hash = machine.succeed( "echo fnord3 | su alice -l -c 'ipfs add --quieter --cid-version=1'" ).strip() machine.succeed(f"cat /ipfs/{ipfs_hash} | grep fnord3") with subtest("Unmounting of /ipns and /ipfs"): # Force Kubo to crash and wait for it to restart machine.systemctl("kill --signal=SIGKILL ipfs.service") machine.wait_for_unit("ipfs.service", timeout = 30) machine.succeed(f"cat /ipfs/{ipfs_hash} | grep fnord3") ''; }
nixos/tests/kubo.nix→nixos/tests/kubo/kubo.nix +0 −32 Original line number Diff line number Diff line Loading @@ -18,20 +18,6 @@ }; }; nodes.fuse = { config, ... }: { services.kubo = { enable = true; autoMount = true; }; users.users.alice = { isNormalUser = true; extraGroups = [ config.services.kubo.group ]; }; users.users.bob = { isNormalUser = true; }; }; testScript = '' start_all() Loading Loading @@ -63,23 +49,5 @@ with subtest("Setting dataDir works properly with the hardened systemd unit"): machine.succeed("test -e /mnt/ipfs/config") machine.succeed("test ! -e /var/lib/ipfs/") with subtest("FUSE mountpoint"): fuse.fail("echo a | su bob -l -c 'ipfs add --quieter'") # The FUSE mount functionality is broken as of v0.13.0 and v0.17.0. # See https://github.com/ipfs/kubo/issues/9044. # Workaround: using CID Version 1 avoids that. ipfs_hash = fuse.succeed( "echo fnord3 | su alice -l -c 'ipfs add --quieter --cid-version=1'" ).strip() fuse.succeed(f"cat /ipfs/{ipfs_hash} | grep fnord3") with subtest("Unmounting of /ipns and /ipfs"): # Force Kubo to crash and wait for it to restart fuse.systemctl("kill --signal=SIGKILL ipfs.service") fuse.wait_for_unit("ipfs.service", timeout = 30) fuse.succeed(f"cat /ipfs/{ipfs_hash} | grep fnord3") ''; }
pkgs/applications/networking/kubo/default.nix +5 −1 Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ , buildGoModule , fetchurl , nixosTests , callPackage }: buildGoModule rec { Loading Loading @@ -29,7 +30,10 @@ buildGoModule rec { subPackages = [ "cmd/ipfs" ]; passthru.tests.kubo = nixosTests.kubo; passthru.tests = { inherit (nixosTests) kubo; repoVersion = callPackage ./test-repoVersion.nix {}; }; vendorHash = null; Loading