Compare commits

...

23 Commits

Author SHA1 Message Date
Armando Migliaccio
131b2c3d26 Convert gate_hook to devstack-tools
Conflicts:
	neutronclient/tests/functional/hooks/gate_hook.sh

Mitaka changes: added vpnaas hook and use load_rc_hook to load it
instead of setting DEVSTACK_LOCAL_CONFIG.

Change-Id: I2387bc9778a77b1673751bc4c1ff50f8d4826a5d
Co-Authored-By: Ihar Hrachyshka <ihrachys@redhat.com>
Co-Authored-By: Sean Dague <sean@dague.net>
Original-Commit: Ibd0f67f9131e7f67f3a4a62cb6ad28bf80e11bbf
(cherry picked from commit e516b8230c)
2017-03-06 13:14:09 +00:00
Rodion Tikunov
40b55be84e Added --enable-snat option for router-gateway-set
If enable_snat_by_default option set to false and disable snat via cli
it becomes unavailable to enable snat again.
This commit allows to enable snat after disabling it.

Change-Id: I01009d5cd5edd5be3eead615c37d6aa2e3224442
Closes-Bug: #1598171
(cherry picked from commit cc1d3fdd35)
2016-11-25 12:16:00 +00:00
Jenkins
f3a9d40fc8 Merge "Use upper constraints for all jobs in tox.ini" into stable/mitaka 2016-08-26 19:07:39 +00:00
Jenkins
731a4b7494 Merge "Add quota support for LB and Listeners" into stable/mitaka 2016-08-26 16:24:46 +00:00
AvnishPal
0047da6803 Use upper constraints for all jobs in tox.ini
Openstack infra now supports upper constraints for
all jobs. Updated tox.ini to use upper constraints
for all jobs.

Change-Id: I94f57e294a7de91d45c26b1f90caad67b0974718
Closes-Bug: #1614361
(cherry picked from commit 41701862fd)
2016-08-24 03:03:46 +00:00
Zhongcheng Lao
10c9b93764 Fixed --insecure not taking effect when specified
--insecure did not take effect currently which would prevent
neutron client from establishing connections to keystone
as by default the server certificate will be validated.

This patch will fix the issue to take the --insecure option
into consideration during constructing auth session.

Conflicts:
	neutronclient/tests/unit/test_shell.py

Closes-Bug: #1538959
Co-Authored-By: Akihiro Motoki <amotoki@gmail.com>
Change-Id: Id622fe097b2f12ab1a047f17005022c335fc6a4b
(cherry picked from commit 1828552b9c)
2016-08-19 12:03:58 +00:00
reedip
80a05bb43d Add quota support for LB and Listeners
This patch adds support for quota update of
Loadbalancers and Listeners.

Change-Id: I94c0e0898dff18fbadf1c24b5555dd497e9bf640
Closes-Bug: #1559027
(cherry picked from commit 310a6ece52)
2016-08-18 04:48:13 +00:00
Jenkins
519caf7f1e Merge "Fixes unclear error when no --pool-prefix given" into stable/mitaka 2016-07-26 12:30:38 +00:00
Hirofumi Ichihara
e7e84d3511 Add functional test hook for fwaas command
This patch adds a hook into functional test so that
fwaas command test runs.

(cherry picked from commit 6bc4685f6b)
Change-Id: Ib4ba644b22db0df91a9b0c7011b46ece337198af
Closes-Bug: #1604510
2016-07-19 20:47:00 +00:00
Inessa Vasilevskaya
a04f98c993 Fixes unclear error when no --pool-prefix given
--pool-prefix is required on subnetpool creation.
refactor: removed unused 'for_create' argument in
add_updatable_arguments in subnetpool module.
Closes-bug: #1536479

Change-Id: I79573369cb95c0b090e9ebfea9af40485d968e2f
(cherry-picked from commit 37ec942417)
2016-07-06 18:02:00 +03:00
Jenkins
eba0c389d0 Merge "Revert "Do not print 'Created' message when using non-table formatter"" into stable/mitaka 2016-06-11 04:46:31 +00:00
Ihar Hrachyshka
8b182c3bbf Revert "Do not print 'Created' message when using non-table formatter"
This patch broke DLRN (RDO trunk) CI jobs for stable/liberty. While
Mitaka release of the Puppet module does not have the issue, we are not
generally allowed to break external tools.

Closes-Bug: #1589442
This reverts commit 0411c5a8d4.

Change-Id: I449174d8bd0de85c072cc8c66e1a3bdae65dcc6b
2016-06-06 10:00:54 +00:00
Jenkins
d5990156af Merge "Updated from global requirements" into stable/mitaka 2016-05-23 18:59:02 +00:00
Ihar Hrachyshka
13a0ce3ce1 Constraint tox targets with upper-constraints.txt
Client version pin is maintained in upper-constraints.txt file, so we
should replace it in the file with source based specifier before
applying it to pip install, otherwise pip fails with:

Could not satisfy constraints for 'python-neutronclient': installation
from path or url cannot be constrained to a version

Also switched to using stable/mitaka branch instead of master.

Change-Id: I33302cdcab980a42c39dc9ec1e430add459615ff
Closes-Bug: #1583050
(cherry picked from commit 78d778cdec)
2016-05-23 11:57:18 +02:00
OpenStack Proposal Bot
f0311ef885 Updated from global requirements
Change-Id: Ie2062fc852b794a87720977fddef94156d5ddc5a
2016-05-18 13:48:42 +00:00
Ihar Hrachyshka
9ff116091e Switched from fixtures.MonkeyPatch to mock.patch
fixtures 2.0.0 released a new version of monkey patching fixture that
triggered issues with patching out class methods in stable/liberty.

We already stopped relying on fixtures for monkey patching in neutron:
I58d7a750e263e4af54589ace07ac00bec34b553a and switched to mock there.

fixtures library is still used for other fixtures, so the dependency
stays. Mock library is already in the dependency list, so
test-requirements.txt is not touched.

Change-Id: If43f3e08ee2235f96b0e5069b0df798a1acb48ea
Closes-Bug: #1583029
(cherry picked from commit 35ce1a512a)
2016-05-18 14:51:09 +02:00
Ihar Hrachyshka
22b25eb50b tests: removed mocking for Client.get_attr_metadata
The method is not present since XML support removal:
I88b0fdd65a649694252d5ff43a174e75026df5b1

Change-Id: Iaa920a1e9bd37b97ed6f4f5a4d1da05aac20d366
Related-Bug: #1583029
(cherry picked from commit 9e4f826166)
2016-05-18 14:50:56 +02:00
Jenkins
8f54846187 Merge "Do not print 'Created' message when using non-table formatter" into stable/mitaka 2016-05-17 08:04:28 +00:00
OpenStack Proposal Bot
ad92e4fe2e Updated from global requirements
Change-Id: Ic877783c98697b4cd570ee5213648b7ad057f2ff
2016-04-18 15:06:46 +00:00
Lokesh S
42e64908c3 Log SHA1 hash of X-Auth-Token value
Remove logging of sensitive information like the
token value from X-Auth-Token. Instead log the sha1
hash of the token value, prefixed with '{SHA1}'.

Closes-Bug: #1367339
Change-Id: I72d2ff5ca569c942aa6896aeadab489ff0097255
(cherry picked from commit d8fa792ee7)
2016-04-04 23:12:18 +00:00
OpenStack Proposal Bot
c464316957 Updated from global requirements
Change-Id: Ice28e51dd56ce226bea58ef540661a53ada37282
2016-03-24 13:50:36 +00:00
Akihiro Motoki
0411c5a8d4 Do not print 'Created' message when using non-table formatter
When using non-table formatter like JSON or YAML formatter,
users want to pass output result to some other program.
Printing 'Created' message breaks the data format
and non-table formatter makes useless.

