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