Loading Android.bp +10 −1 Original line number Diff line number Diff line Loading @@ -164,7 +164,7 @@ cc_library_static { // TODO: Move this test to tests/ cc_test { name: "resolv_unit_test", test_suites: ["device-tests"], test_suites: ["device-tests", "mts"], require_root: true, //TODO: drop root privileges and make it be an real unit test. defaults: ["netd_defaults"], Loading Loading @@ -200,4 +200,13 @@ cc_test { "server_configurable_flags", "stats_proto", ], compile_multilib: "both", multilib: { lib32: { suffix: "32", }, lib64: { suffix: "64", }, }, } tests/Android.bp +13 −4 Original line number Diff line number Diff line Loading @@ -32,7 +32,7 @@ cc_library_static { cc_test { name: "resolv_gold_test", test_suites: ["device-tests"], test_suites: ["device-tests", "mts"], require_root: true, defaults: ["netd_defaults"], data: ["testdata/*.pbtxt"], Loading Loading @@ -64,11 +64,12 @@ cc_test { "server_configurable_flags", "stats_proto", ], compile_multilib: "first", } cc_test { name: "resolv_stress_test", test_suites: ["device-tests"], test_suites: ["device-tests", "mts"], // This won't work with test_config // require_root: true, test_config: "resolv_stress_test_config.xml", Loading @@ -95,12 +96,12 @@ cc_test { "netd_event_listener_interface-ndk_platform", "netd_aidl_interface-ndk_platform", ], compile_multilib: "both", compile_multilib: "first", } cc_test { name: "resolv_integration_test", test_suites: ["device-tests"], test_suites: ["device-tests", "mts"], require_root: true, defaults: ["netd_defaults"], tidy: false, // cuts test build time by > 1m30s Loading Loading @@ -138,4 +139,12 @@ cc_test { "netd_event_listener_interface-ndk_platform", ], compile_multilib: "both", multilib: { lib32: { suffix: "32", }, lib64: { suffix: "64", }, }, } tests/resolv_gold_test.cpp +4 −3 Original line number Diff line number Diff line Loading @@ -126,8 +126,9 @@ class TestBase : public ::testing::Test { GoldTest ToProto(const std::string& file) { // Convert the testing configuration from .pbtxt file to proto. std::string file_content; EXPECT_TRUE(android::base::ReadFileToString(kTestDataPath + file, &file_content)) << strerror(errno); const std::string file_name = kTestDataPath + file; EXPECT_TRUE(android::base::ReadFileToString(file_name, &file_content)) << "Failed to read " << file_name << ": " << strerror(errno); android::net::GoldTest goldtest; EXPECT_TRUE(google::protobuf::TextFormat::ParseFromString(file_content, &goldtest)); return goldtest; Loading Loading
Android.bp +10 −1 Original line number Diff line number Diff line Loading @@ -164,7 +164,7 @@ cc_library_static { // TODO: Move this test to tests/ cc_test { name: "resolv_unit_test", test_suites: ["device-tests"], test_suites: ["device-tests", "mts"], require_root: true, //TODO: drop root privileges and make it be an real unit test. defaults: ["netd_defaults"], Loading Loading @@ -200,4 +200,13 @@ cc_test { "server_configurable_flags", "stats_proto", ], compile_multilib: "both", multilib: { lib32: { suffix: "32", }, lib64: { suffix: "64", }, }, }
tests/Android.bp +13 −4 Original line number Diff line number Diff line Loading @@ -32,7 +32,7 @@ cc_library_static { cc_test { name: "resolv_gold_test", test_suites: ["device-tests"], test_suites: ["device-tests", "mts"], require_root: true, defaults: ["netd_defaults"], data: ["testdata/*.pbtxt"], Loading Loading @@ -64,11 +64,12 @@ cc_test { "server_configurable_flags", "stats_proto", ], compile_multilib: "first", } cc_test { name: "resolv_stress_test", test_suites: ["device-tests"], test_suites: ["device-tests", "mts"], // This won't work with test_config // require_root: true, test_config: "resolv_stress_test_config.xml", Loading @@ -95,12 +96,12 @@ cc_test { "netd_event_listener_interface-ndk_platform", "netd_aidl_interface-ndk_platform", ], compile_multilib: "both", compile_multilib: "first", } cc_test { name: "resolv_integration_test", test_suites: ["device-tests"], test_suites: ["device-tests", "mts"], require_root: true, defaults: ["netd_defaults"], tidy: false, // cuts test build time by > 1m30s Loading Loading @@ -138,4 +139,12 @@ cc_test { "netd_event_listener_interface-ndk_platform", ], compile_multilib: "both", multilib: { lib32: { suffix: "32", }, lib64: { suffix: "64", }, }, }
tests/resolv_gold_test.cpp +4 −3 Original line number Diff line number Diff line Loading @@ -126,8 +126,9 @@ class TestBase : public ::testing::Test { GoldTest ToProto(const std::string& file) { // Convert the testing configuration from .pbtxt file to proto. std::string file_content; EXPECT_TRUE(android::base::ReadFileToString(kTestDataPath + file, &file_content)) << strerror(errno); const std::string file_name = kTestDataPath + file; EXPECT_TRUE(android::base::ReadFileToString(file_name, &file_content)) << "Failed to read " << file_name << ": " << strerror(errno); android::net::GoldTest goldtest; EXPECT_TRUE(google::protobuf::TextFormat::ParseFromString(file_content, &goldtest)); return goldtest; Loading