Merge lp:~corey.bryant/ubuntu/vivid/neutron-vpnaas/2015.1.1 into lp:ubuntu/vivid-updates/neutron-vpnaas

Proposed by Corey Bryant
Status: Approved
Approved by: Corey Bryant
Approved revision: 8
Proposed branch: lp:~corey.bryant/ubuntu/vivid/neutron-vpnaas/2015.1.1
Merge into: lp:ubuntu/vivid-updates/neutron-vpnaas
Diff against target: 572 lines (+290/-43)
20 files modified
AUTHORS (+3/-0)
ChangeLog (+11/-0)
PKG-INFO (+1/-1)
debian/changelog (+11/-0)
etc/neutron/rootwrap.d/vpnaas.filters (+1/-0)
etc/vpn_agent.ini (+2/-0)
neutron_vpnaas.egg-info/PKG-INFO (+1/-1)
neutron_vpnaas.egg-info/SOURCES.txt (+2/-0)
neutron_vpnaas.egg-info/pbr.json (+1/-1)
neutron_vpnaas.egg-info/requires.txt (+11/-11)
neutron_vpnaas/services/vpn/agent.py (+1/-0)
neutron_vpnaas/services/vpn/device_drivers/fedora_strongswan_ipsec.py (+107/-0)
neutron_vpnaas/services/vpn/device_drivers/ipsec.py (+8/-7)
neutron_vpnaas/services/vpn/device_drivers/libreswan_ipsec.py (+50/-0)
neutron_vpnaas/tests/unit/db/vpn/test_vpn_db.py (+10/-0)
neutron_vpnaas/tests/unit/services/vpn/device_drivers/test_ipsec.py (+49/-0)
requirements.txt (+11/-11)
setup.cfg (+1/-1)
setup.py (+0/-1)
test-requirements.txt (+9/-9)
To merge this branch: bzr merge lp:~corey.bryant/ubuntu/vivid/neutron-vpnaas/2015.1.1
Reviewer Review Type Date Requested Status
Ubuntu Development Team Pending
Review via email: mp+266899@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Corey Bryant (corey.bryant) wrote :

I've uploaded this to the archive and will let the Package Import Robot commit the branch changes.

Unmerged revisions

8. By Corey Bryant

