summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYongqin Liu <yongqin.liu@linaro.org>2018-06-14 19:04:16 +0800
committerBernie Innocenti <codewiz@google.com>2019-09-11 09:42:19 +0000
commit589bd52d90b9f61e837c302d0ee09b3affb35271 (patch)
treecb455de43f2b6f3d6edd4ebf1171881a991d4951
parent33ef503e865d634a10f4a788f9713160141f6dd4 (diff)
downloadnetd-589bd52d90b9f61e837c302d0ee09b3affb35271.tar.gz
dns_tls_frontend.cpp: set queries_ to 0 in startServerpie-vts-dev
so that we could call waitForQueries with 1 passed to check with the query number. In TlsBypass test in tests/netd_test.cpp file, 1 is passed to tls.waitForQueries to check with query number, but after one tls enabled config, the query number will be more than 1, which makes the check in DnsTlsFrontend::waitForQueries following has no meaning: https://android.googlesource.com/platform/system/netd.git/+/master/tests/dns_responder/dns_tls_frontend.cpp#382 To make the test cleanest, we set queries_ to 0 in the startServer function of dns_tls_frontend.cpp, so that in the TlsBypass test of tests/netd_test.cpp, we only need to wait for the validation query come simply with calling of tls.waitForQueries(1, 5000), since the tls.startServer is called every time in the for loop when tls enabled, so the call to waitForQueries when tls enabled works there Test: adb shell /data/nativetest64/netd_integration_test/netd_integration_test64 --gtest_filter=ResolverTest.TlsBypass on hikey Test: ./android-vts/tools/vts-tradefed run vts-kernel -m VtsKernelNetdTest -t VtsKernelNetdTest.ResolverTest.TlsBypass on hikey Change-Id: I9ce9314c34420b346703500f4120304dfa58b9af Merged-In: I9ce9314c34420b346703500f4120304dfa58b9af Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
-rw-r--r--tests/dns_responder/dns_tls_frontend.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/dns_responder/dns_tls_frontend.cpp b/tests/dns_responder/dns_tls_frontend.cpp
index f6321ec2..d5b581a3 100644
--- a/tests/dns_responder/dns_tls_frontend.cpp
+++ b/tests/dns_responder/dns_tls_frontend.cpp
@@ -143,6 +143,10 @@ bool DnsTlsFrontend::startServer() {
SSL_load_error_strings();
OpenSSL_add_ssl_algorithms();
+ // reset queries_ to 0 every time startServer called
+ // which would help us easy to check queries_ via calling waitForQueries
+ queries_ = 0;
+
ctx_.reset(SSL_CTX_new(TLS_server_method()));
if (!ctx_) {
ALOGE("SSL context creation failed");