diff options
| author | Richard Theis <rtheis@us.ibm.com> | 2016-05-07 07:56:47 -0500 |
|---|---|---|
| committer | Richard Theis <rtheis@us.ibm.com> | 2016-05-07 10:38:01 -0500 |
| commit | c1dba6ab1b2d5999fe0c3c24b7d8aa0ac8be47f1 (patch) | |
| tree | d44aecaaf6883cbf62c2892230b40fa66109c798 /functional | |
| parent | 5df18843b7aeb2f9254f55e4127c44d6fbf66efb (diff) | |
| download | python-openstackclient-c1dba6ab1b2d5999fe0c3c24b7d8aa0ac8be47f1.tar.gz | |
Fix functional test failures
There have been a lot of functional test failures for compute
and network. I believe they are timing related in that the
test_server is sometimes booting a server with a flavor,
image and/or network created by another functional test. Such
resources are then deleted by the owning functional tests
causing various types of failures
Change-Id: Ib82edd487da46610374fb0eb5796cb98f2d3aa2c
Diffstat (limited to 'functional')
| -rw-r--r-- | functional/tests/compute/v2/test_server.py | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/functional/tests/compute/v2/test_server.py b/functional/tests/compute/v2/test_server.py index 247784e1..845c5c5a 100644 --- a/functional/tests/compute/v2/test_server.py +++ b/functional/tests/compute/v2/test_server.py @@ -24,14 +24,16 @@ class ServerTests(test.TestCase): @classmethod def get_flavor(cls): - raw_output = cls.openstack('flavor list -f value -c ID') - ray = raw_output.split('\n') - idx = int(len(ray) / 2) - return ray[idx] + # NOTE(rtheis): Get m1.tiny flavor since functional tests may + # create other flavors. + raw_output = cls.openstack('flavor show m1.tiny -c id -f value') + return raw_output.strip('\n') @classmethod def get_image(cls): - raw_output = cls.openstack('image list -f value -c ID') + # NOTE(rtheis): Get public images since functional tests may + # create private images. + raw_output = cls.openstack('image list --public -f value -c ID') ray = raw_output.split('\n') idx = int(len(ray) / 2) return ray[idx] @@ -39,12 +41,12 @@ class ServerTests(test.TestCase): @classmethod def get_network(cls): try: - raw_output = cls.openstack('network list -f value -c ID') + # NOTE(rtheis): Get private network since functional tests may + # create other networks. + raw_output = cls.openstack('network show private -c id -f value') except exceptions.CommandFailed: return '' - ray = raw_output.split('\n') - idx = int(len(ray) / 2) - return ' --nic net-id=' + ray[idx] + return ' --nic net-id=' + raw_output.strip('\n') def server_create(self, name=None): """Create server. Add cleanup.""" |
