summaryrefslogtreecommitdiffstats
path: root/nixos/tests
diff options
context:
space:
mode:
authorFranz Pletz <fpletz@fnordicwalking.de>2016-12-04 01:46:09 +0100
committerGitHub <noreply@github.com>2016-12-04 01:46:09 +0100
commit69bee1b361afdd4e5348c210c9253995c8cb171a (patch)
tree3ec5dcabcd292dae0cb7475055da023d82ffe3bd /nixos/tests
parent2401f06801cd08ee06feffc42ad3ee568d354fb5 (diff)
parentf7c099bd8c9c2ad89408f3b689c06daa7ae654ac (diff)
Merge pull request #20770 from mguentner/more_ipfs
services: IPFS: add test and more config parameters
Diffstat (limited to 'nixos/tests')
-rw-r--r--nixos/tests/ipfs.nix37
1 files changed, 37 insertions, 0 deletions
diff --git a/nixos/tests/ipfs.nix b/nixos/tests/ipfs.nix
new file mode 100644
index 000000000000..92d742e4f37f
--- /dev/null
+++ b/nixos/tests/ipfs.nix
@@ -0,0 +1,37 @@
+
+import ./make-test.nix ({ pkgs, ...} : {
+ name = "ipfs";
+ meta = with pkgs.stdenv.lib.maintainers; {
+ maintainers = [ mguentner ];
+ };
+
+ nodes = {
+ adder =
+ { config, pkgs, ... }:
+ {
+ services.ipfs = {
+ enable = true;
+ gatewayAddress = "/ip4/127.0.0.1/tcp/2323";
+ apiAddress = "/ip4/127.0.0.1/tcp/2324";
+ };
+ };
+ getter =
+ { config, pkgs, ... }:
+ {
+ services.ipfs.enable = true;
+ };
+ };
+
+ testScript = ''
+ startAll;
+ $adder->waitForUnit("ipfs");
+ # * => needs ipfs dht (internet)
+ # $getter->waitForUnit("ipfs");
+ $adder->waitUntilSucceeds("ipfs --api /ip4/127.0.0.1/tcp/2324 id");
+ $adder->mustSucceed("([[ -n '$(ipfs --api /ip4/127.0.0.1/tcp/2324 config Addresses.gatewayAddress | grep /ip4/127.0.0.1/tcp/2323)' ]])");
+ # * $getter->waitUntilSucceeds("ipfs --api /ip4/127.0.0.1/tcp/5001 id");
+ # * my $ipfsHash = $adder->mustSucceed("echo fnord | ipfs --api /ip4/127.0.0.1/tcp/2324 add | cut -d' ' -f2");
+ $adder->mustSucceed("([[ -n '$(echo fnord | ipfs --api /ip4/127.0.0.1/tcp/2324 add | grep added)' ]])");
+ # * $getter->mustSucceed("ipfs --api /ip4/127.0.0.1/tcp/5001 cat $ipfsHash");
+ '';
+})