nixos/tests/kubo: use subtests instead of comments
Specify the intent of parts of the tests by using `with subtest("...")` instead of a comment for more clarity.
This commit is contained in:
parent
bf97703f0e
commit
409df93c01
1 changed files with 29 additions and 29 deletions
|
@ -25,7 +25,7 @@
|
|||
testScript = ''
|
||||
start_all()
|
||||
|
||||
# IPv4 socket activation
|
||||
with subtest("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 --quieter"
|
||||
|
@ -34,7 +34,7 @@
|
|||
|
||||
machine.stop_job("ipfs")
|
||||
|
||||
# Unix domain socket activation
|
||||
with subtest("Unix domain socket activation"):
|
||||
ipfs_hash = machine.succeed(
|
||||
"echo fnord2 | ipfs --api /unix/run/ipfs.sock add --quieter"
|
||||
)
|
||||
|
@ -42,11 +42,11 @@
|
|||
f"ipfs --api /unix/run/ipfs.sock cat /ipfs/{ipfs_hash.strip()} | grep fnord2"
|
||||
)
|
||||
|
||||
# Test if setting dataDir works properly with the hardened systemd unit
|
||||
with subtest("Setting dataDir works properly with the hardened systemd unit"):
|
||||
machine.succeed("test -e /mnt/ipfs/config")
|
||||
machine.succeed("test ! -e /var/lib/ipfs/")
|
||||
|
||||
# Test FUSE mountpoint
|
||||
with subtest("FUSE mountpoint"):
|
||||
# The FUSE mount functionality is broken as of v0.13.0 and v0.17.0.
|
||||
# See https://github.com/ipfs/kubo/issues/9044.
|
||||
# Workaround: using CID Version 1 avoids that.
|
||||
|
@ -56,8 +56,8 @@
|
|||
|
||||
fuse.succeed(f"cat /ipfs/{ipfs_hash} | grep fnord3")
|
||||
|
||||
with subtest("Unmounting of /ipns and /ipfs"):
|
||||
# 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)
|
||||
|
||||
|
|
Loading…
Reference in a new issue