Ejemplo n.º 1
0
 def test_sorting(self):
     from pyanaconda.bootloader import Arguments
     a = Arguments(["ip=eth0:dhcp", "rhgb", "quiet",
                    "root=/dev/mapper/destroyers-rubies", "rd.md=0",
                    "rd.luks=0"])
     # 'rhgb quiet' should be the final entries:
     assert(str(a).endswith("rhgb quiet"))
Ejemplo n.º 2
0
 def test_basic(self):
     from pyanaconda.bootloader import Arguments
     a = Arguments()
     a.update(set(["a", "b", "c"]))
     b = Arguments()
     b.add("b")
     diff = a - b
     self.assertEqual(diff, set(["a", "c"]))
     self.assertIsInstance(diff, Arguments)
     assert(str(diff) in ["a c", "c a"])
Ejemplo n.º 3
0
    def test_merge_ip(self):
        from pyanaconda.bootloader import Arguments
        # test that _merge_ip() doesnt break the simple case:
        a = Arguments(["one", "two", "ip=eth0:dhcp"])
        a._merge_ip()
        self.assertEqual(a, Arguments(["one", "two", "ip=eth0:dhcp"]))

        # test that it does what it's supposed to:
        a = Arguments(["one", "two", "ip=eth0:dhcp", "ip=eth0:auto6",
                       "ip=wlan0:dhcp",
                       "ip=10.34.102.102::10.34.39.255:24:aklab:eth2:none"])
        a._merge_ip()
        self.assertEqual(a, set([
                    "one", "two",
                    "ip=wlan0:dhcp",
                    "ip=10.34.102.102::10.34.39.255:24:aklab:eth2:none",
                    "ip=eth0:auto6,dhcp"]))
Ejemplo n.º 4
0
 def test_output_with_merge(self):
     from pyanaconda.bootloader import Arguments
     a = Arguments(["ip=eth0:dhcp"])
     self.assertEqual(str(a), "ip=eth0:dhcp")
     a = Arguments(["ip=eth0:dhcp", "ip=eth0:auto6"])
     assert(str(a) in ["ip=eth0:auto6,dhcp", "ip=eth0:dhcp,auto6"])