示例#1
0
 def test_eos_static_routes_parsed(self):
     set_module_args(
         dict(running_config=
              "ipv6 route vrf testvrf 1200:10::/64 Ethernet1 55",
              state="parsed"))
     commands = ['ipv6 route vrf testvrf 1200:10::/64 Ethernet1 55']
     result = self.execute_module(changed=False)
     parsed_commands = []
     for cmds in result['parsed']:
         cfg = add_commands(cmds)
         parsed_commands.append(cfg)
     parsed_commands = list(itertools.chain(*parsed_commands))
     self.assertEqual(sorted(parsed_commands), sorted(commands),
                      result['parsed'])
 def test_eos_static_routes_gathered(self):
     set_module_args(dict(config=[], state="gathered"))
     result = self.execute_module(changed=False,
                                  filename="eos_static_routes_config.cfg")
     commands = []
     for gathered_cmds in result["gathered"]:
         cfg = add_commands(gathered_cmds)
         commands.append(cfg)
     commands = list(itertools.chain(*commands))
     config_commands = [
         "ip route 10.1.1.0/24 Management1",
         "ipv6 route 1000:10::/64 Ethernet1 67 tag 98",
         "ip route vrf testvrf 120.1.1.0/24 Ethernet1 23",
     ]
     self.assertEqual(sorted(config_commands), sorted(commands),
                      result["gathered"])