* Resynchronize with stable/kilo (9c73c0c) (LP: #1481008):
  - [fb18c46] Set vpn agent's agent_state['binary'] attribute
  - [0ec1668] Fix failures for integration tests
  - [053fd30] VPNaaS: Fix breakage in status reporting
  - [5cc0613] Libreswan driver support in VPNaaS
  - [9c73c0c] Provide Fedora support for StrongSwan

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'AUTHORS'
--- AUTHORS 2015-03-30 11:20:04 +0000
+++ AUTHORS 2015-08-04 15:46:24 +0000
@@ -147,6 +147,7 @@
147Tomoko Inoue <inoue.tomoko@lab.ntt.co.jp>147Tomoko Inoue <inoue.tomoko@lab.ntt.co.jp>
148Trinath Somanchi <trinath.somanchi@freescale.com>148Trinath Somanchi <trinath.somanchi@freescale.com>
149Tyler Smith <tylesmit@cisco.com>149Tyler Smith <tylesmit@cisco.com>
150Wei Hu <hwhu@cn.ibm.com>
150Weidong Shao <weidong.shao@huawei.com>151Weidong Shao <weidong.shao@huawei.com>
151Wu Wenxiang <wu.wenxiang@99cloud.net>152Wu Wenxiang <wu.wenxiang@99cloud.net>
152YAMAMOTO Takashi <yamamoto@valinux.co.jp>153YAMAMOTO Takashi <yamamoto@valinux.co.jp>
@@ -174,6 +175,7 @@
174johndavidge <jodavidg@cisco.com>175johndavidge <jodavidg@cisco.com>
175justin Lund <justin.lund@dreamhost.com>176justin Lund <justin.lund@dreamhost.com>
176lawrancejing <lawrancejing@gmail.com>177lawrancejing <lawrancejing@gmail.com>
178leejian0612 <ljianbj@cn.ibm.com>
177liu-sheng <liusheng@huawei.com>179liu-sheng <liusheng@huawei.com>
178liuqing <jing.liuqing@99cloud.net>180liuqing <jing.liuqing@99cloud.net>
179llg8212 <lilinguo@huawei.com>181llg8212 <lilinguo@huawei.com>
@@ -187,6 +189,7 @@
187sridhargaddam <sridhar.gaddam@enovance.com>189sridhargaddam <sridhar.gaddam@enovance.com>
188sukhdev <sukhdev@aristanetworks.com>190sukhdev <sukhdev@aristanetworks.com>
189trinaths <trinath.somanchi@freescale.com>191trinaths <trinath.somanchi@freescale.com>
192venkata anil <anil.venkata@enovance.com>
190vikas <vikas.d-m@hp.com>193vikas <vikas.d-m@hp.com>
191vinkesh banka <vinkeshb@thoughtworks.com>194vinkesh banka <vinkeshb@thoughtworks.com>
192zhhuabj <zhhuabj@cn.ibm.com>195zhhuabj <zhhuabj@cn.ibm.com>
193196
=== modified file 'ChangeLog'
--- ChangeLog 2015-04-30 18:32:31 +0000
+++ ChangeLog 2015-08-04 15:46:24 +0000
@@ -1,6 +1,17 @@
1CHANGES1CHANGES
2=======2=======
33
42015.1.1
5--------
6
7* Updated from global requirements
8* Set vpn agent's agent_state['binary'] attribute
9* Fix failures for integration tests
10* VPNaaS: Fix breakage in status reporting
11* Libreswan driver support in VPNaaS
12* Provide Fedora support for StrongSwan
13* Bump pre-release to 2015.1.1
14
42015.1.0152015.1.0
5--------16--------
617
718
=== modified file 'PKG-INFO'
--- PKG-INFO 2015-04-30 18:32:31 +0000
+++ PKG-INFO 2015-08-04 15:46:24 +0000
@@ -1,6 +1,6 @@
1Metadata-Version: 1.11Metadata-Version: 1.1
2Name: neutron-vpnaas2Name: neutron-vpnaas
3Version: 2015.1.03Version: 2015.1.1
4Summary: OpenStack Networking VPN as a Service4Summary: OpenStack Networking VPN as a Service
5Home-page: http://www.openstack.org/5Home-page: http://www.openstack.org/
6Author: OpenStack6Author: OpenStack
77
=== modified file 'debian/changelog'
--- debian/changelog 2015-04-30 18:32:31 +0000
+++ debian/changelog 2015-08-04 15:46:24 +0000
@@ -1,3 +1,14 @@
1neutron-vpnaas (1:2015.1.1-0ubuntu1) UNRELEASED; urgency=medium
2
3 * Resynchronize with stable/kilo (9c73c0c) (LP: #1481008):
4 - [fb18c46] Set vpn agent's agent_state['binary'] attribute
5 - [0ec1668] Fix failures for integration tests
6 - [053fd30] VPNaaS: Fix breakage in status reporting
7 - [5cc0613] Libreswan driver support in VPNaaS
8 - [9c73c0c] Provide Fedora support for StrongSwan
9
10 -- Corey Bryant <corey.bryant@canonical.com> Tue, 04 Aug 2015 11:31:19 -0400
11
1neutron-vpnaas (1:2015.1.0-0ubuntu1) vivid; urgency=medium12neutron-vpnaas (1:2015.1.0-0ubuntu1) vivid; urgency=medium
213
3 * New upstream release for OpenStack kilo. (LP: #1449744) 14 * New upstream release for OpenStack kilo. (LP: #1449744)
415
=== modified file 'etc/neutron/rootwrap.d/vpnaas.filters'
--- etc/neutron/rootwrap.d/vpnaas.filters 2015-03-30 11:20:04 +0000
+++ etc/neutron/rootwrap.d/vpnaas.filters 2015-08-04 15:46:24 +0000
@@ -11,5 +11,6 @@
11ip: IpFilter, ip, root11ip: IpFilter, ip, root
12ip_exec: IpNetnsExecFilter, ip, root12ip_exec: IpNetnsExecFilter, ip, root
13ipsec: CommandFilter, ipsec, root13ipsec: CommandFilter, ipsec, root
14strongswan: CommandFilter, strongswan, root
14neutron_netns_wrapper: CommandFilter, neutron-vpn-netns-wrapper, root15neutron_netns_wrapper: CommandFilter, neutron-vpn-netns-wrapper, root
15neutron_netns_wrapper_local: CommandFilter, /usr/local/bin/neutron-vpn-netns-wrapper, root16neutron_netns_wrapper_local: CommandFilter, /usr/local/bin/neutron-vpn-netns-wrapper, root
1617
=== modified file 'etc/vpn_agent.ini'
--- etc/vpn_agent.ini 2015-03-30 11:20:04 +0000
+++ etc/vpn_agent.ini 2015-08-04 15:46:24 +0000
@@ -12,6 +12,8 @@
12# vpn_device_driver=neutron_vpnaas.services.vpn.device_drivers.cisco_ipsec.CiscoCsrIPsecDriver12# vpn_device_driver=neutron_vpnaas.services.vpn.device_drivers.cisco_ipsec.CiscoCsrIPsecDriver
13# vpn_device_driver=neutron_vpnaas.services.vpn.device_drivers.vyatta_ipsec.VyattaIPSecDriver13# vpn_device_driver=neutron_vpnaas.services.vpn.device_drivers.vyatta_ipsec.VyattaIPSecDriver
14# vpn_device_driver=neutron_vpnaas.services.vpn.device_drivers.strongswan_ipsec.StrongSwanDriver14# vpn_device_driver=neutron_vpnaas.services.vpn.device_drivers.strongswan_ipsec.StrongSwanDriver
15# vpn_device_driver=neutron_vpnaas.services.vpn.device_drivers.fedora_strongswan_ipsec.FedoraStrongSwanDriver
16# vpn_device_driver=neutron_vpnaas.services.vpn.device_drivers.libreswan_ipsec.LibreSwanDriver
15# vpn_device_driver=another_driver17# vpn_device_driver=another_driver
1618
17[ipsec]19[ipsec]
1820
=== modified file 'neutron_vpnaas.egg-info/PKG-INFO'
--- neutron_vpnaas.egg-info/PKG-INFO 2015-04-30 18:32:31 +0000
+++ neutron_vpnaas.egg-info/PKG-INFO 2015-08-04 15:46:24 +0000
@@ -1,6 +1,6 @@
1Metadata-Version: 1.11Metadata-Version: 1.1
2Name: neutron-vpnaas2Name: neutron-vpnaas
3Version: 2015.1.03Version: 2015.1.1
4Summary: OpenStack Networking VPN as a Service4Summary: OpenStack Networking VPN as a Service
5Home-page: http://www.openstack.org/5Home-page: http://www.openstack.org/
6Author: OpenStack6Author: OpenStack
77
=== modified file 'neutron_vpnaas.egg-info/SOURCES.txt'
--- neutron_vpnaas.egg-info/SOURCES.txt 2015-04-30 18:32:31 +0000
+++ neutron_vpnaas.egg-info/SOURCES.txt 2015-08-04 15:46:24 +0000
@@ -63,7 +63,9 @@
63neutron_vpnaas/services/vpn/device_drivers/__init__.py63neutron_vpnaas/services/vpn/device_drivers/__init__.py
64neutron_vpnaas/services/vpn/device_drivers/cisco_csr_rest_client.py64neutron_vpnaas/services/vpn/device_drivers/cisco_csr_rest_client.py
65neutron_vpnaas/services/vpn/device_drivers/cisco_ipsec.py65neutron_vpnaas/services/vpn/device_drivers/cisco_ipsec.py
66neutron_vpnaas/services/vpn/device_drivers/fedora_strongswan_ipsec.py
66neutron_vpnaas/services/vpn/device_drivers/ipsec.py67neutron_vpnaas/services/vpn/device_drivers/ipsec.py
68neutron_vpnaas/services/vpn/device_drivers/libreswan_ipsec.py
67neutron_vpnaas/services/vpn/device_drivers/strongswan_ipsec.py69neutron_vpnaas/services/vpn/device_drivers/strongswan_ipsec.py
68neutron_vpnaas/services/vpn/device_drivers/vyatta_ipsec.py70neutron_vpnaas/services/vpn/device_drivers/vyatta_ipsec.py
69neutron_vpnaas/services/vpn/device_drivers/template/openswan/ipsec.conf.template71neutron_vpnaas/services/vpn/device_drivers/template/openswan/ipsec.conf.template
7072
=== modified file 'neutron_vpnaas.egg-info/pbr.json'
--- neutron_vpnaas.egg-info/pbr.json 2015-04-30 18:32:31 +0000
+++ neutron_vpnaas.egg-info/pbr.json 2015-08-04 15:46:24 +0000
@@ -1,1 +1,1 @@
1{"is_release": true, "git_version": "eca9e87"}
2\ No newline at end of file1\ No newline at end of file
2{"is_release": true, "git_version": "db6dfc8"}
3\ No newline at end of file3\ No newline at end of file
44
=== modified file 'neutron_vpnaas.egg-info/requires.txt'
--- neutron_vpnaas.egg-info/requires.txt 2015-04-10 10:27:42 +0000
+++ neutron_vpnaas.egg-info/requires.txt 2015-08-04 15:46:24 +0000
@@ -1,14 +1,14 @@
1pbr>=0.6,!=0.7,<1.01pbr!=0.7,<1.0,>=0.6
2requests>=2.2.0,!=2.4.02requests!=2.4.0,>=2.2.0
3Jinja2>=2.6 # BSD License3 clause3Jinja2>=2.6 # BSD License3 clause
4netaddr>=0.7.124netaddr>=0.7.12
5SQLAlchemy>=0.9.7,<=0.9.995SQLAlchemy<=0.9.99,>=0.9.7
6alembic>=0.7.26alembic>=0.7.2
7six>=1.9.07six>=1.9.0
8oslo.concurrency>=1.8.0,<1.9.0 # Apache-2.08oslo.concurrency<1.9.0,>=1.8.0 # Apache-2.0
9oslo.config>=1.9.3,<1.10.0 # Apache-2.09oslo.config<1.10.0,>=1.9.3 # Apache-2.0
10oslo.db>=1.7.0,<1.8.0 # Apache-2.010oslo.db<1.8.0,>=1.7.0 # Apache-2.0
11oslo.log>=1.0.0,<1.1.0 # Apache-2.011oslo.log<1.1.0,>=1.0.0 # Apache-2.0
12oslo.messaging>=1.8.0,<1.9.0 # Apache-2.012oslo.messaging<1.9.0,>=1.8.0 # Apache-2.0
13oslo.serialization>=1.4.0,<1.5.0 # Apache-2.013oslo.serialization<1.5.0,>=1.4.0 # Apache-2.0
14oslo.utils>=1.4.0,<1.5.0 # Apache-2.014oslo.utils<1.5.0,>=1.4.0 # Apache-2.0
1515
=== modified file 'neutron_vpnaas/services/vpn/agent.py'
--- neutron_vpnaas/services/vpn/agent.py 2015-04-10 10:27:42 +0000
+++ neutron_vpnaas/services/vpn/agent.py 2015-08-04 15:46:24 +0000
@@ -34,6 +34,7 @@
34 """VPNAgent class which can handle vpn service drivers."""34 """VPNAgent class which can handle vpn service drivers."""
35 def __init__(self, host, conf=None):35 def __init__(self, host, conf=None):
36 super(VPNAgent, self).__init__(host=host, conf=conf)36 super(VPNAgent, self).__init__(host=host, conf=conf)
37 self.agent_state['binary'] = 'neutron-vpn-agent'
37 self.service = vpn_service.VPNService(self)38 self.service = vpn_service.VPNService(self)
38 self.device_drivers = self.service.load_device_drivers(host)39 self.device_drivers = self.service.load_device_drivers(host)
3940
4041
=== added file 'neutron_vpnaas/services/vpn/device_drivers/fedora_strongswan_ipsec.py'
--- neutron_vpnaas/services/vpn/device_drivers/fedora_strongswan_ipsec.py 1970-01-01 00:00:00 +0000
+++ neutron_vpnaas/services/vpn/device_drivers/fedora_strongswan_ipsec.py 2015-08-04 15:46:24 +0000
@@ -0,0 +1,107 @@
1# Copyright (c) 2015 IBM, Inc.
2# All Rights Reserved.
3#
4# Licensed under the Apache License, Version 2.0 (the "License"); you may
5# not use this file except in compliance with the License. You may obtain
6# a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13# License for the specific language governing permissions and limitations
14# under the License.
15
16import os
17
18from oslo_config import cfg
19from oslo_log import log as logging
20
21from neutron_vpnaas.services.vpn.device_drivers import ipsec
22from neutron_vpnaas.services.vpn.device_drivers import strongswan_ipsec
23
24LOG = logging.getLogger(__name__)
25TEMPLATE_PATH = os.path.dirname(os.path.abspath(__file__))
26
27cfg.CONF.set_default(name='default_config_area',
28 default=os.path.join(
29 TEMPLATE_PATH,
30 '/usr/share/strongswan/templates/'
31 'config/strongswan.d'),
32 group='strongswan')
33
34
35class FedoraStrongSwanProcess(strongswan_ipsec.StrongSwanProcess):
36
37 binary = 'strongswan'
38 CONFIG_DIRS = [
39 'var/run',
40 'log',
41 'etc',
42 'etc/strongswan/ipsec.d/aacerts',
43 'etc/strongswan/ipsec.d/acerts',
44 'etc/strongswan/ipsec.d/cacerts',
45 'etc/strongswan/ipsec.d/certs',
46 'etc/strongswan/ipsec.d/crls',
47 'etc/strongswan/ipsec.d/ocspcerts',
48 'etc/strongswan/ipsec.d/policies',
49 'etc/strongswan/ipsec.d/private',
50 'etc/strongswan/ipsec.d/reqs',
51 'etc/pki/nssdb/'
52 ]
53 STATUS_NOT_RUNNING_RE = ('Command:.*[ipsec|strongswan].*status.*'
54 'Exit code: [1|3] ')
55
56 def __init__(self, conf, process_id, vpnservice, namespace):
57 super(FedoraStrongSwanProcess, self).__init__(conf, process_id,
58 vpnservice, namespace)
59
60 def ensure_configs(self):
61 """Generate config files which are needed for StrongSwan.
62
63 If there is no directory, this function will create
64 dirs.
65 """
66 self.ensure_config_dir(self.vpnservice)
67 self.ensure_config_file(
68 'ipsec.conf',
69 cfg.CONF.strongswan.ipsec_config_template,
70 self.vpnservice)
71 self.ensure_config_file(
72 'strongswan.conf',
73 cfg.CONF.strongswan.strongswan_config_template,
74 self.vpnservice)
75 self.ensure_config_file(
76 'ipsec.secrets',
77 cfg.CONF.strongswan.ipsec_secret_template,
78 self.vpnservice)
79 self.copy_and_overwrite(cfg.CONF.strongswan.default_config_area,
80 self._get_config_filename('strongswan.d'))
81 # Fedora uses /usr/share/strongswan/templates/config/ as strongswan
82 # template directory. But /usr/share/strongswan/templates/config/
83 # strongswan.d does not include charon. Those configuration files
84 # are in /usr/share/strongswan/templates/config/plugins directory.
85 charon_dir = os.path.join(
86 cfg.CONF.strongswan.default_config_area,
87 'charon')
88 if not os.path.exists(charon_dir):
89 plugins_dir = os.path.join(
90 cfg.CONF.strongswan.default_config_area, '../plugins')
91 self.copy_and_overwrite(
92 plugins_dir,
93 self._get_config_filename('strongswan.d/charon'))
94
95 def _get_config_filename(self, kind):
96 config_dir = '%s/strongswan' % self.etc_dir
97 return os.path.join(config_dir, kind)
98
99
100class FedoraStrongSwanDriver(ipsec.IPsecDriver):
101
102 def create_process(self, process_id, vpnservice, namespace):
103 return FedoraStrongSwanProcess(
104 self.conf,
105 process_id,
106 vpnservice,
107 namespace)
0108
=== modified file 'neutron_vpnaas/services/vpn/device_drivers/ipsec.py'
--- neutron_vpnaas/services/vpn/device_drivers/ipsec.py 2015-04-10 10:27:42 +0000
+++ neutron_vpnaas/services/vpn/device_drivers/ipsec.py 2015-08-04 15:46:24 +0000
@@ -298,16 +298,17 @@
298 self.STATUS_MAP[status])298 self.STATUS_MAP[status])
299299
300 def _record_connection_status(self, connection_id, status,300 def _record_connection_status(self, connection_id, status,
301 updated_pending_status=False):301 force_status_update=False):
302 if not self.connection_status.get(connection_id):302 conn_info = self.connection_status.get(connection_id)
303 if not conn_info:
303 self.connection_status[connection_id] = {304 self.connection_status[connection_id] = {
304 'status': status,305 'status': status,
305 'updated_pending_status': updated_pending_status306 'updated_pending_status': force_status_update
306 }307 }
307 else:308 else:
308 self.connection_status[connection_id]['status'] = status309 conn_info['status'] = status
309 self.connection_status[connection_id]['updated_pending_status'] = (310 if force_status_update:
310 updated_pending_status)311 conn_info['updated_pending_status'] = True
311312
312313
313class OpenSwanProcess(BaseSwanProcess):314class OpenSwanProcess(BaseSwanProcess):
@@ -380,7 +381,7 @@
380 ip_addr = self._resolve_fqdn(address)381 ip_addr = self._resolve_fqdn(address)
381 if not ip_addr:382 if not ip_addr:
382 self._record_connection_status(connection_id, constants.ERROR,383 self._record_connection_status(connection_id, constants.ERROR,
383 updated_pending_status=True)384 force_status_update=True)
384 raise vpnaas.VPNPeerAddressNotResolved(peer_address=address)385 raise vpnaas.VPNPeerAddressNotResolved(peer_address=address)
385 else:386 else:
386 ip_addr = address387 ip_addr = address
387388
=== added file 'neutron_vpnaas/services/vpn/device_drivers/libreswan_ipsec.py'
--- neutron_vpnaas/services/vpn/device_drivers/libreswan_ipsec.py 1970-01-01 00:00:00 +0000
+++ neutron_vpnaas/services/vpn/device_drivers/libreswan_ipsec.py 2015-08-04 15:46:24 +0000
@@ -0,0 +1,50 @@
1# Copyright (c) 2015 Red Hat, Inc.
2# All Rights Reserved.
3#
4# Licensed under the Apache License, Version 2.0 (the "License"); you may
5# not use this file except in compliance with the License. You may obtain
6# a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13# License for the specific language governing permissions and limitations
14# under the License.
15from neutron_vpnaas.services.vpn.device_drivers import ipsec
16
17
18class LibreSwanProcess(ipsec.OpenSwanProcess):
19 """Libreswan Process manager class.
20
21 Libreswan needs nssdb initialised before running pluto daemon.
22 """
23 def __init__(self, conf, process_id, vpnservice, namespace):
24 super(LibreSwanProcess, self).__init__(conf, process_id,
25 vpnservice, namespace)
26
27 def ensure_configs(self):
28 """Generate config files which are needed for Libreswan.
29
30 Initialise the nssdb, otherwise pluto daemon will fail to run.
31 """
32 super(LibreSwanProcess, self).ensure_configs()
33 # Load the ipsec kernel module if not loaded
34 self._execute([self.binary, '_stackmanager', 'start'])
35 # checknss creates nssdb only if it is missing
36 # It is added in Libreswan version v3.10
37 # For prior versions use initnss
38 try:
39 self._execute([self.binary, 'checknss', self.etc_dir])
40 except RuntimeError:
41 self._execute([self.binary, 'initnss', self.etc_dir])
42
43
44class LibreSwanDriver(ipsec.IPsecDriver):
45 def create_process(self, process_id, vpnservice, namespace):
46 return LibreSwanProcess(
47 self.conf,
48 process_id,
49 vpnservice,
50 namespace)
051
=== modified file 'neutron_vpnaas/tests/unit/db/vpn/test_vpn_db.py'
--- neutron_vpnaas/tests/unit/db/vpn/test_vpn_db.py 2015-04-10 10:27:42 +0000
+++ neutron_vpnaas/tests/unit/db/vpn/test_vpn_db.py 2015-08-04 15:46:24 +0000
@@ -453,6 +453,16 @@
453453
454class TestVpnaas(VPNPluginDbTestCase):454class TestVpnaas(VPNPluginDbTestCase):
455455
456 def setUp(self, **kwargs):
457 # TODO(armax): this is far from being a unit test case, as it tests
458 # that multiple parties (core + vpn) are integrated properly and
459 # should be replaced by API test that do not rely on so much mocking.
460 # NOTE(armax): make sure that the callbacks needed by this test are
461 # registered, as they may get wiped out depending by the order in
462 # which imports, subscriptions and mocks occur.
463 super(TestVpnaas, self).setUp(**kwargs)
464 vpn_db.subscribe()
465
456 def _check_policy(self, policy, keys, lifetime):466 def _check_policy(self, policy, keys, lifetime):
457 for k, v in keys:467 for k, v in keys:
458 self.assertEqual(policy[k], v)468 self.assertEqual(policy[k], v)
459469
=== modified file 'neutron_vpnaas/tests/unit/services/vpn/device_drivers/test_ipsec.py'
--- neutron_vpnaas/tests/unit/services/vpn/device_drivers/test_ipsec.py 2015-04-10 10:27:42 +0000
+++ neutron_vpnaas/tests/unit/services/vpn/device_drivers/test_ipsec.py 2015-08-04 15:46:24 +0000
@@ -25,7 +25,9 @@
25from oslo_config import cfg25from oslo_config import cfg
2626
27from neutron_vpnaas.extensions import vpnaas27from neutron_vpnaas.extensions import vpnaas
28from neutron_vpnaas.services.vpn.device_drivers import fedora_strongswan_ipsec
28from neutron_vpnaas.services.vpn.device_drivers import ipsec as ipsec_driver29from neutron_vpnaas.services.vpn.device_drivers import ipsec as ipsec_driver
30from neutron_vpnaas.services.vpn.device_drivers import libreswan_ipsec
29from neutron_vpnaas.services.vpn.device_drivers import strongswan_ipsec31from neutron_vpnaas.services.vpn.device_drivers import strongswan_ipsec
30from neutron_vpnaas.tests import base32from neutron_vpnaas.tests import base
3133
@@ -643,6 +645,36 @@
643 self.driver.connection_status)645 self.driver.connection_status)
644646
645647
648class TestLibreSwanProcess(base.BaseTestCase):
649 def setUp(self):
650 super(TestLibreSwanProcess, self).setUp()
651 self.ipsec_process = libreswan_ipsec.LibreSwanProcess(mock.ANY,
652 'foo-process-id',
653 FAKE_VPN_SERVICE,
654 mock.ANY)
655
656 def test_ensure_configs(self):
657 ipsec_driver.OpenSwanProcess.ensure_configs = mock.Mock()
658 with mock.patch.object(self.ipsec_process, '_execute') as fake_execute:
659 self.ipsec_process.ensure_configs()
660 expected = [mock.call(['ipsec', '_stackmanager', 'start']),
661 mock.call(['ipsec', 'checknss',
662 self.ipsec_process.etc_dir])]
663 fake_execute.assert_has_calls(expected)
664 self.assertEqual(fake_execute.call_count, 2)
665
666 with mock.patch.object(self.ipsec_process, '_execute') as fake_execute:
667 fake_execute.side_effect = [None, RuntimeError, None]
668 self.ipsec_process.ensure_configs()
669 expected = [mock.call(['ipsec', '_stackmanager', 'start']),
670 mock.call(['ipsec', 'checknss',
671 self.ipsec_process.etc_dir]),
672 mock.call(['ipsec', 'initnss',
673 self.ipsec_process.etc_dir])]
674 fake_execute.assert_has_calls(expected)
675 self.assertEqual(fake_execute.call_count, 3)
676
677
646class IPsecStrongswanDeviceDriverLegacy(IPSecDeviceLegacy):678class IPsecStrongswanDeviceDriverLegacy(IPSecDeviceLegacy):
647 def setUp(self, driver=strongswan_ipsec.StrongSwanDriver,679 def setUp(self, driver=strongswan_ipsec.StrongSwanDriver,
648 ipsec_process='strongswan_ipsec.StrongSwanProcess'):680 ipsec_process='strongswan_ipsec.StrongSwanProcess'):
@@ -738,3 +770,20 @@
738 ipsec_process='strongswan_ipsec.StrongSwanProcess'):770 ipsec_process='strongswan_ipsec.StrongSwanProcess'):
739 super(IPsecStrongswanDeviceDriverDVR, self).setUp(driver,771 super(IPsecStrongswanDeviceDriverDVR, self).setUp(driver,
740 ipsec_process)772 ipsec_process)
773
774
775class IPsecFedoraStrongswanDeviceDriverLegacy(
776 IPsecStrongswanDeviceDriverLegacy):
777
778 def setUp(self, driver=fedora_strongswan_ipsec.FedoraStrongSwanDriver,
779 ipsec_process=fedora_strongswan_ipsec.FedoraStrongSwanProcess):
780 super(IPsecFedoraStrongswanDeviceDriverLegacy,
781 self).setUp(driver, ipsec_process)
782
783
784class IPsecFedoraStrongswanDeviceDriverDVR(IPSecDeviceDVR):
785
786 def setUp(self, driver=fedora_strongswan_ipsec.FedoraStrongSwanDriver,
787 ipsec_process=fedora_strongswan_ipsec.FedoraStrongSwanProcess):
788 super(IPsecFedoraStrongswanDeviceDriverDVR, self).setUp(driver,
789 ipsec_process)
741790
=== modified file 'requirements.txt'
--- requirements.txt 2015-04-30 18:32:31 +0000
+++ requirements.txt 2015-08-04 15:46:24 +0000
@@ -1,21 +1,21 @@
1# The order of packages is significant, because pip processes them in the order1# The order of packages is significant, because pip processes them in the order
2# of appearance. Changing the order has an impact on the overall integration2# of appearance. Changing the order has an impact on the overall integration
3# process, which may cause wedges in the gate later.3# process, which may cause wedges in the gate later.
4pbr>=0.6,!=0.7,<1.04pbr!=0.7,<1.0,>=0.6
55
6requests>=2.2.0,!=2.4.06requests!=2.4.0,>=2.2.0
7Jinja2>=2.6 # BSD License (3 clause)7Jinja2>=2.6 # BSD License (3 clause)
8netaddr>=0.7.128netaddr>=0.7.12
9SQLAlchemy>=0.9.7,<=0.9.999SQLAlchemy<=0.9.99,>=0.9.7
10alembic>=0.7.210alembic>=0.7.2
11six>=1.9.011six>=1.9.0
12oslo.concurrency>=1.8.0,<1.9.0 # Apache-2.012oslo.concurrency<1.9.0,>=1.8.0 # Apache-2.0
13oslo.config>=1.9.3,<1.10.0 # Apache-2.013oslo.config<1.10.0,>=1.9.3 # Apache-2.0
14oslo.db>=1.7.0,<1.8.0 # Apache-2.014oslo.db<1.8.0,>=1.7.0 # Apache-2.0
15oslo.log>=1.0.0,<1.1.0 # Apache-2.015oslo.log<1.1.0,>=1.0.0 # Apache-2.0
16oslo.messaging>=1.8.0,<1.9.0 # Apache-2.016oslo.messaging<1.9.0,>=1.8.0 # Apache-2.0
17oslo.serialization>=1.4.0,<1.5.0 # Apache-2.017oslo.serialization<1.5.0,>=1.4.0 # Apache-2.0
18oslo.utils>=1.4.0,<1.5.0 # Apache-2.018oslo.utils<1.5.0,>=1.4.0 # Apache-2.0
1919
20# This project does depend on neutron as a library, but the20# This project does depend on neutron as a library, but the
21# openstack tooling does not play nicely with projects that21# openstack tooling does not play nicely with projects that
2222
=== modified file 'setup.cfg'
--- setup.cfg 2015-03-30 11:20:04 +0000
+++ setup.cfg 2015-08-04 15:46:24 +0000
@@ -1,6 +1,6 @@
1[metadata]1[metadata]
2name = neutron-vpnaas2name = neutron-vpnaas
3version = 2015.13version = 2015.1.1
4summary = OpenStack Networking VPN as a Service4summary = OpenStack Networking VPN as a Service
5description-file = 5description-file =
6 README.rst6 README.rst
77
=== modified file 'setup.py'
--- setup.py 2015-01-14 11:23:12 +0000
+++ setup.py 2015-08-04 15:46:24 +0000
@@ -1,4 +1,3 @@
1#!/usr/bin/env python
2# Copyright (c) 2013 Hewlett-Packard Development Company, L.P.1# Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
3#2#
4# Licensed under the Apache License, Version 2.0 (the "License");3# Licensed under the Apache License, Version 2.0 (the "License");
54
=== modified file 'test-requirements.txt'
--- test-requirements.txt 2015-04-10 10:27:42 +0000
+++ test-requirements.txt 2015-08-04 15:46:24 +0000
@@ -1,22 +1,22 @@
1# The order of packages is significant, because pip processes them in the order1# The order of packages is significant, because pip processes them in the order
2# of appearance. Changing the order has an impact on the overall integration2# of appearance. Changing the order has an impact on the overall integration
3# process, which may cause wedges in the gate later.3# process, which may cause wedges in the gate later.
4hacking>=0.10.0,<0.114hacking<0.11,>=0.10.0
55
6cliff>=1.10.0,<1.11.0 # Apache-2.06cliff<1.11.0,>=1.10.0 # Apache-2.0
7coverage>=3.67coverage>=3.6
8discover8discover
9fixtures>=0.3.149fixtures<1.3.0,>=0.3.14
10mock>=1.010mock<1.1.0,>=1.0
11python-subunit>=0.0.1811python-subunit>=0.0.18
12requests-mock>=0.6.0 # Apache-2.012requests-mock>=0.6.0 # Apache-2.0
13sphinx>=1.1.2,!=1.2.0,!=1.3b1,<1.313sphinx!=1.2.0,!=1.3b1,<1.3,>=1.1.2
14oslosphinx>=2.5.0,<2.6.0 # Apache-2.014oslosphinx<2.6.0,>=2.5.0 # Apache-2.0
15testrepository>=0.0.1815testrepository>=0.0.18
16testtools>=0.9.36,!=1.2.016testtools!=1.2.0,>=0.9.36
17testscenarios>=0.417testscenarios>=0.4
18WebOb>=1.2.318WebOb>=1.2.3
19WebTest>=2.019WebTest>=2.0
20oslotest>=1.5.1,<1.6.0 # Apache-2.020oslotest<1.6.0,>=1.5.1 # Apache-2.0
21psycopg221psycopg2
22MySQL-python22MySQL-python

Subscribers

People subscribed via source and target branches

to all changes: