Skip to content

Commit 1e3dc48

Browse files
author
Dean Troyer
committed
Add relnotes for the two recent bug fixes
Also add a functional test for network create --project Change-Id: Idbfdf82f1ea6c84fb6a51df88e746e5ddb896b4f
1 parent a6817d0 commit 1e3dc48

3 files changed

Lines changed: 85 additions & 0 deletions

File tree

openstackclient/tests/functional/network/v2/test_network.py

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,78 @@
1919
class NetworkTests(base.TestCase):
2020
"""Functional tests for network"""
2121

22+
def test_network_create(self):
23+
"""Test create options, delete"""
24+
# Get project IDs
25+
cmd_output = json.loads(self.openstack('token issue -f json '))
26+
auth_project_id = cmd_output['project_id']
27+
28+
cmd_output = json.loads(self.openstack('project list -f json '))
29+
admin_project_id = None
30+
demo_project_id = None
31+
for p in cmd_output:
32+
if p['Name'] == 'admin':
33+
admin_project_id = p['ID']
34+
if p['Name'] == 'demo':
35+
demo_project_id = p['ID']
36+
37+
# Verify assumptions:
38+
# * admin and demo projects are present
39+
# * demo and admin are distinct projects
40+
# * tests run as admin
41+
self.assertIsNotNone(admin_project_id)
42+
self.assertIsNotNone(demo_project_id)
43+
self.assertNotEqual(admin_project_id, demo_project_id)
44+
self.assertEqual(admin_project_id, auth_project_id)
45+
46+
# network create with no options
47+
name1 = uuid.uuid4().hex
48+
cmd_output = json.loads(self.openstack(
49+
'network create -f json ' +
50+
name1
51+
))
52+
self.addCleanup(self.openstack, 'network delete ' + name1)
53+
self.assertIsNotNone(cmd_output["id"])
54+
55+
# Check the default values
56+
self.assertEqual(
57+
admin_project_id,
58+
cmd_output["project_id"],
59+
)
60+
self.assertEqual(
61+
'',
62+
cmd_output["description"],
63+
)
64+
self.assertEqual(
65+
'UP',
66+
cmd_output["admin_state_up"],
67+
)
68+
self.assertEqual(
69+
False,
70+
cmd_output["shared"],
71+
)
72+
self.assertEqual(
73+
'Internal',
74+
cmd_output["router:external"],
75+
)
76+
77+
name2 = uuid.uuid4().hex
78+
cmd_output = json.loads(self.openstack(
79+
'network create -f json ' +
80+
'--project demo ' +
81+
name2
82+
))
83+
self.addCleanup(self.openstack, 'network delete ' + name2)
84+
self.assertIsNotNone(cmd_output["id"])
85+
self.assertEqual(
86+
demo_project_id,
87+
cmd_output["project_id"],
88+
)
89+
self.assertEqual(
90+
'',
91+
cmd_output["description"],
92+
)
93+
2294
def test_network_delete(self):
2395
"""Test create, delete multiple"""
2496
name1 = uuid.uuid4().hex
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
fixes:
3+
- |
4+
The ``network create`` command was ignoring the ``--project`` option and
5+
creating networks owned by the current authenticated user's project. This
6+
was a regression introduced in OSC 3.8.0.
7+
[Bug `1659878 <https://bugs.launchpad.net/bugs/1659878>`_]
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
fixes:
3+
- |
4+
The ``address scope list`` command failed with 'HttpException: Bad Request'
5+
when the ``--share`` or ``--no-share`` options were used.
6+
[Bug `1659993 <https://bugs.launchpad.net/bugs/1659993>`_]

0 commit comments

Comments
 (0)