+ def test_tcp_transfer(self):
+ """ TCP echo client/server transfer """
+
+ # Add inter-table routes
+ ip_t01 = VppIpRoute(self, self.loop1.local_ip4, 32,
+ [VppRoutePath("0.0.0.0",
+ 0xffffffff,
+ nh_table_id=1)])
+ ip_t10 = VppIpRoute(self, self.loop0.local_ip4, 32,
+ [VppRoutePath("0.0.0.0",
+ 0xffffffff,
+ nh_table_id=0)], table_id=1)
+ ip_t01.add_vpp_config()
+ ip_t10.add_vpp_config()
+
+ # Start builtin server and client
+ uri = "tcp://" + self.loop0.local_ip4 + "/1234"
+ error = self.vapi.cli("test echo server appns 0 fifo-size 4 uri " +
+ uri)
+ if error:
+ self.logger.critical(error)
+ self.assertEqual(error.find("failed"), -1)
+
+ error = self.vapi.cli("test echo client mbytes 10 appns 1 " +
+ "fifo-size 4 no-output test-bytes " +
+ "syn-timeout 2 uri " + uri)
+ if error:
+ self.logger.critical(error)
+ self.assertEqual(error.find("failed"), -1)
+
+ # Delete inter-table routes
+ ip_t01.remove_vpp_config()
+ ip_t10.remove_vpp_config()
+
+
+class TestTCPUnitTests(VppTestCase):
+ "TCP Unit Tests"
+
+ def setUp(self):
+ super(TestTCPUnitTests, self).setUp()
+ self.vapi.session_enable_disable(is_enabled=1)
+
+ def tearDown(self):
+ super(TestTCPUnitTests, self).tearDown()
+ self.vapi.session_enable_disable(is_enabled=0)
+
+ def test_tcp_unittest(self):