Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(81)

Unified Diff: server/site_linux_server.py

Issue 6609034: VPN: Test to set up & validate a Client connection to the Server (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/autotest.git@master
Patch Set: Filled in missing block comments about the nature of this test. Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: server/site_linux_server.py
diff --git a/server/site_linux_server.py b/server/site_linux_server.py
new file mode 100644
index 0000000000000000000000000000000000000000..46e38f30542161c7ae1934ddc5062503d730e70b
--- /dev/null
+++ b/server/site_linux_server.py
@@ -0,0 +1,34 @@
+# Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import logging, re, time
+from autotest_lib.client.common_lib import error
+
+class LinuxServer(object):
+ """
+ Linux Server: A machine which hosts network services.
+
+ """
+
+ def __init__(self, server, params):
+ self.server = server # Server host.
+
+ def vpn_create_server_config(self, params):
+ """ Configure the server side of the VPN. """
+ conf = {}
+ for k, v in params.iteritems():
+ conf[k] = v
+
+ # Generate config file.
+ self.server.run("mkdir -p /tmp/vpn && cat <<EOF >%s\n%s\nEOF\n" %
+ ('/tmp/vpn/server.conf', '\n'.join(
+ "%s %s" % kv for kv in conf.iteritems())))
+
+ def vpn_launch_server(self, params):
Paul Stewart 2011/03/03 23:18:42 The function name says "vpn_xxx" but you're really
+ """ Begin executing the server side of the VPN. """
+ self.server.run("/usr/sbin/openvpn --config /tmp/vpn/server.conf &")
+
+ def vpn_kill_server(self, params):
+ """ Kill the OpenVPN server. """
+ self.server.run("pkill /usr/sbin/openvpn")

Powered by Google App Engine
This is Rietveld 408576698