aboutsummaryrefslogtreecommitdiff
path: root/DnsQueryLogTest.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Remove validity time constraint in DNS query logKen Chen2023-06-051-22/+0
| | | | | | | | | | | Carriers will use DNS query logs in tests. Removes log expiration time limit so logs persist long enough for 24 hour testing. Bug: 279596912 Bug: 231264474 Bug: 200748696 Test: atest resolv_unit_test:DnsQueryLogTest Change-Id: Ib98b16053d0386e98be370fa6138d667dfcb03c9
* Read DNS query log settings from system propertyKen Chen2023-06-051-0/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, we need to provide a special build of the image for carrier testing, so that we can find out which apps are using DNS queries when the device idle. In fact, DnsQueryLog already can dump the required information, but lacks the interface to set the number of records. The default number of records 200 may not be enough for a 24 hours idle test. This commit enables DNS resolver to read the record setting from system properties, which is limited to 0 ~ 10000. Dumping DnsQueryLog requires root permission. There is no privacy concern in production builds. Bug: 279596912 Bug: 231264474 Bug: 200748696 Test: Run script like this to trigger 400 DNS queries #!/bin/bash for ((i=1; i<=400; i++)) do hostname="http://example${i}.com" adb shell am start -a android.intent.action.VIEW -d "$hostname" sleep 1 done $adb root; chmod +x run_dns_queries.sh; ./run_dns_queries.sh $adb shell dumpsys dnsresolver querylog | grep time | wc -l 200 $adb shell setprop persist.net.dns_query_log_size 3 $adb reboot $adb root; chmod +x run_dns_queries.sh; ./run_dns_queries.sh $adb shell dumpsys dnsresolver querylog | grep time | wc -l 3 $adb shell setprop persist.net.dns_query_log_size 300 $adb reboot $adb root; chmod +x run_dns_queries.sh; ./run_dns_queries.sh $adb shell dumpsys dnsresolver querylog | grep time | wc -l 300 Change-Id: Ic8fbe7e3ec52e1901fea9962d1c7564152693fc3
* Replace ResolvTestBase with common classs NetNativeTestBasePaul Hu2022-07-041-2/+2
| | | | | | | | | | NetNativeTestBase is a util class using for logging test life cycle. So replace ResolvTestBase with NetNativeTestBase which is same usage. Bug: 223731710 Test: cd packages/modules/DnsResolver then atest Change-Id: I5dd8d698ef98df254bcffba56d9f51cf5a35f231
* Logging life cycle of each testChiachang Wang2022-03-101-1/+2
| | | | | | | | | | | | | | It's helpful for debugging each test to observe the behavior between each test. Sample log: I resolv_private_dns_test: started: PrivateDnsDohTest#QueryFailover : I resolv_private_dns_test: finished: PrivateDnsDohTest#QueryFailover Test: atest resolv_integration_test Bug: 223731710 Change-Id: I0335baa1762d35355d20bdf7a707b590f8a95c0c
* Add unit tests for DnsQueryLogMike Yu2019-12-111-0/+164
Ensure the basic functions of DnsQueryLog work as expected. Bug: 139040977 Test: cd packages/modules/DnsResolver && atest Change-Id: I6b318beeed7ff5942e8d08474c354e48ebdac936