Skip to content

Commit

Permalink
test: Properly clean up after stratis test failures
Browse files Browse the repository at this point in the history
If TestStorageStratis.testBasic failed at a point when stratis
filesystems were mounted, the `pool stop` and `pool destroy` commands
would both fail, with "low-level ioctl error due to nix error" [sic] and
"filesystems remaining on pool" respectively. This also prevented the
loop devices from being cleaned up.

This broke the subsequent tests very hard, so that retries and testCLI
would all fail.
  • Loading branch information
martinpitt authored and mvollmer committed Nov 3, 2023
1 parent f1fe2a1 commit f959a07
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/verify/check-storage-stratis
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ class TestStorageStratis(storagelib.StorageCase):
self.addCleanup(exe,
"stratis report | jq -r '.pools[] | .name' |"
f"xargs -n1 --no-run-if-empty stratis pool stop {self.stop_type_opt}")
self.addCleanup(exe,
"mount | grep mapper/stratis | awk '{print $1}' | xargs --no-run-if-empty umount")

def testBasic(self):
m = self.machine
Expand Down

0 comments on commit f959a07

Please sign in to comment.