Files
senlin-tempest-plugin/senlin_tempest_plugin/tests/api/nodes/test_node_delete.py
Duc Truong 95d0f78e93 Fix senlin tempest plugin to work properly
* moved testfiles into tests subdirectory
* fix basepath for plugin
* fix entrypoint
* provide steps in README to install and use senlin-tempest-plugin
* add config option when creating clusters to test node naming
* removed test drivers
* fix various test cases
* Replace deprecated aliases 'os'/'os_adm' with 'os_primary'/'os_admin'

Change-Id: I7551783a4e9b2194559c3a400594227b2d9c26b9
2018-01-17 20:50:22 -08:00

40 lines
1.4 KiB
Python

# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from tempest.lib import decorators
from senlin_tempest_plugin.common import utils
from senlin_tempest_plugin.tests.api import base
class TestNodeDelete(base.BaseSenlinAPITest):
def setUp(self):
super(TestNodeDelete, self).setUp()
profile_id = utils.create_a_profile(self)
self.addCleanup(utils.delete_a_profile, self, profile_id)
self.node_id = utils.create_a_node(self, profile_id)
@decorators.idempotent_id('29b18f65-2e0e-4a61-b00a-e5803365525b')
def test_node_delete(self):
# Delete test node
res = self.client.delete_obj('nodes', self.node_id)
# Verify resp code, body and location in headers
self.assertEqual(202, res['status'])
self.assertIsNone(res['body'])
self.assertIn('actions', res['location'])
action_id = res['location'].split('/actions/')[1]
self.client.wait_for_status('actions', action_id, 'SUCCEEDED')