move the integrated tests into the functional tree

This moves the integrated tests into the functional tree as an initial
seed for the functional tests. It was agreed to as an early step at
the design summit. Work on cleaning these up will happen after the
move.

PYTHON_HASH_SEED=0 is needed because these tests apparently remain
order dependent.

Also remove the use of test.ReplaceModule, which is an untested
mocking system in the nova tree that doesn't seem to reliably
work. Use stubs instead for the time being, as this will ensure
repeatability of the code.

Part of bp:functional-tests-for-nova

Change-Id: I742c487dd7bca9de3e811c545de477367fff112c
This commit is contained in:
Sean Dague
2014-11-24 09:34:30 -05:00
parent 922ca3cfc2
commit 16f73c8a43
1324 changed files with 146 additions and 108 deletions

View File

@@ -0,0 +1,55 @@
# Copyright 2012 Nebula, Inc.
# Copyright 2013 IBM Corp.
#
# 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 nova.tests.functional.v3 import test_servers
class ConsolesSamplesJsonTest(test_servers.ServersSampleBase):
sample_dir = "consoles"
def setUp(self):
super(ConsolesSamplesJsonTest, self).setUp()
self.flags(console_public_hostname='fake')
self.flags(console_host='fake')
self.flags(console_driver='nova.console.fake.FakeConsoleProxy')
self.console = self.start_service('console', host='fake')
def _create_consoles(self, server_uuid):
response = self._do_post('servers/%s/consoles' % server_uuid,
'consoles-create-req', {})
self.assertEqual(response.status_code, 200)
def test_create_consoles(self):
uuid = self._post_server()
self._create_consoles(uuid)
def test_list_consoles(self):
uuid = self._post_server()
self._create_consoles(uuid)
response = self._do_get('servers/%s/consoles' % uuid)
self._verify_response('consoles-list-get-resp', {}, response, 200)
def test_console_get(self):
uuid = self._post_server()
self._create_consoles(uuid)
response = self._do_get('servers/%s/consoles/1' % uuid)
subs = self._get_regexes()
self._verify_response('consoles-get-resp', subs, response, 200)
def test_console_delete(self):
uuid = self._post_server()
self._create_consoles(uuid)
response = self._do_delete('servers/%s/consoles/1' % uuid)
self.assertEqual(response.status_code, 202)