Skip to content

Commit

Permalink
tests: Skip some checks for btrfs errors with btrfs-progs 6.6.3
Browse files Browse the repository at this point in the history
Latest btrfs-progs return 0 for some subvolume actions that return
an error, we'll skip these checks on 6.6.3 for now.

Fixes: #993
  • Loading branch information
vojtechtrefny committed Jan 10, 2024
1 parent c78a646 commit 9508950
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions tests/btrfs_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,10 @@ def test_create_delete_subvolume(self):
self.assertEqual(len(subvols), 1)

# already there
with self.assertRaises(GLib.GError):
BlockDev.btrfs_create_subvolume(TEST_MNT, "subvol1", None)
version = self._get_btrfs_version()
if version != Version("6.6.3"):
with self.assertRaises(GLib.GError):
BlockDev.btrfs_create_subvolume(TEST_MNT, "subvol1", None)

succ = BlockDev.btrfs_delete_subvolume(TEST_MNT, "subvol1", None)
self.assertTrue(succ)
Expand All @@ -219,8 +221,9 @@ def test_create_delete_subvolume(self):
self.assertEqual(len(subvols), 0)

# already removed
with self.assertRaises(GLib.GError):
BlockDev.btrfs_delete_subvolume(TEST_MNT, "subvol1", None)
if version != Version("6.6.3"):
with self.assertRaises(GLib.GError):
BlockDev.btrfs_delete_subvolume(TEST_MNT, "subvol1", None)

succ = BlockDev.btrfs_create_subvolume(TEST_MNT, "subvol1", None)
self.assertTrue(succ)
Expand Down

0 comments on commit 9508950

Please sign in to comment.