Exemplo n.º 1
0
 def setUp(self):
     super(TestIpRouteCommand, self).setUp()
     self.parent.name = 'eth0'
     self.command = 'route'
     self.route_cmd = ip_lib.IpRouteCommand(self.parent)
     self.ip_version = 4
     self.table = 14
     self.metric = 100
     self.cidr = '192.168.45.100/24'
     self.ip = '10.0.0.1'
     self.gateway = '192.168.45.100'
     self.test_cases = [{'sample': GATEWAY_SAMPLE1,
                         'expected': {'gateway': '10.35.19.254',
                                      'metric': 100}},
                        {'sample': GATEWAY_SAMPLE2,
                         'expected': {'gateway': '10.35.19.254',
                                      'metric': 100}},
                        {'sample': GATEWAY_SAMPLE3,
                         'expected': None},
                        {'sample': GATEWAY_SAMPLE4,
                         'expected': {'gateway': '10.35.19.254'}},
                        {'sample': GATEWAY_SAMPLE5,
                         'expected': {'gateway': '192.168.99.1'}},
                        {'sample': GATEWAY_SAMPLE6,
                         'expected': {'gateway': '192.168.99.1',
                                      'metric': 100}}]
 def setUp(self):
     super(TestIpRouteCommand, self).setUp()
     self.parent.name = 'eth0'
     self.command = 'route'
     self.route_cmd = ip_lib.IpRouteCommand(self.parent)