Functional tests for non-table formatters is added
to avoid the same thing again.

Change-Id: Ieb38bd26d26d134d4d274ad2d9f4d1e79fa4e977
Closes-Bug: #1548897
(cherry picked from commit 150cc4ce56)
2016-03-23 16:11:01 +00:00
Doug Hellmann
d88cccb457 Update .gitreview for stable/mitaka
Change-Id: I0f5c103b7b074ed19f5130f1e0a4c669f8d62262
2016-03-09 13:26:51 -05:00
19 changed files with 306 additions and 49 deletions

View File

@@ -2,3 +2,4 @@
host=review.openstack.org
port=29418
project=openstack/python-neutronclient.git
defaultbranch=stable/mitaka

View File

@@ -19,6 +19,7 @@
import argparse
import functools
import hashlib
import logging
import netaddr
import os
@@ -30,6 +31,8 @@ import six
from neutronclient._i18n import _
from neutronclient.common import exceptions
SENSITIVE_HEADERS = ('X-Auth-Token',)
def env(*vars, **kwargs):
"""Returns the first environment variable set.
@@ -167,8 +170,13 @@ def http_log_req(_logger, args, kwargs):
else:
string_parts.append(' %s' % element)
for element in kwargs['headers']:
header = ' -H "%s: %s"' % (element, kwargs['headers'][element])
for (key, value) in six.iteritems(kwargs['headers']):
if key in SENSITIVE_HEADERS:
v = value.encode('utf-8')
h = hashlib.sha1(v)
d = h.hexdigest()
value = "{SHA1}%s" % d
header = ' -H "%s: %s"' % (key, value)
string_parts.append(header)
if 'body' in kwargs and kwargs['body']:

View File

@@ -184,6 +184,12 @@ class UpdateQuota(neutronV20.NeutronCommand, show.ShowOne):
parser.add_argument(
'--health-monitor', metavar='health_monitors',
help=_('The limit of health monitors.'))
parser.add_argument(
'--loadbalancer', metavar='loadbalancers',
help=_('The limit of load balancers.'))
parser.add_argument(
'--listener', metavar='listeners',
help=_('The limit of listeners.'))
parser.add_argument(
'pos_tenant_id',
help=argparse.SUPPRESS, nargs='?')
@@ -203,7 +209,8 @@ class UpdateQuota(neutronV20.NeutronCommand, show.ShowOne):
quota = {}
for resource in ('network', 'subnet', 'port', 'router', 'floatingip',
'security_group', 'security_group_rule',
'vip', 'pool', 'member', 'health_monitor'):
'vip', 'pool', 'member', 'health_monitor',
'loadbalancer', 'listener'):
if getattr(parsed_args, resource):
quota[resource] = self._validate_int(
resource,

View File

@@ -220,6 +220,9 @@ class SetGatewayRouter(neutronV20.NeutronCommand):
parser.add_argument(
'external_network', metavar='EXTERNAL-NETWORK',
help=_('ID or name of the external network for the gateway.'))
parser.add_argument(
'--enable-snat', action='store_true',
help=_('Enable source NAT on the router gateway.'))
parser.add_argument(
'--disable-snat', action='store_true',
help=_('Disable source NAT on the router gateway.'))
@@ -242,6 +245,8 @@ class SetGatewayRouter(neutronV20.NeutronCommand):
_ext_net_id = neutronV20.find_resourceid_by_name_or_id(
neutron_client, 'network', parsed_args.external_network)
router_dict = {'network_id': _ext_net_id}
if parsed_args.enable_snat:
router_dict['enable_snat'] = True
if parsed_args.disable_snat:
router_dict['enable_snat'] = False
if parsed_args.fixed_ip:

View File

@@ -26,7 +26,7 @@ def _format_prefixes(subnetpool):
return subnetpool['prefixes']
def add_updatable_arguments(parser):
def add_updatable_arguments(parser, for_create=False):
parser.add_argument(
'--min-prefixlen', type=int,
help=_('Subnetpool minimum prefix length.'))
@@ -39,6 +39,7 @@ def add_updatable_arguments(parser):
parser.add_argument(
'--pool-prefix',
action='append', dest='prefixes',
required=for_create,
help=_('Subnetpool prefixes (This option can be repeated).'))
utils.add_boolean_argument(
parser, '--is-default',
@@ -46,7 +47,7 @@ def add_updatable_arguments(parser):
'(True meaning default).'))
def updatable_args2body(parsed_args, body, for_create=True):
def updatable_args2body(parsed_args, body):
neutronV20.update_dict(parsed_args, body,
['name', 'prefixes', 'default_prefixlen',
'min_prefixlen', 'max_prefixlen', 'is_default'])
@@ -75,7 +76,7 @@ class CreateSubnetPool(neutronV20.CreateCommand):
resource = 'subnetpool'
def add_known_arguments(self, parser):
add_updatable_arguments(parser)
add_updatable_arguments(parser, for_create=True)
parser.add_argument(
'--shared',
action='store_true',
@@ -135,7 +136,7 @@ class UpdateSubnetPool(neutronV20.UpdateCommand):
def args2body(self, parsed_args):
body = {}
updatable_args2body(parsed_args, body, for_create=False)
updatable_args2body(parsed_args, body)
# Parse and update for "address-scope" option/s
if parsed_args.no_address_scope:

View File

@@ -896,7 +896,8 @@ class NeutronShell(app.App):
"""
cloud_config = os_client_config.OpenStackConfig().get_one_cloud(
cloud=self.options.os_cloud, argparse=self.options,
network_api_version=self.api_version)
network_api_version=self.api_version,
verify=not self.options.insecure)
verify, cert = cloud_config.get_requests_verify_args()
# TODO(singhj): Remove dependancy on HTTPClient
@@ -930,6 +931,7 @@ class NeutronShell(app.App):
service_name=cloud_config.get_service_name('network'),
endpoint_type=interface,
auth=auth,
insecure=not verify,
log_credentials=True)
return

View File

@@ -0,0 +1,2 @@
enable_plugin neutron-fwaas git://git.openstack.org/openstack/neutron-fwaas
enable_service q-fwaas

37
neutronclient/tests/functional/hooks/gate_hook.sh Normal file → Executable file
View File

@@ -4,9 +4,42 @@ set -ex
VENV=${1:-"functional"}
if [ "$VENV" == "functional-adv-svcs" ]
GATE_DEST=$BASE/new
NEUTRONCLIENT_PATH=$GATE_DEST/python-neutronclient
GATE_HOOKS=$NEUTRONCLIENT_PATH/neutronclient/tests/functional/hooks
DEVSTACK_PATH=$GATE_DEST/devstack
LOCAL_CONF=$DEVSTACK_PATH/late-local.conf
DSCONF=/tmp/devstack-tools/bin/dsconf
# Install devstack-tools used to produce local.conf; we can't rely on
# test-requirements.txt because the gate hook is triggered before neutronclient
# is installed
sudo -H pip install virtualenv
virtualenv /tmp/devstack-tools
/tmp/devstack-tools/bin/pip install -U devstack-tools==0.4.0
# Inject config from hook into localrc
function load_rc_hook {
local hook="$1"
local tmpfile
local config
tmpfile=$(tempfile)
config=$(cat $GATE_HOOKS/$hook)
echo "[[local|localrc]]" > $tmpfile
$DSCONF setlc_raw $tmpfile "$config"
$DSCONF merge_lc $LOCAL_CONF $tmpfile
rm -f $tmpfile
}
if [ "$VENV" == "functional" ]
then
export DEVSTACK_LOCAL_CONFIG="enable_plugin neutron-vpnaas git://git.openstack.org/openstack/neutron-vpnaas"
load_rc_hook fwaas
fi
if [ "$VENV" == "functional-adv-svcs" ]
then
load_rc_hook vpnaas
fi
export DEVSTACK_LOCALCONF=$(cat $LOCAL_CONF)
$BASE/new/devstack-gate/devstack-vm-gate.sh

