about summary refs log tree commit diff
path: root/nixpkgs/nixos/tests/ipfs.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/nixos/tests/ipfs.nix')
-rw-r--r--nixpkgs/nixos/tests/ipfs.nix11
1 files changed, 9 insertions, 2 deletions
diff --git a/nixpkgs/nixos/tests/ipfs.nix b/nixpkgs/nixos/tests/ipfs.nix
index 82234f969226..9c0ff5306e06 100644
--- a/nixpkgs/nixos/tests/ipfs.nix
+++ b/nixpkgs/nixos/tests/ipfs.nix
@@ -7,21 +7,28 @@ import ./make-test-python.nix ({ pkgs, ...} : {
   nodes.machine = { ... }: {
     services.ipfs = {
       enable = true;
+      # Also will add a unix domain socket socket API address, see module.
+      startWhenNeeded = true;
       apiAddress = "/ip4/127.0.0.1/tcp/2324";
     };
   };
 
   testScript = ''
     start_all()
-    machine.wait_for_unit("ipfs")
 
-    machine.wait_until_succeeds("ipfs --api /ip4/127.0.0.1/tcp/2324 id")
+    # IPv4 activation
+
+    machine.succeed("ipfs --api /ip4/127.0.0.1/tcp/2324 id")
     ipfs_hash = machine.succeed(
         "echo fnord | ipfs --api /ip4/127.0.0.1/tcp/2324 add | awk '{ print $2 }'"
     )
 
     machine.succeed(f"ipfs cat /ipfs/{ipfs_hash.strip()} | grep fnord")
 
+    # Unix domain socket activation
+
+    machine.stop_job("ipfs")
+
     ipfs_hash = machine.succeed(
         "echo fnord2 | ipfs --api /unix/run/ipfs.sock add | awk '{ print $2 }'"
     )