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

Side by Side 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, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 # Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 import logging, re, time
6 from autotest_lib.client.common_lib import error
7
8 class LinuxServer(object):
9 """
10 Linux Server: A machine which hosts network services.
11
12 """
13
14 def __init__(self, server, params):
15 self.server = server # Server host.
16
17 def vpn_create_server_config(self, params):
18 """ Configure the server side of the VPN. """
19 conf = {}
20 for k, v in params.iteritems():
21 conf[k] = v
22
23 # Generate config file.
24 self.server.run("mkdir -p /tmp/vpn && cat <<EOF >%s\n%s\nEOF\n" %
25 ('/tmp/vpn/server.conf', '\n'.join(
26 "%s %s" % kv for kv in conf.iteritems())))
27
28 def vpn_launch_server(self, params):
Paul Stewart 2011/03/03 23:18:42 The function name says "vpn_xxx" but you're really
29 """ Begin executing the server side of the VPN. """
30 self.server.run("/usr/sbin/openvpn --config /tmp/vpn/server.conf &")
31
32 def vpn_kill_server(self, params):
33 """ Kill the OpenVPN server. """
34 self.server.run("pkill /usr/sbin/openvpn")
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698