Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c685d5db authored by Ken Chen's avatar Ken Chen
Browse files

Set IPv6 route for mdns tests

Just as we added a v4 route for mdns tests, a v6 routes is also
required. It can pass the test previously is because of the existence
of mdnsd. If the mdnsd is terminated by other tests, such as
CtsNetTestCasesMaxTargetSdk30, and netd_integration_test is run after
them, the .local tests in the DNS resolver will fail.

Bug: 240888834
Test: atest CtsNetTestCasesMaxTargetSdk30 resolv_integration_test
Change-Id: Ib7e91a19077b5ff1d87bd429c82440cfaf870470
parent 367181b6
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -206,6 +206,12 @@ void SetMdnsRoute() {
            "proto",         "static", "scope", "host",  "src",         "127.0.0.1",
    };
    EXPECT_EQ(0, ForkAndRun(args));

    const std::vector<std::string> args_v6 = {
            "system/bin/ip", "-6", "route", "add",    "local", "ff02::fb",
            "dev",           "lo", "proto", "static", "src",   "::1",
    };
    EXPECT_EQ(0, ForkAndRun(args_v6));
}

void RemoveMdnsRoute() {
@@ -214,4 +220,10 @@ void RemoveMdnsRoute() {
            "proto",         "static", "scope", "host",  "src",         "127.0.0.1",
    };
    EXPECT_EQ(0, ForkAndRun(args));

    const std::vector<std::string> args_v6 = {
            "system/bin/ip", "-6", "route", "del",    "local", "ff02::fb",
            "dev",           "lo", "proto", "static", "src",   "::1",
    };
    EXPECT_EQ(0, ForkAndRun(args_v6));
}
 No newline at end of file