View File

@@ -0,0 +1 @@
enable_plugin neutron-vpnaas git://git.openstack.org/openstack/neutron-vpnaas

View File

@@ -18,7 +18,7 @@ import contextlib
import itertools
import sys
import fixtures
import mock
from mox3 import mox
from oslo_utils import encodeutils
from oslotest import base
@@ -182,9 +182,6 @@ class CLITestV20Base(base.BaseTestCase):
cmd_resource=None, parent_id=None):
return name_or_id
def _get_attr_metadata(self):
return self.metadata
def setUp(self, plurals=None):
"""Prepare the test environment."""
super(CLITestV20Base, self).setUp()
@@ -195,16 +192,14 @@ class CLITestV20Base(base.BaseTestCase):
self.mox = mox.Mox()
self.endurl = ENDURL
self.fake_stdout = FakeStdout()
self.useFixture(fixtures.MonkeyPatch('sys.stdout', self.fake_stdout))
self.useFixture(fixtures.MonkeyPatch(
'neutronclient.neutron.v2_0.find_resourceid_by_name_or_id',
self._find_resourceid))
self.useFixture(fixtures.MonkeyPatch(
'neutronclient.neutron.v2_0.find_resourceid_by_id',
self._find_resourceid))
self.useFixture(fixtures.MonkeyPatch(
'neutronclient.v2_0.client.Client.get_attr_metadata',
self._get_attr_metadata))
self.addCleanup(mock.patch.stopall)
mock.patch('sys.stdout', new=self.fake_stdout).start()
mock.patch('neutronclient.neutron.v2_0.find_resourceid_by_name_or_id',
new=self._find_resourceid).start()
mock.patch('neutronclient.neutron.v2_0.find_resourceid_by_id',
new=self._find_resourceid).start()
self.client = client.Client(token=TOKEN, endpoint_url=self.endurl)
self.client.format = self.format

View File

@@ -345,6 +345,18 @@ class CLITestV20RouterJSON(test_cli20.CLITestV20Base):
{"network_id": "externalid"}}
)
def test_set_gateway_enable_snat(self):
# enable external gateway for router: myid externalid.
resource = 'router'
cmd = router.SetGatewayRouter(test_cli20.MyApp(sys.stdout), None)
args = ['myid', 'externalid', '--enable-snat']
self._test_update_resource(resource, cmd, 'myid',
args,
{"external_gateway_info":
{"network_id": "externalid",
"enable_snat": True}}
)
def test_set_gateway_disable_snat(self):
# set external gateway for router: myid externalid.
resource = 'router'

View File

@@ -118,6 +118,19 @@ class CLITestV20SubnetPoolJSON(test_cli20.CLITestV20Base):
self._test_create_resource(resource, cmd, name, myid, args,
position_names, position_values)
def test_create_subnetpool_no_poolprefix(self):
# Should raise an error because --pool-prefix is required
resource = 'subnetpool'
cmd = subnetpool.CreateSubnetPool(test_cli20.MyApp(sys.stdout), None)
name = 'myname'
myid = 'myid'
args = [name]
position_names = ['name']
position_values = [name]
self.assertRaises(SystemExit, self._test_create_resource, resource,
cmd, name, myid, args, position_names,
position_values)
def test_list_subnetpool_pagination(self):
cmd = subnetpool.ListSubnetPool(test_cli20.MyApp(sys.stdout), None)
self.mox.StubOutWithMock(subnetpool.ListSubnetPool, "extend_list")

View File

@@ -34,15 +34,9 @@ class CLITestV20ExtensionJSON(test_cli20.CLITestV20Base):
self._mock_extension_loading()
super(CLITestV20ExtensionJSON, self).setUp(plurals={'tags': 'tag'})
def _create_patch(self, name, func=None):
patcher = mock.patch(name)
thing = patcher.start()
self.addCleanup(patcher.stop)
return thing
def _mock_extension_loading(self):
ext_pkg = 'neutronclient.common.extension'
contrib = self._create_patch(ext_pkg + '._discover_via_entry_points')
contrib = mock.patch(ext_pkg + '._discover_via_entry_points').start()
contrib.return_value = [("_fox_sockets", fox_sockets)]
return contrib
@@ -134,15 +128,9 @@ class CLITestV20ExtensionJSONAlternatePlurals(test_cli20.CLITestV20Base):
self._mock_extension_loading()
super(CLITestV20ExtensionJSONAlternatePlurals, self).setUp()
def _create_patch(self, name, func=None):
patcher = mock.patch(name)
thing = patcher.start()
self.addCleanup(patcher.stop)
return thing
def _mock_extension_loading(self):
ext_pkg = 'neutronclient.common.extension'
contrib = self._create_patch(ext_pkg + '._discover_via_entry_points')
contrib = mock.patch(ext_pkg + '._discover_via_entry_points').start()
ip_address = mock.MagicMock()
ip_address.IPAddress = self.IPAddress
ip_address.IPAddressesList = self.IPAddressesList
@@ -193,15 +181,9 @@ class CLITestV20ExtensionJSONChildResource(test_cli20.CLITestV20Base):
self._mock_extension_loading()
super(CLITestV20ExtensionJSONChildResource, self).setUp()
def _create_patch(self, name, func=None):
patcher = mock.patch(name)
thing = patcher.start()
self.addCleanup(patcher.stop)
return thing
def _mock_extension_loading(self):
ext_pkg = 'neutronclient.common.extension'
contrib = self._create_patch(ext_pkg + '._discover_via_entry_points')
contrib = mock.patch(ext_pkg + '._discover_via_entry_points').start()
child = mock.MagicMock()
child.Child = self.Child
child.ChildrenList = self.ChildrenList

View File

