about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorLuflosi <luflosi@luflosi.de>2023-04-14 02:43:41 +0200
committerLuflosi <luflosi@luflosi.de>2023-04-15 15:24:43 +0200
commitbf97703f0e160307cc9318029b05a028e95f6ce3 (patch)
treee7cf9314bb383b8f0a978bceac5483b887d21cd7 /nixos
parent62bff9ab15f7c23f7db90664c53d13b080bf34b1 (diff)
nixos/tests/kubo: clean up code
- Use `runTest` instead of `handleTest`, which simplifies the code a little
- Use `lib.maintainers` instead of `pkgs.lib.maintainers`
- Use `ipfs add --quieter` instead of `ipfs add | awk '{ print $2 }'`
- Whitespace and comment changes
Diffstat (limited to 'nixos')
-rw-r--r--nixos/tests/all-tests.nix2
-rw-r--r--nixos/tests/kubo.nix17
2 files changed, 8 insertions, 11 deletions
diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix
index 2ad1ec35022a4..201dc3d72b506 100644
--- a/nixos/tests/all-tests.nix
+++ b/nixos/tests/all-tests.nix
@@ -359,7 +359,7 @@ in {
   ksm = handleTest ./ksm.nix {};
   kthxbye = handleTest ./kthxbye.nix {};
   kubernetes = handleTestOn ["x86_64-linux"] ./kubernetes {};
-  kubo = handleTest ./kubo.nix {};
+  kubo = runTest ./kubo.nix;
   ladybird = handleTest ./ladybird.nix {};
   languagetool = handleTest ./languagetool.nix {};
   latestKernel.login = handleTest ./login.nix { latestKernel = true; };
diff --git a/nixos/tests/kubo.nix b/nixos/tests/kubo.nix
index 4f6bc0ef1cfac..08468e31bf779 100644
--- a/nixos/tests/kubo.nix
+++ b/nixos/tests/kubo.nix
@@ -1,6 +1,6 @@
-import ./make-test-python.nix ({ pkgs, ...} : {
+{ lib, ...} : {
   name = "kubo";
-  meta = with pkgs.lib.maintainers; {
+  meta = with lib.maintainers; {
     maintainers = [ mguentner Luflosi ];
   };
 
@@ -25,21 +25,18 @@ import ./make-test-python.nix ({ pkgs, ...} : {
   testScript = ''
     start_all()
 
-    # IPv4 activation
-
+    # IPv4 socket 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 }'"
+        "echo fnord | ipfs --api /ip4/127.0.0.1/tcp/2324 add --quieter"
     )
-
     machine.succeed(f"ipfs cat /ipfs/{ipfs_hash.strip()} | grep fnord")
 
-    # Unix domain socket activation
-
     machine.stop_job("ipfs")
 
+    # Unix domain socket activation
     ipfs_hash = machine.succeed(
-        "echo fnord2 | ipfs --api /unix/run/ipfs.sock add | awk '{ print $2 }'"
+        "echo fnord2 | ipfs --api /unix/run/ipfs.sock add --quieter"
     )
     machine.succeed(
         f"ipfs --api /unix/run/ipfs.sock cat /ipfs/{ipfs_hash.strip()} | grep fnord2"
@@ -66,4 +63,4 @@ import ./make-test-python.nix ({ pkgs, ...} : {
 
     fuse.succeed(f"cat /ipfs/{ipfs_hash} | grep fnord3")
   '';
-})
+}