]> www.infradead.org Git - users/hch/nvmetcli.git/commitdiff
tests: check that the nguid is properly saved and restored
authorChristoph Hellwig <hch@lst.de>
Sat, 26 Mar 2016 17:14:02 +0000 (18:14 +0100)
committerChristoph Hellwig <hch@lst.de>
Sat, 26 Mar 2016 19:20:15 +0000 (20:20 +0100)
Signed-off-by: Christoph Hellwig <hch@lst.de>
nvmet/test_nvmet.py

index 7696590bb9d9d56ca531017da70d8b5826184f5e..b092baa42e36096463f63d0dcbc080a804c1629e 100644 (file)
@@ -156,6 +156,8 @@ class TestNvmet(unittest.TestCase):
         n.set_attr('device', 'path', '/dev/ram0')
         n.set_enable(1)
 
+        nguid = n.get_attr('device', 'nguid')
+
         root.save_to_file('test.json')
         root.clear_existing()
         root.restore_from_file('test.json')
@@ -174,3 +176,4 @@ class TestNvmet(unittest.TestCase):
         # and check everything is still the same
         self.assertTrue(n.get_enable())
         self.assertEqual(n.get_attr('device', 'path'), '/dev/ram0')
+        self.assertEqual(n.get_attr('device', 'nguid'), nguid)