nixos/kubo: Test Kubo restart after a crash

Move strip() to definition

Co-authored-by: Luflosi <Luflosi@users.noreply.github.com>
This commit is contained in:
Karmanyaah Malhotra 2023-02-05 18:35:29 -06:00
parent 4bd622cd9d
commit 5fb09c9e3a

View File

@ -55,8 +55,15 @@ import ./make-test-python.nix ({ pkgs, ...} : {
# Workaround: using CID Version 1 avoids that.
ipfs_hash = fuse.succeed(
"echo fnord3 | ipfs --api /ip4/127.0.0.1/tcp/2324 add --quieter --cid-version=1"
)
).strip()
fuse.succeed(f"cat /ipfs/{ipfs_hash.strip()} | grep fnord3")
fuse.succeed(f"cat /ipfs/{ipfs_hash} | grep fnord3")
# Force Kubo to crash and wait for it to restart
# Tests the unmounting of /ipns and /ipfs
fuse.systemctl("kill --signal=SIGKILL ipfs.service")
fuse.wait_for_unit("ipfs.service", timeout = 30)
fuse.succeed(f"cat /ipfs/{ipfs_hash} | grep fnord3")
'';
})