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
This commit is contained in:
Luflosi 2023-04-14 02:43:41 +02:00
parent 62bff9ab15
commit bf97703f0e
No known key found for this signature in database
GPG Key ID: 4E41E29EDCC345D0
2 changed files with 8 additions and 11 deletions

View File

@ -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; };

View File

@ -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")
'';
})
}