@@ -64,6 +64,7 @@ def _get_common_cols_data(fake_port):
6464 'security_group_ids' ,
6565 'status' ,
6666 'tags' ,
67+ 'uplink_status_propagation' ,
6768 )
6869
6970 data = (
@@ -93,6 +94,7 @@ def _get_common_cols_data(fake_port):
9394 utils .format_list (fake_port .security_group_ids ),
9495 fake_port .status ,
9596 utils .format_list (fake_port .tags ),
97+ fake_port .uplink_status_propagation ,
9698 )
9799
98100 return columns , data
@@ -571,6 +573,43 @@ def test_create_with_tags(self):
571573 def test_create_with_no_tag (self ):
572574 self ._test_create_with_tag (add_tags = False )
573575
576+ def _test_create_with_uplink_status_propagation (self , enable = True ):
577+ arglist = [
578+ '--network' , self ._port .network_id ,
579+ 'test-port' ,
580+ ]
581+ if enable :
582+ arglist += ['--enable-uplink-status-propagation' ]
583+ else :
584+ arglist += ['--disable-uplink-status-propagation' ]
585+ verifylist = [
586+ ('network' , self ._port .network_id ,),
587+ ('name' , 'test-port' ),
588+ ]
589+ if enable :
590+ verifylist .append (('enable_uplink_status_propagation' , True ))
591+ else :
592+ verifylist .append (('disable_uplink_status_propagation' , True ))
593+ parsed_args = self .check_parser (self .cmd , arglist , verifylist )
594+
595+ columns , data = (self .cmd .take_action (parsed_args ))
596+
597+ self .network .create_port .assert_called_once_with (** {
598+ 'admin_state_up' : True ,
599+ 'network_id' : self ._port .network_id ,
600+ 'propagate_uplink_status' : enable ,
601+ 'name' : 'test-port' ,
602+ })
603+
604+ self .assertEqual (self .columns , columns )
605+ self .assertEqual (self .data , data )
606+
607+ def test_create_with_uplink_status_propagation_enabled (self ):
608+ self ._test_create_with_uplink_status_propagation (enable = True )
609+
610+ def test_create_with_uplink_status_propagation_disabled (self ):
611+ self ._test_create_with_uplink_status_propagation (enable = False )
612+
574613
575614class TestDeletePort (TestPort ):
576615
0 commit comments