[PATCH][pykickstart] Add leavebootorder test

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This adds a test for the new leavebootorder option.  The first is what you might
see in a kickstart file without this option.  And the second is with this option
enabled.

---
 pykickstart/commands/bootloader.py |    8 ++++++++
 tests/commands/bootloader.py       |    8 ++++++++
 2 files changed, 16 insertions(+)

diff --git a/pykickstart/commands/bootloader.py b/pykickstart/commands/bootloader.py
index 8a660a8..0eb2a1b 100644
--- a/pykickstart/commands/bootloader.py
+++ b/pykickstart/commands/bootloader.py
@@ -246,6 +246,14 @@ class F18_Bootloader(F17_Bootloader):
 
         self.leavebootorder = kwargs.get("leavebootorder", False)
 
+    def _getArgsAsStr(self):
+        ret = F17_Bootloader._getArgsAsStr(self)
+
+        if self.leavebootorder:
+            ret += " --leavebootorder"
+
+        return ret
+
     def _getParser(self):
         op = F17_Bootloader._getParser(self)
         op.add_option("--leavebootorder", dest="leavebootorder", action="store_true", default=False)
diff --git a/tests/commands/bootloader.py b/tests/commands/bootloader.py
index d3ac7ab..8e916a6 100644
--- a/tests/commands/bootloader.py
+++ b/tests/commands/bootloader.py
@@ -121,6 +121,14 @@ class F17_TestCase(F15_TestCase):
         self.assert_parse("bootloader --location=mbr --boot-drive=sda")
         self.assert_parse("bootloader --location=mbr --boot-drive=/dev/disk/by-path/pci-0000:00:0e.0-scsi-0:0:0:0")
 
+class F18_TestCase(F17_TestCase):
+    def runTest(self, iscrypted=False):
+        # run parent tests
+        F17_TestCase.runTest(self, iscrypted=iscrypted)
+
+        self.assert_parse("bootloader --location=mbr --timeout=5 --append=\"rhgb quiet\"")
+        self.assert_parse("bootloader --location=mbr --timeout=5 --leavebootorder --append=\"rhgb quiet\"")
+
 class RHEL5_TestCase(FC4_TestCase):
     def runTest(self, iscrypted=False):
         FC4_TestCase.runTest(self, iscrypted)
-- 
1.7.10.1

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux