@@ -70,6 +70,7 @@ class TestCreateNetworkIdentityV3(TestNetwork):
7070 'provider:network_type' ,
7171 'provider:physical_network' ,
7272 'provider:segmentation_id' ,
73+ 'pvlan' ,
7374 'qos_policy_id' ,
7475 'router:external' ,
7576 'shared' ,
@@ -99,6 +100,7 @@ class TestCreateNetworkIdentityV3(TestNetwork):
99100 _network .provider_network_type ,
100101 _network .provider_physical_network ,
101102 _network .provider_segmentation_id ,
103+ _network .pvlan ,
102104 _network .qos_policy_id ,
103105 network .RouterExternalColumn (_network .is_router_external ),
104106 _network .is_shared ,
@@ -189,6 +191,7 @@ def test_create_all_options(self):
189191 self .qos_policy .id ,
190192 "--transparent-vlan" ,
191193 "--no-qinq-vlan" ,
194+ "--no-pvlan" ,
192195 "--enable-port-security" ,
193196 "--dns-domain" ,
194197 "example.org." ,
@@ -210,6 +213,7 @@ def test_create_all_options(self):
210213 ('qos_policy' , self .qos_policy .id ),
211214 ('transparent_vlan' , True ),
212215 ('qinq_vlan' , False ),
216+ ('pvlan' , False ),
213217 ('enable_port_security' , True ),
214218 ('name' , self ._network .name ),
215219 ('dns_domain' , 'example.org.' ),
@@ -235,6 +239,7 @@ def test_create_all_options(self):
235239 'qos_policy_id' : self .qos_policy .id ,
236240 'vlan_transparent' : True ,
237241 'vlan_qinq' : False ,
242+ 'pvlan' : False ,
238243 'port_security_enabled' : True ,
239244 'dns_domain' : 'example.org.' ,
240245 }
@@ -326,6 +331,19 @@ def test_create_with_vlan_qinq_and_transparency_enabled(self):
326331 exceptions .CommandError , self .cmd .take_action , parsed_args
327332 )
328333
334+ def test_create_with_pvlan_and_port_security_disabled (self ):
335+ arglist = [
336+ "--disable-port-security" ,
337+ "--pvlan" ,
338+ self ._network .name ,
339+ ]
340+ verifylist = [('disable_port_security' , True ), ('pvlan' , True )]
341+
342+ parsed_args = self .check_parser (self .cmd , arglist , verifylist )
343+ self .assertRaises (
344+ exceptions .CommandError , self .cmd .take_action , parsed_args
345+ )
346+
329347 def test_create_with_provider_segment_without_provider_type (self ):
330348 arglist = [
331349 "--provider-segment" ,
@@ -371,6 +389,7 @@ class TestCreateNetworkIdentityV2(
371389 'name' ,
372390 'port_security_enabled' ,
373391 'project_id' ,
392+ 'pvlan' ,
374393 'provider:network_type' ,
375394 'provider:physical_network' ,
376395 'provider:segmentation_id' ,
@@ -400,6 +419,7 @@ class TestCreateNetworkIdentityV2(
400419 _network .name ,
401420 _network .is_port_security_enabled ,
402421 _network .project_id ,
422+ _network .pvlan ,
403423 _network .provider_network_type ,
404424 _network .provider_physical_network ,
405425 _network .provider_segmentation_id ,
@@ -996,6 +1016,23 @@ def setUp(self):
9961016 # Get the command object to test
9971017 self .cmd = network .SetNetwork (self .app , None )
9981018
1019+ def test_set_with_pvlan_and_port_security_disabled (self ):
1020+ arglist = [
1021+ self ._network .name ,
1022+ '--disable-port-security' ,
1023+ '--pvlan' ,
1024+ ]
1025+ verifylist = [
1026+ ('network' , self ._network .name ),
1027+ ('disable_port_security' , True ),
1028+ ('pvlan' , True ),
1029+ ]
1030+
1031+ parsed_args = self .check_parser (self .cmd , arglist , verifylist )
1032+ self .assertRaises (
1033+ exceptions .CommandError , self .cmd .take_action , parsed_args
1034+ )
1035+
9991036 def test_set_this (self ):
10001037 arglist = [
10011038 self ._network .name ,
@@ -1189,6 +1226,7 @@ class TestShowNetwork(TestNetwork):
11891226 'provider:network_type' ,
11901227 'provider:physical_network' ,
11911228 'provider:segmentation_id' ,
1229+ 'pvlan' ,
11921230 'qos_policy_id' ,
11931231 'router:external' ,
11941232 'shared' ,
@@ -1218,6 +1256,7 @@ class TestShowNetwork(TestNetwork):
12181256 _network .provider_network_type ,
12191257 _network .provider_physical_network ,
12201258 _network .provider_segmentation_id ,
1259+ _network .pvlan ,
12211260 _network .qos_policy_id ,
12221261 network .RouterExternalColumn (_network .is_router_external ),
12231262 _network .is_shared ,
@@ -1265,7 +1304,6 @@ def test_show_all_options(self):
12651304 self .network_client .find_network .assert_called_once_with (
12661305 self ._network .name , ignore_missing = False
12671306 )
1268-
12691307 self .assertEqual (set (self .columns ), set (columns ))
12701308 self .assertCountEqual (self .data , data )
12711309
0 commit comments