summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzhangbailin <zhangbailin@inspur.com>2019-10-15 14:49:20 +0800
committerBrin Zhang <zhangbailin@inspur.com>2019-10-17 12:52:48 +0000
commitf420c058513018132f36a743dcea069e4925370e (patch)
tree7ec2c2e8cff7ffbd45812e0fc53cbffcb222464f
parent8744bea0e3ebe5bc4d0d899189bfa0bcdcb0a08f (diff)
downloadpython-novaclient-f420c058513018132f36a743dcea069e4925370e.tar.gz
Add functional test for migration-list in v2.80
In microversion 2.80 add the functional test for the `nova migration-list` CLI. part of bp add-user-id-field-to-the-migrations-table Change-Id: I3cfe37b412971dfff4b217fc7cc6cfdf1b118ce0
-rw-r--r--novaclient/tests/functional/v2/test_migrations.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/novaclient/tests/functional/v2/test_migrations.py b/novaclient/tests/functional/v2/test_migrations.py
index 855d8ce5..34a03695 100644
--- a/novaclient/tests/functional/v2/test_migrations.py
+++ b/novaclient/tests/functional/v2/test_migrations.py
@@ -41,6 +41,8 @@ class TestMigrationList(base.ClientTestBase):
# Find the source compute by getting OS-EXT-SRV-ATTR:host from the
# nova show output.
server = self.nova('show', params='%s' % server_id)
+ server_user_id = self._get_value_from_the_table(server, 'user_id')
+ tenant_id = self._get_value_from_the_table(server, 'tenant_id')
source_compute = self._get_value_from_the_table(
server, 'OS-EXT-SRV-ATTR:host')
# now resize up
@@ -97,3 +99,14 @@ class TestMigrationList(base.ClientTestBase):
migrations = self._filter_migrations(
'2.66', 'resize', uuidutils.generate_uuid())
self.assertNotIn(server_id, migrations)
+
+ # Listing migrations with v2.80 and make sure there are the User ID
+ # and Project ID values in the output.
+ migrations = self.nova('migration-list',
+ flags='--os-compute-api-version 2.80')
+ user_id = self._get_column_value_from_single_row_table(
+ migrations, 'User ID')
+ self.assertEqual(server_user_id, user_id)
+ project_id = self._get_column_value_from_single_row_table(
+ migrations, 'Project ID')
+ self.assertEqual(tenant_id, project_id)