shill: vpn: Setup OpenVPN management channel options and open/close channel.
BUG=chromium-os:26994
TEST=unit tests
Change-Id: I9da18c7aa2f93671dc2134f531d72d626b34443e
Reviewed-on: https://gerrit.chromium.org/gerrit/19290
Tested-by: Darin Petkov <petkov@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Ready: Darin Petkov <petkov@chromium.org>
diff --git a/openvpn_management_server_unittest.cc b/openvpn_management_server_unittest.cc
index b8064a1..9623293 100644
--- a/openvpn_management_server_unittest.cc
+++ b/openvpn_management_server_unittest.cc
@@ -16,6 +16,7 @@
#include "shill/mock_sockets.h"
using std::string;
+using std::vector;
using testing::_;
using testing::Return;
using testing::ReturnNew;
@@ -87,13 +88,13 @@
TEST_F(OpenVPNManagementServerTest, StartStarted) {
SetSockets();
- EXPECT_TRUE(server_.Start(NULL, NULL));
+ EXPECT_TRUE(server_.Start(NULL, NULL, NULL));
}
TEST_F(OpenVPNManagementServerTest, StartSocketFail) {
EXPECT_CALL(sockets_, Socket(AF_INET, SOCK_STREAM, IPPROTO_TCP))
.WillOnce(Return(-1));
- EXPECT_FALSE(server_.Start(NULL, &sockets_));
+ EXPECT_FALSE(server_.Start(NULL, &sockets_, NULL));
ExpectNotStarted();
}
@@ -105,7 +106,7 @@
EXPECT_CALL(sockets_, Listen(kSocket, 1)).WillOnce(Return(0));
EXPECT_CALL(sockets_, GetSockName(kSocket, _, _)).WillOnce(Return(-1));
EXPECT_CALL(sockets_, Close(kSocket)).WillOnce(Return(0));
- EXPECT_FALSE(server_.Start(NULL, &sockets_));
+ EXPECT_FALSE(server_.Start(NULL, &sockets_, NULL));
ExpectNotStarted();
}
@@ -120,11 +121,13 @@
CreateReadyHandler(kSocket, IOHandler::kModeInput,
CallbackEq(server_.ready_callback_)))
.WillOnce(ReturnNew<IOHandler>());
- EXPECT_TRUE(server_.Start(&dispatcher_, &sockets_));
+ vector<string> options;
+ EXPECT_TRUE(server_.Start(&dispatcher_, &sockets_, &options));
EXPECT_EQ(&sockets_, server_.sockets_);
EXPECT_EQ(kSocket, server_.socket_);
EXPECT_TRUE(server_.ready_handler_.get());
EXPECT_EQ(&dispatcher_, server_.dispatcher_);
+ EXPECT_FALSE(options.empty());
}
TEST_F(OpenVPNManagementServerTest, Stop) {