Detailed baseline test report

pull/24983/head
Sergii Tkachenko 4 years ago
parent b8082b8df0
commit f137237638
  1. 6
      tools/run_tests/xds_test_driver/.gitignore
  2. 17
      tools/run_tests/xds_test_driver/framework/xds_k8s_testcase.py
  3. 33
      tools/run_tests/xds_test_driver/tests/baseline_test.py

@ -1,3 +1,5 @@
src/proto
config/local-dev.cfg
venv
src/proto
venv/
out/

@ -29,6 +29,10 @@ from framework.test_app import client_app
from framework.test_app import server_app
logger = logging.getLogger(__name__)
_FORCE_CLEANUP = flags.DEFINE_bool(
"force_cleanup",
default=False,
help="Force resource cleanup, even if not created by this test run")
flags.adopt_module_key_flags(xds_flags)
flags.adopt_module_key_flags(xds_k8s_flags)
@ -67,6 +71,9 @@ class XdsKubernetesTestCase(absltest.TestCase):
cls.client_image = xds_k8s_flags.CLIENT_IMAGE.value
cls.client_name = xds_flags.CLIENT_NAME.value
cls.client_port = xds_flags.CLIENT_PORT.value
# Test suite settings
cls.force_cleanup = _FORCE_CLEANUP.value
cls.debug_use_port_forwarding = \
xds_k8s_flags.DEBUG_USE_PORT_FORWARDING.value
@ -76,7 +83,7 @@ class XdsKubernetesTestCase(absltest.TestCase):
cls.gcp_api_manager = gcp.api.GcpApiManager()
def setUp(self):
# TODO(sergiitk): generate for each test
# TODO(sergiitk): generate namespace with run id for each test
self.server_namespace = self.namespace
self.client_namespace = self.namespace
@ -84,7 +91,6 @@ class XdsKubernetesTestCase(absltest.TestCase):
self.server_runner = None
self.client_runner = None
self.td = None
# TODO(sergiitk): generate namespace with run id
@classmethod
def tearDownClass(cls):
@ -93,9 +99,10 @@ class XdsKubernetesTestCase(absltest.TestCase):
def tearDown(self):
logger.debug('######## tearDown(): resource cleanup initiated ########')
self.td.cleanup()
self.client_runner.cleanup()
self.server_runner.cleanup()
self.td.cleanup(force=self.force_cleanup)
self.client_runner.cleanup(force=self.force_cleanup)
self.server_runner.cleanup(force=self.force_cleanup,
force_namespace=self.force_cleanup)
def setupTrafficDirectorGrpc(self):
self.td.setup_for_grpc(self.server_xds_host, self.server_xds_port)

@ -28,15 +28,34 @@ _XdsTestClient = xds_k8s_testcase.XdsTestClient
class BaselineTest(xds_k8s_testcase.RegularXdsKubernetesTestCase):
def test_ping_pong(self):
self.setupTrafficDirectorGrpc()
def test_traffic_director_setup_grpc(self):
with self.subTest('create_health_check'):
self.td.create_health_check()
test_server: _XdsTestServer = self.startTestServer()
self.setupServerBackends()
with self.subTest('create_backend_service'):
self.td.create_backend_service()
test_client: _XdsTestClient = self.startTestClient(test_server)
self.assertSuccessfulRpcs(test_client)
with self.subTest('create_url_map'):
self.td.create_url_map(self.server_xds_host, self.server_xds_port)
with self.subTest('create_target_grpc_proxy'):
self.td.create_target_grpc_proxy()
with self.subTest('create_forwarding_rule'):
self.td.create_forwarding_rule(self.server_xds_port)
with self.subTest('start_test_server'):
test_server: _XdsTestServer = self.startTestServer()
with self.subTest('setup_server_backends'):
self.setupServerBackends()
with self.subTest('start_test_client'):
test_client: _XdsTestClient = self.startTestClient(test_server)
with self.subTest('successful_rpcs'):
self.assertSuccessfulRpcs(test_client)
if __name__ == '__main__':
absltest.main()
absltest.main(failfast=True)

Loading…
Cancel
Save