aboutsummaryrefslogtreecommitdiffhomepage
path: root/templates/test
diff options
context:
space:
mode:
authorGravatar Alexander Polcyn <apolcyn@google.com>2018-05-11 14:20:11 -0700
committerGravatar Alexander Polcyn <apolcyn@google.com>2018-05-11 16:24:39 -0700
commit550621c1b57c006fd18ddd0c9c3c589e8a2944ad (patch)
treea60b847e21f4562cedff663831d2ecc95f42a9d5 /templates/test
parent61fdb46ac456027c79841949272ec540f66d2317 (diff)
Make local DNS server tests more generic
Diffstat (limited to 'templates/test')
-rw-r--r--templates/test/cpp/naming/resolver_component_tests_defs.include14
-rw-r--r--templates/test/cpp/naming/resolver_gce_integration_tests_defs.include14
2 files changed, 13 insertions, 15 deletions
diff --git a/templates/test/cpp/naming/resolver_component_tests_defs.include b/templates/test/cpp/naming/resolver_component_tests_defs.include
index 2690af4baa..bc981dc83e 100644
--- a/templates/test/cpp/naming/resolver_component_tests_defs.include
+++ b/templates/test/cpp/naming/resolver_component_tests_defs.include
@@ -113,20 +113,18 @@ wait_until_dns_server_is_up(args,
num_test_failures = 0
% for test in tests:
-test_runner_log('Run test with target: %s' % '${test['target_name']}')\
+test_runner_log('Run test with target: %s' % '${test['test_title']}')\
current_test_subprocess = subprocess.Popen([\
args.test_bin_path,\
- '--target_name', '${test['target_name']}',\
-
- '--expected_addrs', '${test['expected_addrs']}',\
-
- '--expected_chosen_service_config', '${test['expected_chosen_service_config']}',\
-
- '--expected_lb_policy', '${test['expected_lb_policy']}',\
+ % for arg_name_and_value in test['arg_names_and_values']:
+\
+ '--${arg_name_and_value[0]}', '${arg_name_and_value[1]}',\
+\
+ % endfor
'--local_dns_server_address', '127.0.0.1:%d' % args.dns_server_port])\
current_test_subprocess.communicate()\
diff --git a/templates/test/cpp/naming/resolver_gce_integration_tests_defs.include b/templates/test/cpp/naming/resolver_gce_integration_tests_defs.include
index 0cb8a1baf3..8a8377e38d 100644
--- a/templates/test/cpp/naming/resolver_gce_integration_tests_defs.include
+++ b/templates/test/cpp/naming/resolver_gce_integration_tests_defs.include
@@ -48,15 +48,15 @@ echo "Sanity check PASSED. Run resolver tests:"
ONE_FAILED=0
bins/$CONFIG/resolver_component_test \\
- --target_name='${test['target_name']}' \\
+ % for arg_name_and_value in test['arg_names_and_values'][0:-1]:
+\
+ --${arg_name_and_value[0]}='${arg_name_and_value[1]}' \\
- --expected_addrs='${test['expected_addrs']}' \\
-
- --expected_chosen_service_config='${test['expected_chosen_service_config']}' \\
-
- --expected_lb_policy='${test['expected_lb_policy']}' || ONE_FAILED=1
+\
+ % endfor
+ --${test['arg_names_and_values'][-1][0]}='${test['arg_names_and_values'][-1][1]}' || ONE_FAILED=1
if [[ "$ONE_FAILED" != 0 ]]; then
- echo "Test based on target record: ${test['target_name']} FAILED"
+ echo "Test based on target record: ${test['test_title']} FAILED"
EXIT_CODE=1
fi