@@ -20,11 +20,14 @@ import re
import sys
import fixtures
from keystoneauth1 import session
import mock
from mox3 import mox
import six
import testtools
from testtools import matchers
from neutronclient.common import clientmanager
from neutronclient import shell as openstack_shell
@@ -35,6 +38,13 @@ DEFAULT_TENANT_NAME = 'tenant_name'
DEFAULT_AUTH_URL = 'http://127.0.0.1:5000/v2.0/'
DEFAULT_TOKEN = '3bcc3d3a03f44e3d8377f9247b0ad155'
DEFAULT_URL = 'http://quantum.example.org:9696/'
DEFAULT_REGION = 'regionOne'
DEFAULT_ENDPOINT_TYPE = 'public'
DEFAULT_API_VERSION = '2.0'
DEFAULT_SERVICE_TYPE = 'network'
DEFAULT_SERVICE_NAME = 'neutron'
DEFAULT_RETRIES = 3
DEFAULT_TIMEOUT = 3.0
class ShellTest(testtools.TestCase):
@@ -225,3 +235,128 @@ class ShellTest(testtools.TestCase):
search_str = "Try 'neutron help port-create' for more information"
self.assertTrue(any(search_str in string for string
in stderr.split('\n')))
def _test_authenticate_user(self, expect_verify, expect_insecure,
**options):
base_options = {'os_cloud': None,
'http_timeout': DEFAULT_TIMEOUT,
'region_name': DEFAULT_REGION,
'network_service_name': DEFAULT_SERVICE_NAME,
'neutron_service_type': DEFAULT_SERVICE_TYPE}
options.update(base_options)
if options.get('os_token'):
options.update({'os_token': 'token', 'os_url': 'url'})
else:
options.update({'os_token': None, 'os_url': None})
with mock.patch.object(openstack_shell.NeutronShell,
'run_subcommand'), \
mock.patch.object(session, 'Session') as session_mock, \
mock.patch.object(clientmanager, 'ClientManager') as cmgr_mock:
shell = openstack_shell.NeutronShell(DEFAULT_API_VERSION)
shell.options = mock.Mock(spec=options.keys())
for k, v in options.items():
setattr(shell.options, k, v)
shell.options.os_endpoint_type = DEFAULT_ENDPOINT_TYPE
shell.options.retries = DEFAULT_RETRIES
if not (options.get('os_token') and options.get('os_url')):
auth = mock.ANY
auth_session = mock.sentinel.session
session_mock.return_value = auth_session
else:
auth = None
auth_session = None
shell.authenticate_user()
if not (options.get('os_token') and options.get('os_url')):
session_mock.assert_called_once_with(
auth=mock.ANY, verify=expect_verify,
cert=options.get('cert'),
timeout=DEFAULT_TIMEOUT)
else:
self.assertFalse(session_mock.called)
cmgr_mock.assert_called_once_with(
retries=DEFAULT_RETRIES,
raise_errors=False,
session=auth_session,
url=options.get('os_url'),
token=options.get('os_token'),
region_name=DEFAULT_REGION,
api_version=DEFAULT_API_VERSION,
service_type=DEFAULT_SERVICE_TYPE,
service_name=DEFAULT_SERVICE_NAME,
endpoint_type=DEFAULT_ENDPOINT_TYPE,
auth=auth,
insecure=expect_insecure,
log_credentials=True)
def test_authenticate_secure_with_cacert_with_cert(self):
self._test_authenticate_user(
insecure=False, cacert='cacert', cert='cert',
expect_verify='cacert', expect_insecure=False)
def test_authenticate_secure_with_cacert_with_cert_with_token(self):
self._test_authenticate_user(
os_token='token',
insecure=False, cacert='cacert', cert='cert',
expect_verify='cacert', expect_insecure=False)
def test_authenticate_insecure_with_cacert_with_cert(self):
self._test_authenticate_user(
insecure=True, cacert='cacert', cert='cert',
expect_verify=False, expect_insecure=True)
def test_authenticate_insecure_with_cacert_with_cert_with_token(self):
self._test_authenticate_user(
os_token='token',
insecure=True, cacert='cacert', cert='cert',
expect_verify=False, expect_insecure=True)
def test_authenticate_secure_without_cacert_with_cert(self):
self._test_authenticate_user(
insecure=False, cert='cert',
expect_verify=True, expect_insecure=False)
def test_authenticate_secure_without_cacert_with_cert_with_token(self):
self._test_authenticate_user(
os_token='token',
insecure=False, cert='cert',
expect_verify=True, expect_insecure=False)
def test_authenticate_insecure_without_cacert_with_cert(self):
self._test_authenticate_user(
insecure=True, cert='cert',
expect_verify=False, expect_insecure=True)
def test_authenticate_insecure_without_cacert_with_cert_with_token(self):
self._test_authenticate_user(
os_token='token',
insecure=True, cert='cert',
expect_verify=False, expect_insecure=True)
def test_authenticate_secure_with_cacert_without_cert(self):
self._test_authenticate_user(
insecure=False, cacert='cacert',
expect_verify='cacert', expect_insecure=False)
def test_authenticate_secure_with_cacert_without_cert_with_token(self):
self._test_authenticate_user(
os_token='token',
insecure=False, cacert='cacert',
expect_verify='cacert', expect_insecure=False)
def test_authenticate_insecure_with_cacert_without_cert(self):
self._test_authenticate_user(
insecure=True, cacert='cacert',
expect_verify=False, expect_insecure=True)
def test_authenticate_insecure_with_cacert_without_cert_with_token(self):
self._test_authenticate_user(
os_token='token',
insecure=True, cacert='cacert',
expect_verify=False, expect_insecure=True)

View File

@@ -0,0 +1,4 @@
---
features:
- |
Quota of Loadbalancers and listeners can now be updated.

View File

