shill: Convert DHCP Proxy to use a model similar to Supplicant and ModemManager.
Also, don't create a DBus connection for each proxy since this doesn't work in
some event callbacks and wastes resources. Instead use a shared connection
provided by the ProxyFactory.
BUG=chromium-os:17735
TEST=unit tests, tested on device
Change-Id: I4d16b430783c1159501c0414ef3b846bce1a4c0e
Reviewed-on: http://gerrit.chromium.org/gerrit/4279
Tested-by: Darin Petkov <petkov@chromium.org>
Reviewed-by: mukesh agrawal <quiche@chromium.org>
diff --git a/dhcp_config_unittest.cc b/dhcp_config_unittest.cc
index 24b1cee..ef6662b 100644
--- a/dhcp_config_unittest.cc
+++ b/dhcp_config_unittest.cc
@@ -187,21 +187,21 @@
TEST_F(DHCPConfigTest, ReleaseIP) {
config_->pid_ = 1 << 18; // Ensure unknown positive PID.
- EXPECT_CALL(*proxy_, DoRelease(kDeviceName)).Times(1);
+ EXPECT_CALL(*proxy_, Release(kDeviceName)).Times(1);
EXPECT_TRUE(config_->ReleaseIP());
config_->pid_ = 0;
}
TEST_F(DHCPConfigTest, RenewIP) {
config_->pid_ = 456;
- EXPECT_CALL(*proxy_, DoRebind(kDeviceName)).Times(1);
+ EXPECT_CALL(*proxy_, Rebind(kDeviceName)).Times(1);
EXPECT_TRUE(config_->RenewIP());
config_->pid_ = 0;
}
TEST_F(DHCPConfigTest, RequestIP) {
config_->pid_ = 567;
- EXPECT_CALL(*proxy_, DoRebind(kDeviceName)).Times(1);
+ EXPECT_CALL(*proxy_, Rebind(kDeviceName)).Times(1);
EXPECT_TRUE(config_->RenewIP());
config_->pid_ = 0;
}