示例#1
0
 def test_removeFs(self):
     """
     Tests mkimage.removeFs creating an image and removing it.
     Check also that removeFs doesn't remove anything
     outside mkimage._P_PAYLOAD_IMAGES
     """
     checkSudo(["mount", "-o", "loop", "somefile", "target"])
     checkSudo(["umount", "target"])
     iso_img = mkimage.mkIsoFs("vmId_iso", self.files)
     self.assertTrue(os.path.exists(iso_img))
     mkimage.removeFs(iso_img)
     self.assertFalse(os.path.exists(iso_img))
     self.assertRaises(Exception, mkimage.removeFs, self.workdir)
示例#2
0
 def test_removeFs(self):
     """
     Tests mkimage.removeFs creating an image and removing it.
     Check also that removeFs doesn't remove anything
     outside mkimage._P_PAYLOAD_IMAGES
     """
     checkSudo(["mount", "-o", "loop", "somefile", "target"])
     checkSudo(["umount", "target"])
     iso_img = mkimage.mkIsoFs("vmId_iso", self.files)
     self.assertTrue(os.path.exists(iso_img))
     mkimage.removeFs(iso_img)
     self.assertFalse(os.path.exists(iso_img))
     self.assertRaises(Exception, mkimage.removeFs, self.workdir)
示例#3
0
 def test_mkIsoFs(self, label):
     """
     Tests mkimage.mkIsoFs creating an image and checking its content
     """
     iso_img = mkimage.mkIsoFs("vmId_iso", self.files, label)
     self.assertTrue(os.path.exists(iso_img))
     m = mount.Mount(iso_img, self.workdir)
     m.mount(mntOpts='loop')
     try:
         self._check_content()
         self._check_label(iso_img, label)
     finally:
         m.umount()
示例#4
0
 def test_mkIsoFs(self, label):
     """
     Tests mkimage.mkIsoFs creating an image and checking its content
     """
     iso_img = mkimage.mkIsoFs("vmId_iso", self.files, label)
     self.assertTrue(os.path.exists(iso_img))
     m = mount.Mount(iso_img, self.workdir)
     try:
         m.mount(mntOpts='loop')
     except mount.MountError as e:
         raise SkipTest("Error mounting iso image: %s" % e)
     try:
         self._check_content()
         self._check_label(iso_img, label)
     finally:
         m.umount()