Exemplo n.º 1
0
 def test_analyze_inventory(self):
     self.args.store = "config"
     self.args.nodeid = "132319289050514"
     with capture.capture(analyze.analyze_inventory, self.args) as output:
         self.assertTrue("132319289050514" in output)
     self.args.store = "operational"
     self.args.nodeid = "233201308854882"
     # not a great test, but there are no flows in the operational
     with capture.capture(analyze.analyze_inventory, self.args) as output:
         self.assertTrue("Inventory Operational" in output)
Exemplo n.º 2
0
 def test_analyze_inventory(self):
     self.args.store = "config"
     self.args.nodeid = "132319289050514"
     with capture.capture(analyze.analyze_inventory, self.args) as output:
         self.assertTrue("132319289050514" in output)
     self.args.store = "operational"
     self.args.nodeid = "233201308854882"
     # not a great test, but there are no flows in the operational
     with capture.capture(analyze.analyze_inventory, self.args) as output:
         self.assertTrue("Inventory Operational" in output)
Exemplo n.º 3
0
 def test_show_tables(self):
     expected = "[0, 17, 18, 19, 20, 21, 22, 23, 24, 36, 38, " \
                "43, 45, 48, 50, 51, 52, 55, 60, 80, 81, 210, " \
                "211, 212, 213, 214, 215, 216, 217, 90, 220, " \
                "239, 240, 241, 242, 243, 244, 245, 246, 247]\n"
     with capture.capture(show.show_tables, self.args) as output:
         self.assertEqual(expected, output)
Exemplo n.º 4
0
 def test_show_flows_all(self):
     self.args.flowtype = "all"
     self.args.pretty_print = True
     self.args.modules = None
     self.args.metaonly = None
     with capture.capture(show.show_flows, self.args) as output:
         self.assertTrue("FlowId:748517893535270tunf68aef23130" in output)
Exemplo n.º 5
0
 def test_analyze_nodes_cli(self):
     parser = root_cli.create_parser()
     args = parser.parse_args([
         "netvirt", "analyze", "nodes", "-p",
         "--path=" + tests.get_resources_path()
     ])
     with capture.capture(args.func, args) as output:
         self.assertTrue("203251201875890" in output)
Exemplo n.º 6
0
 def test_show_neutron2(self):
     parser = root_cli.create_parser()
     args = parser.parse_args([
         "show", "neutron", "ports", "-p",
         "--path=" + tests.get_resources_path()
     ])
     with capture.capture(args.func, args) as output:
         self.assertTrue("8e3c262e-7b45-4222-ac4e-528db75e5516" in output)
Exemplo n.º 7
0
 def test_show_idpools_cli(self):
     parser = root_cli.create_parser()
     args = parser.parse_args([
         "netvirt", "show", "id-pools", "-p",
         "--path=" + tests.get_resources_path(), "all"
     ])
     with capture.capture(args.func, args) as output:
         self.assertTrue("interfaces" in output)
Exemplo n.º 8
0
 def test_analyze_tunnels(self):
     parser = root_cli.create_parser()
     args = parser.parse_args([
         "netvirt", "analyze", "tunnels", "-p",
         "--path=" + tests.get_resources_path()
     ])
     with capture.capture(args.func, args) as output:
         self.assertTrue("..All" in output)
         self.assertTrue("up" in output)
Exemplo n.º 9
0
 def test_show_groups(self):
     with capture.capture(show.show_groups, self.args) as output:
         self.assertTrue("Dpn: 74851789353527," in output)
Exemplo n.º 10
0
 def test_show_elan_instances(self):
     with capture.capture(show.show_elan_instances, self.args) as output:
         self.assertTrue(
             "ElanInstance: a5fe7476-9aa1-4bfb-aec4-05d7a1376f45" in output)
Exemplo n.º 11
0
 def test_analyze_interface(self):
     self.args.ifname = "98c2e265-b4f2-40a5-8f31-2fb5d2b2baf6"
     with capture.capture(analyze.analyze_interface, self.args) as output:
         self.assertTrue("98c2e265-b4f2-40a5-8f31-2fb5d2b2baf6" in output)
Exemplo n.º 12
0
 def test_analyze_nodes(self):
     parser = root_cli.create_parser()
     args = parser.parse_args(["analyze", "nodes", "-p", "--path=" + tests.get_resources_path()])
     with capture.capture(args.func, args) as output:
         self.assertTrue("203251201875890" in output)
Exemplo n.º 13
0
 def test_analyze_interface(self):
     self.args.ifname = "98c2e265-b4f2-40a5-8f31-2fb5d2b2baf6"
     with capture.capture(analyze.analyze_interface, self.args) as output:
         self.assertTrue("98c2e265-b4f2-40a5-8f31-2fb5d2b2baf6" in output)
Exemplo n.º 14
0
 def test_analyze_trunks(self):
     with capture.capture(analyze.analyze_trunks, self.args) as output:
         print(output)
Exemplo n.º 15
0
 def test_show_neutron(self):
     self.args.object = "ports"
     self.args.pretty_print = True
     self.args.short = True
     with capture.capture(show.show_neutron, self.args) as output:
         self.assertTrue("8e3c262e-7b45-4222-ac4e-528db75e5516" in output)
Exemplo n.º 16
0
 def test_show_tables(self):
     table_0 = "0:INGRESS"
     table_220 = "220:EG_LPORT_DISP"
     with capture.capture(show.show_tables, self.args) as output:
         self.assertTrue(table_0 in output)
         self.assertTrue(table_220 in output)