def _VerifyFilesystemUUID(self, tar, expected_uuid):
    tmp_dir = tempfile.mkdtemp(dir=self.tmp_root)
    tar_cmd = ['tar', '-xzf', tar, '-C', tmp_dir]
    self.assertEqual(subprocess.call(tar_cmd), 0)

    created_disk_path = os.path.join(tmp_dir, 'disk.raw')
    with utils.LoadDiskImage(created_disk_path) as devices:
      self.assertEqual(1, len(devices))
      self.assertEqual(expected_uuid, utils.GetUUID(devices[0]))
Verifies UUID of the first partition on disk matches the value.
dataset/ETHPy150Open GoogleCloudPlatform/compute-image-packages/legacy/gcimagebundle/gcimagebundlelib/tests/block_disk_test.py/FsRawDiskTest._VerifyFilesystemUUID