@@ -2,7 +2,7 @@
# of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later.
pbr>=1.6 # Apache-2.0
cliff!=1.16.0,>=1.15.0 # Apache-2.0
cliff!=1.16.0,!=1.17.0,>=1.15.0 # Apache-2.0
debtcollector>=1.2.0 # Apache-2.0
iso8601>=0.1.9 # MIT
netaddr!=0.7.16,>=0.7.12 # BSD
@@ -14,4 +14,4 @@ keystoneauth1>=2.1.0 # Apache-2.0
requests!=2.9.0,>=2.8.1 # Apache-2.0
simplejson>=2.2.0 # MIT
six>=1.9.0 # MIT
Babel>=1.3 # BSD
Babel!=2.3.0,!=2.3.1,!=2.3.2,!=2.3.3,>=1.3 # BSD

View File

@@ -5,7 +5,7 @@ hacking<0.11,>=0.10.0
coverage>=3.6 # Apache-2.0
discover # BSD
fixtures>=1.3.1 # Apache-2.0/BSD
fixtures<2.0,>=1.3.1 # Apache-2.0/BSD
mox3>=0.7.0 # Apache-2.0
mock>=1.2 # BSD
oslosphinx!=3.4.0,>=2.5.0 # Apache-2.0

55
tools/tox_install.sh Executable file
View File

@@ -0,0 +1,55 @@
#!/usr/bin/env bash
# Client constraint file contains this client version pin that is in conflict
# with installing the client from source. We should replace the version pin in
# the constraints file before applying it for from-source installation.
ZUUL_CLONER=/usr/zuul-env/bin/zuul-cloner
BRANCH_NAME=stable/mitaka
CLIENT_NAME=python-neutronclient
requirements_installed=$(echo "import openstack_requirements" | python 2>/dev/null ; echo $?)
set -e
CONSTRAINTS_FILE=$1
shift
install_cmd="pip install"
if [ $CONSTRAINTS_FILE != "unconstrained" ]; then
mydir=$(mktemp -dt "$CLIENT_NAME-tox_install-XXXXXXX")
localfile=$mydir/upper-constraints.txt
if [[ $CONSTRAINTS_FILE != http* ]]; then
CONSTRAINTS_FILE=file://$CONSTRAINTS_FILE
fi
curl $CONSTRAINTS_FILE -k -o $localfile
install_cmd="$install_cmd -c$localfile"
if [ $requirements_installed -eq 0 ]; then
echo "ALREADY INSTALLED" > /tmp/tox_install.txt
echo "Requirements already installed; using existing package"
elif [ -x "$ZUUL_CLONER" ]; then
export ZUUL_BRANCH=${ZUUL_BRANCH-$BRANCH}
echo "ZUUL CLONER" > /tmp/tox_install.txt
pushd $mydir
$ZUUL_CLONER --cache-dir \
/opt/git \
--branch $BRANCH_NAME \
git://git.openstack.org \
openstack/requirements
cd openstack/requirements
$install_cmd -e .
popd
else
echo "PIP HARDCODE" > /tmp/tox_install.txt
if [ -z "$REQUIREMENTS_PIP_LOCATION" ]; then
REQUIREMENTS_PIP_LOCATION="git+https://git.openstack.org/openstack/requirements@$BRANCH_NAME#egg=requirements"
fi
$install_cmd -U -e ${REQUIREMENTS_PIP_LOCATION}
fi
edit-constraints $localfile -- $CLIENT_NAME "-e file://$PWD#egg=$CLIENT_NAME"
fi
$install_cmd -U $*
exit $?

View File

@@ -10,7 +10,8 @@ setenv = VIRTUAL_ENV={envdir}
LANGUAGE=en_US:en
LC_ALL=C
usedevelop = True
install_command = pip install -U {opts} {packages}
install_command =
{toxinidir}/tools/tox_install.sh {env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=stable/mitaka} {opts} {packages}
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
# Delete bytecodes from normal directories before running tests.