Remove the code which updates resolv.conf for dhcp supplied DNS
Earlier in openbmc stack we did't have the systemd-resolved
which updates the resolv.conf automatically for DHCP supplied
nameservers or static nameservers.
Now openBMC stack is having the systemd-resolved enabled
This code is not required, it is unnecessary overwriting
some entries.
Change-Id: I532a4d00d4ec6dcc32f69f7cc5be0a41378214b8
Signed-off-by: Ratan Gupta <ratagupt@linux.vnet.ibm.com>
diff --git a/test/test_ethernet_interface.cpp b/test/test_ethernet_interface.cpp
index 5ea7f7a..30dee8a 100644
--- a/test/test_ethernet_interface.cpp
+++ b/test/test_ethernet_interface.cpp
@@ -101,29 +101,6 @@
{
interface.iP(addressType, ipaddress, subnetMask, gateway);
}
-
- // Validates if the DNS entries have been correctly processed
- void validateResolvFile(ServerList values)
- {
- // Check whether the entries has been written to resolv.conf
- fs::path resolvFile = confDir;
- resolvFile /= "resolv.conf";
-
- // Passed in "value" is what is read from the config file
- interface.writeDNSEntries(values, resolvFile);
- std::string expectedServers =
- "### Generated manually via dbus settings ###";
- expectedServers +=
- "nameserver 9.1.1.1nameserver 9.2.2.2nameserver 9.3.3.3";
-
- std::string actualServers{};
- std::fstream stream(resolvFile.string().c_str(), std::fstream::in);
- for (std::string line; std::getline(stream, line);)
- {
- actualServers += line;
- }
- EXPECT_EQ(expectedServers, actualServers);
- }
};
TEST_F(TestEthernetInterface, NoIPaddress)
@@ -185,6 +162,7 @@
TEST_F(TestEthernetInterface, addNameServers)
{
ServerList servers = {"9.1.1.1", "9.2.2.2", "9.3.3.3"};
+ EXPECT_CALL(manager, restartSystemdUnit(networkdService)).Times(1);
interface.nameservers(servers);
fs::path filePath = confDir;
filePath /= "00-bmc-test0.network";
@@ -193,8 +171,6 @@
config::ValueList values;
std::tie(rc, values) = parser.getValues("Network", "DNS");
EXPECT_EQ(servers, values);
-
- validateResolvFile(values);
}
TEST_F(TestEthernetInterface, addNTPServers)