VPP-1508: Tests: Fix vpp_api struct.error under py3.
[vpp.git] / test / test_tcp.py
index 5f2bce5..c536628 100644 (file)
@@ -32,9 +32,9 @@ class TestTCP(VppTestCase):
             table_id += 1
 
         # Configure namespaces
-        self.vapi.app_namespace_add_del(namespace_id="0",
+        self.vapi.app_namespace_add_del(namespace_id=b"0",
                                         sw_if_index=self.loop0.sw_if_index)
-        self.vapi.app_namespace_add_del(namespace_id="1",
+        self.vapi.app_namespace_add_del(namespace_id=b"1",
                                         sw_if_index=self.loop1.sw_if_index)
 
     def tearDown(self):
@@ -66,14 +66,14 @@ class TestTCP(VppTestCase):
                               uri)
         if error:
             self.logger.critical(error)
-            self.assertEqual(error.find("failed"), -1)
+            self.assertNotIn("failed", error)
 
         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)
+            self.assertNotIn("failed", error)
 
         # Delete inter-table routes
         ip_t01.remove_vpp_config()
@@ -97,7 +97,7 @@ class TestTCPUnitTests(VppTestCase):
 
         if error:
             self.logger.critical(error)
-        self.assertEqual(error.find("failed"), -1)
+        self.assertNotIn("failed", error)
 
 if __name__ == '__main__':
     unittest.main(testRunner=VppTestRunner)