summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorLuke Macken <lmacken@redhat.com>2008-11-13 01:08:06 -0500
committerLuke Macken <lmacken@redhat.com>2008-11-13 01:08:06 -0500
commitae0bcd0f74fad4304f3a670b2ca5781d9709d113 (patch)
treef4b6eb46ad65869cedcbbff0a832402aa39c519e /tests
parent5c9ed52a6b880cea01f07cb1604b2c78157d54ba (diff)
Fix our Master Boot Record unit test.
Ensure that we can properly detect and reset blank MBRs.
Diffstat (limited to 'tests')
-rw-r--r--tests/test_creator.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/test_creator.py b/tests/test_creator.py
index 5832954..ab6015f 100644
--- a/tests/test_creator.py
+++ b/tests/test_creator.py
@@ -112,3 +112,21 @@ class TestLiveUSBCreator:
live.get_liveos()), 'isolinux', 'isolinux.cfg'))
assert os.path.exists(os.path.join(os.path.dirname(
live.get_liveos()), 'isolinux', 'vmlinuz0'))
+
+ def test_mbr(self):
+ """ Ensure that we can properly detect and reset a blank MBR """
+ live = self._get_creator()
+ live.detect_removable_drives()
+
+ # wipe out mbr
+ for drive in live.drives:
+ live.drive = drive
+
+ # Wipe out our MBR
+ print "Zeroing the MBR on %s" % drive
+ live.popen('dd if=/dev/zero of=%s bs=2 count=1' % drive)
+ assert live.blank_mbr()
+
+ # Reset the MBR
+ live.reset_mbr()
+ assert not live.blank_mbr()