File tree Expand file tree Collapse file tree
openstackclient/tests/functional/common Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -165,47 +165,3 @@ def test_quota_set_class(self):
165165 # returned attributes
166166 self .assertTrue (cmd_output ["key-pairs" ] >= 0 )
167167 self .assertTrue (cmd_output ["snapshots" ] >= 0 )
168-
169- def test_quota_set_force (self ):
170- """Test to set instance value by force """
171- json_output = json .loads (self .openstack (
172- 'quota list -f json --detail --compute'
173- ))
174- in_use = limit = None
175- for j in json_output :
176- if j ["Resource" ] == "instances" :
177- in_use = j ["In Use" ]
178- limit = j ["Limit" ]
179-
180- # Reduce count of in_use
181- in_use = in_use - 1
182- # cannot have negative instances limit
183- if in_use < 0 :
184- in_use = 0
185-
186- # set the limit by force now
187- self .openstack (
188- 'quota set ' + self .PROJECT_NAME +
189- '--instances ' + str (in_use ) + ' --force'
190- )
191- cmd_output = json .loads (self .openstack (
192- 'quota show -f json ' + self .PROJECT_NAME
193- ))
194- self .assertIsNotNone (cmd_output )
195- self .assertEqual (
196- in_use ,
197- cmd_output ["instances" ]
198- )
199-
200- # Set instances limit to original limit now
201- self .openstack (
202- 'quota set ' + self .PROJECT_NAME + '--instances ' + str (limit )
203- )
204- cmd_output = json .loads (self .openstack (
205- 'quota show -f json ' + self .PROJECT_NAME
206- ))
207- self .assertIsNotNone (cmd_output )
208- self .assertEqual (
209- limit ,
210- cmd_output ["instances" ]
211- )
You can’t perform that action at this time.
0 commit comments