summaryrefslogtreecommitdiff
path: root/libbtrfsutil
diff options
context:
space:
mode:
authorOmar Sandoval <osandov@fb.com>2018-03-29 00:53:57 -0700
committerDavid Sterba <dsterba@suse.com>2018-03-30 22:57:57 +0200
commitfeccd7a8180f3f0f48ca23692ad5f71783163450 (patch)
tree4f07698eb1b7774a4574e7e2fbe38d463eeaa49a /libbtrfsutil
parent7cdd58b2e92863f055c70ef7134d3a70760473c7 (diff)
libbtrfsutil: fix test assumptions about top-level subvolume
Since "btrfs-progs: mkfs: add uuid and otime to ROOT_ITEM of, FS_TREE", the top-level subvolume has a non-zero UUID, ctime, and otime. Fix the subvolume_info() test to not check for zero. Signed-off-by: Omar Sandoval <osandov@fb.com> Reviewed-by: Tomohiro Misono <misono.tomohiro@jp.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'libbtrfsutil')
-rw-r--r--libbtrfsutil/python/tests/test_subvolume.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/libbtrfsutil/python/tests/test_subvolume.py b/libbtrfsutil/python/tests/test_subvolume.py
index a46d4a3..93396cb 100644
--- a/libbtrfsutil/python/tests/test_subvolume.py
+++ b/libbtrfsutil/python/tests/test_subvolume.py
@@ -95,7 +95,8 @@ class TestSubvolume(BtrfsTestCase):
self.assertEqual(info.parent_id, 0)
self.assertEqual(info.dir_id, 0)
self.assertEqual(info.flags, 0)
- self.assertEqual(info.uuid, bytes(16))
+ self.assertIsInstance(info.uuid, bytes)
+ self.assertEqual(len(info.uuid), 16)
self.assertEqual(info.parent_uuid, bytes(16))
self.assertEqual(info.received_uuid, bytes(16))
self.assertNotEqual(info.generation, 0)
@@ -103,8 +104,8 @@ class TestSubvolume(BtrfsTestCase):
self.assertEqual(info.otransid, 0)
self.assertEqual(info.stransid, 0)
self.assertEqual(info.rtransid, 0)
- self.assertEqual(info.ctime, 0)
- self.assertEqual(info.otime, 0)
+ self.assertIsInstance(info.ctime, float)
+ self.assertIsInstance(info.otime, float)
self.assertEqual(info.stime, 0)
self.assertEqual(info.rtime, 0)
@@ -117,6 +118,7 @@ class TestSubvolume(BtrfsTestCase):
self.assertEqual(info.dir_id, 256)
self.assertEqual(info.flags, 0)
self.assertIsInstance(info.uuid, bytes)
+ self.assertEqual(len(info.uuid), 16)
self.assertEqual(info.parent_uuid, bytes(16))
self.assertEqual(info.received_uuid, bytes(16))
self.assertNotEqual(info.generation, 0)