@@ -94,9 +94,14 @@ def test_l3_conntrack_helper_list(self):
9494 self .assertIn (ct , expected_helpers )
9595
9696 def test_l3_conntrack_helper_set_and_show (self ):
97- helper = {'helper' : 'tftp' , 'protocol' : 'udp' , 'port' : 69 }
97+ helper = 'tftp'
98+ proto = 'udp'
99+ port = 69
98100 router_id = self ._create_router ()
99- created_helper = self ._create_helpers (router_id , [helper ])[0 ]
101+ created_helper = self ._create_helpers (
102+ router_id ,
103+ [{'helper' : helper , 'protocol' : proto , 'port' : port }],
104+ )[0 ]
100105 output = self .openstack (
101106 'network l3 conntrack helper show {router_id} {ct_id} '
102107 '-f json' .format (
@@ -105,16 +110,16 @@ def test_l3_conntrack_helper_set_and_show(self):
105110 ),
106111 parse_output = True ,
107112 )
108- self .assertEqual (helper [ 'helper' ] , output ['helper ' ])
109- self .assertEqual (helper [ 'protocol' ] , output ['protocol ' ])
110- self .assertEqual (helper [ 'port' ] , output ['port ' ])
113+ self .assertEqual (port , output ['port ' ])
114+ self .assertEqual (helper , output ['helper ' ])
115+ self .assertEqual (proto , output ['protocol ' ])
111116
112117 raw_output = self .openstack (
113118 'network l3 conntrack helper set {router_id} {ct_id} '
114119 '--port {port} ' .format (
115120 router_id = router_id ,
116121 ct_id = created_helper ['id' ],
117- port = helper [ ' port' ] + 1 ,
122+ port = port + 1 ,
118123 )
119124 )
120125 self .assertOutput ('' , raw_output )
@@ -127,6 +132,6 @@ def test_l3_conntrack_helper_set_and_show(self):
127132 ),
128133 parse_output = True ,
129134 )
130- self .assertEqual (helper [ ' port' ] + 1 , output ['port' ])
131- self .assertEqual (helper [ 'helper' ] , output ['helper' ])
132- self .assertEqual (helper [ 'protocol' ] , output ['protocol' ])
135+ self .assertEqual (port + 1 , output ['port' ])
136+ self .assertEqual (helper , output ['helper' ])
137+ self .assertEqual (proto , output ['protocol' ])
0 commit comments