From 1b54f359933647aae9ae7330d3ef6fe33b976edf Mon Sep 17 00:00:00 2001 From: Seonah Moon Date: Tue, 31 Aug 2021 11:14:52 +0900 Subject: [PATCH] test: update DNS configuration correctly DNS was dynamic although IP configuration was static. Change-Id: I6a26cf070f4072fbce178d9a13d1a3fa1230c27c --- test/connection_test.c | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/test/connection_test.c b/test/connection_test.c index 9c86789..83e6ad3 100755 --- a/test/connection_test.c +++ b/test/connection_test.c @@ -610,6 +610,7 @@ static int test_update_ip_info(connection_profile_h profile, connection_address_ int rv = 0; int input_int = 0; char input_str[100] = {0,}; + int dns_input = 0; if (test_get_user_string("Input IP Address - (Enter for skip) :", input_str, 100)) { rv = connection_profile_set_ip_address(profile, @@ -643,8 +644,30 @@ static int test_update_ip_info(connection_profile_h profile, connection_address_ return -1; } - if (test_update_dns_info(profile, address_family) < 0) - return -1; + if (test_get_user_int("Input DNS Address Type (Static:1, DHCP:2)" + " - (Enter for skip) :", &dns_input)) { + switch (dns_input) { + case CONNECTION_DNS_CONFIG_TYPE_STATIC: + rv = connection_profile_set_dns_config_type( + profile, + address_family, + CONNECTION_DNS_CONFIG_TYPE_STATIC); + if (rv != CONNECTION_ERROR_NONE) + return -1; + if (test_update_dns_info(profile, + address_family) == -1) + return -1; + break; + case CONNECTION_DNS_CONFIG_TYPE_DYNAMIC: + rv = connection_profile_set_dns_config_type( + profile, + address_family, + CONNECTION_DNS_CONFIG_TYPE_DYNAMIC); + if (rv != CONNECTION_ERROR_NONE) + return -1; + break; + } + } return 1; } -- 2.7.4