Example #1
0
    def test_mkFloppyFs_overwrite(self, label):
        """
        Test that mkimage.mkFloppyFs handle situation when the floppy image
        already exists.

        Requires root permissions for writing into the floppy image.
        """
        floppy = mkimage.mkFloppyFs("vmId_floppy", self.files, label)
        self.assertTrue(os.path.exists(floppy))
        # Now try again with the floppy image already in place
        floppy = mkimage.mkFloppyFs("vmId_floppy", self.files, label)
        self.assertTrue(os.path.exists(floppy))
        m = mount.Mount(floppy, self.workdir)
        m.mount(mntOpts='loop')
        try:
            self._check_content(checkPerms=False)
            self._check_label(floppy, label)
        finally:
            m.umount()
Example #2
0
 def test_mkFloppyFs(self, label):
     """
     Tests mkimage.mkFloppyFs creating an image and checking its content.
     Requires root permissions for writing into the floppy image.
     """
     floppy = mkimage.mkFloppyFs("vmId_floppy", self.files, label)
     self.assertTrue(os.path.exists(floppy))
     m = mount.Mount(floppy, self.workdir)
     m.mount(mntOpts='loop')
     try:
         self._check_content(checkPerms=False)
         self._check_label(floppy, label)
     finally:
         m.umount()
Example #3
0
 def test_mkFloppyFs(self, label):
     """
     Tests mkimage.mkFloppyFs creating an image and checking its content.
     Requires root permissions for writing into the floppy image.
     """
     floppy = mkimage.mkFloppyFs("vmId_floppy", self.files, label)
     self.assertTrue(os.path.exists(floppy))
     m = mount.Mount(floppy, self.workdir)
     m.mount(mntOpts='loop')
     try:
         self._check_content(checkPerms=False)
         self._check_label(floppy, label)
     finally:
         m.umount()