Example #1
0
 def bond_options_ksdata_to_dbus_test(self):
     cases = [
         ("mode=802.3ad,miimon=100,xmit_hash_policy=layer2+3,lacp_rate=fast",
          {
              "mode": "802.3ad",
              "miimon": "100",
              "xmit_hash_policy": "layer2+3",
              "lacp_rate": "fast"
          }),
         ("mode=balance-alb,arp_interval=100,arp_ip_target=192.168.122.1", {
             "mode": "balance-alb",
             "arp_interval": "100",
             "arp_ip_target": "192.168.122.1"
         }),
         ("mode=active-backup,primary=eth1,miimon=100,fail_over_mac=2", {
             "mode": "active-backup",
             "primary": "eth1",
             "miimon": "100",
             "fail_over_mac": "2"
         }),
         ("option1=value1,value2;option2=value3", {
             "option1": "value1,value2",
             "option2": "value3"
         }),
     ]
     for bondopts, dbus_dict in cases:
         self.assertEqual(network.bond_options_ksdata_to_dbus(bondopts),
                          dbus_dict)
Example #2
0
 def bond_options_ksdata_to_dbus_test(self):
     cases = [("mode=802.3ad,miimon=100,xmit_hash_policy=layer2+3,lacp_rate=fast",
               {"mode":"802.3ad",
                  "miimon":"100",
                  "xmit_hash_policy":"layer2+3",
                  "lacp_rate":"fast"}),
              ("mode=balance-alb,arp_interval=100,arp_ip_target=192.168.122.1",
               {"mode":"balance-alb",
                "arp_interval":"100",
                "arp_ip_target":"192.168.122.1"}),
              ("mode=active-backup,primary=eth1,miimon=100,fail_over_mac=2",
               {"mode":"active-backup",
                "primary":"eth1",
                "miimon":"100",
                "fail_over_mac":"2"}),
              ("option1=value1,value2;option2=value3",
               {"option1":"value1,value2",
                "option2":"value3"}),
             ]
     for bondopts, dbus_dict in cases:
         self.assertEqual(network.bond_options_ksdata_to_dbus(bondopts), dbus_dict)