Example #1
0
 def test_get_fs_uuid_failure(self):
     dev = '/dev/sdgg'
     self.mox.StubOutWithMock(ovz_utils, 'execute')
     ovz_utils.execute(
         'blkid', '-o', 'value', '-s', 'UUID', dev,
         raise_on_error=False, run_as_root=True).AndReturn('\n')
     self.mox.ReplayAll()
     fs_uuid = ovz_utils.get_fs_uuid(dev)
     self.assertFalse(fs_uuid)
Example #2
0
 def test_get_fs_uuid_success(self):
     dev = '/dev/sdgg'
     self.mox.StubOutWithMock(ovz_utils, 'execute')
     ovz_utils.execute(
         'blkid', '-o', 'value', '-s', 'UUID', dev,
         raise_on_error=False, run_as_root=True).AndReturn(fakes.BLKID)
     self.mox.ReplayAll()
     fs_uuid = ovz_utils.get_fs_uuid(dev)
     self.assertEqual(fs_uuid, fakes.BLKID.strip())