shill: vpn: Conditionally build VPN support into shill.
VPN is disabled if SHILL_VPN=0 is passed to the Makefile.
BUG=chromium-os:39329
TEST=Together with I9e4d5741cbdcd99c9c109259167d87dbff04ee7a:
- FEATURES=test emerge-lumpy shill;
- After unmerging dependencies, FEATURES=test USE=-vpn emerge-lumpy shill
- Connected to OpenVPN successfully with default USE flags.
- Tested connectivity with shill with no VPN support.
Change-Id: I480a5911a4310ff9f80ca312db2a1bc3fe67bbd1
Reviewed-on: https://gerrit.chromium.org/gerrit/45740
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Darin Petkov <petkov@chromium.org>
Tested-by: Darin Petkov <petkov@chromium.org>
diff --git a/manager_unittest.cc b/manager_unittest.cc
index b131304..c4fe1a8 100644
--- a/manager_unittest.cc
+++ b/manager_unittest.cc
@@ -1422,6 +1422,15 @@
new StrictMock<MockProfile>(
control_interface(), metrics(), manager(), ""));
AdoptProfile(manager(), profile);
+
+#if defined(DISABLE_VPN)
+
+ ServiceRefPtr service = manager()->GetService(args, &e);
+ EXPECT_EQ(Error::kNotSupported, e.type());
+ EXPECT_FALSE(service);
+
+#else
+
ServiceRefPtr updated_service;
EXPECT_CALL(*profile, UpdateService(_))
.WillOnce(DoAll(SaveArg<0>(&updated_service), Return(true)));
@@ -1435,6 +1444,8 @@
EXPECT_TRUE(service);
EXPECT_EQ(service, updated_service);
EXPECT_EQ(service, configured_service);
+
+#endif // DISABLE_VPN
}
TEST_F(ManagerTest, GetServiceWiMaxNoNetworkId) {