Merge "Merge create-backup functional tests of v2 and v2.1"

This commit is contained in:
Jenkins
2015-04-29 22:50:14 +00:00
committed by Gerrit Code Review
4 changed files with 18 additions and 29 deletions
@@ -1,7 +0,0 @@
{
"createBackup": {
"name": "Backup 1",
"backup_type": "daily",
"rotation": 1
}
}
@@ -1,7 +0,0 @@
{
"createBackup": {
"name": "Backup 1",
"backup_type": "daily",
"rotation": 1
}
}
-15
View File
@@ -968,21 +968,6 @@ class AdminActionsSamplesJsonTest(ServersSampleBase):
'admin-actions-unlock-server', {})
self.assertEqual(response.status_code, 202)
def test_post_backup_server(self):
# Get api samples to backup server request.
def image_details(self, context, **kwargs):
"""This stub is specifically used on the backup action."""
# NOTE(maurosr): I've added this simple stub cause backup action
# was trapped in infinite loop during fetch image phase since the
# fake Image Service always returns the same set of images
return []
self.stubs.Set(fake._FakeImageService, 'detail', image_details)
response = self._do_post('servers/%s/action' % self.uuid,
'admin-actions-backup-server', {})
self.assertEqual(response.status_code, 202)
def test_post_live_migrate_server(self):
# Get api samples to server live migrate request.
def fake_live_migrate(_self, context, instance, scheduler_hint,
@@ -13,14 +13,32 @@
# License for the specific language governing permissions and limitations
# under the License.
from oslo_config import cfg
import mock
from nova.tests.functional.v3 import test_servers
from nova.tests.unit.image import fake
CONF = cfg.CONF
CONF.import_opt('osapi_compute_extension',
'nova.api.openstack.compute.extensions')
class CreateBackupSamplesJsonTest(test_servers.ServersSampleBase):
extension_name = "os-create-backup"
extra_extensions_to_load = ["os-access-ips"]
# TODO(park): Overriding '_api_version' till all functional tests
# are merged between v2 and v2.1. After that base class variable
# itself can be changed to 'v2'
_api_version = 'v2'
def _get_flags(self):
f = super(CreateBackupSamplesJsonTest, self)._get_flags()
f['osapi_compute_extension'] = CONF.osapi_compute_extension[:]
f['osapi_compute_extension'].append(
'nova.api.openstack.compute.contrib.admin_actions.Admin_actions')
return f
def setUp(self):
"""setUp Method for PauseServer api samples extension