2020-05-08 10:48:47 +01:00
|
|
|
import ./make-test-python.nix ({ pkgs, ...} : {
|
2016-11-26 19:07:01 +00:00
|
|
|
name = "ipfs";
|
|
|
|
meta = with pkgs.stdenv.lib.maintainers; {
|
|
|
|
maintainers = [ mguentner ];
|
|
|
|
};
|
|
|
|
|
2020-05-08 10:48:47 +01:00
|
|
|
nodes.machine = { ... }: {
|
|
|
|
services.ipfs = {
|
|
|
|
enable = true;
|
|
|
|
apiAddress = "/ip4/127.0.0.1/tcp/2324";
|
|
|
|
};
|
2016-11-26 19:07:01 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
testScript = ''
|
2020-05-08 10:48:47 +01:00
|
|
|
start_all()
|
|
|
|
machine.wait_for_unit("ipfs")
|
2017-08-30 14:20:10 +01:00
|
|
|
|
2020-05-08 10:48:47 +01:00
|
|
|
machine.wait_until_succeeds("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 }'"
|
|
|
|
)
|
2017-08-30 14:20:10 +01:00
|
|
|
|
2020-05-08 10:48:47 +01:00
|
|
|
machine.succeed(f"ipfs cat /ipfs/{ipfs_hash.strip()} | grep fnord")
|
|
|
|
'';
|
2016-11-26 19:07:01 +00:00
|
|
|
})
|