MCPcopy Create free account
hub / github.com/FDio/vpp / test_gre_input_node

Method test_gre_input_node

test/test_gre.py:51–78  ·  view source on GitHub ↗

GRE gre input nodes not registerd unless configured

(self)

Source from the content-addressed store, hash-verified

49 super(TestGREInputNodes, self).tearDown()
50
51 def test_gre_input_node(self):
52 """GRE gre input nodes not registerd unless configured"""
53 pkt = (
54 Ether(dst=self.pg0.local_mac, src=self.pg0.remote_mac)
55 / IP(src=self.pg0.remote_ip4, dst=self.pg0.local_ip4)
56 / GRE()
57 )
58
59 self.pg0.add_stream(pkt)
60 self.pg_start()
61 # no tunnel created, gre-input not registered
62 err = self.statistics.get_counter("/err/ip4-local/unknown_protocol")[0]
63 self.assertEqual(err, 1)
64 err_count = err
65
66 # create gre tunnel
67 gre_if = VppGreInterface(self, self.pg0.local_ip4, "1.1.1.2")
68 self.assertFalse(gre_if.query_vpp_config())
69
70 gre_if.add_vpp_config()
71 self.assertTrue(gre_if.query_vpp_config())
72
73 self.pg0.add_stream(pkt)
74 self.pg_start()
75 # tunnel created, gre-input registered
76 err = self.statistics.get_counter("/err/ip4-local/unknown_protocol")[0]
77 # expect no new errors
78 self.assertEqual(err, err_count)
79
80
81@unittest.skipIf("gre" in config.excluded_plugins, "Exclude GRE plugin tests")

Callers

nothing calls this directly

Calls 6

query_vpp_configMethod · 0.95
add_vpp_configMethod · 0.95
VppGreInterfaceClass · 0.90
pg_startMethod · 0.80
add_streamMethod · 0.45
get_counterMethod · 0.45

Tested by

no test coverage detected