Merge "Fix functional test failures"
This commit is contained in:
commit
4cd702c361
@ -24,14 +24,16 @@ class ServerTests(test.TestCase):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_flavor(cls):
|
def get_flavor(cls):
|
||||||
raw_output = cls.openstack('flavor list -f value -c ID')
|
# NOTE(rtheis): Get m1.tiny flavor since functional tests may
|
||||||
ray = raw_output.split('\n')
|
# create other flavors.
|
||||||
idx = int(len(ray) / 2)
|
raw_output = cls.openstack('flavor show m1.tiny -c id -f value')
|
||||||
return ray[idx]
|
return raw_output.strip('\n')
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_image(cls):
|
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')
|
ray = raw_output.split('\n')
|
||||||
idx = int(len(ray) / 2)
|
idx = int(len(ray) / 2)
|
||||||
return ray[idx]
|
return ray[idx]
|
||||||
@ -39,12 +41,12 @@ class ServerTests(test.TestCase):
|
|||||||
@classmethod
|
@classmethod
|
||||||
def get_network(cls):
|
def get_network(cls):
|
||||||
try:
|
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:
|
except exceptions.CommandFailed:
|
||||||
return ''
|
return ''
|
||||||
ray = raw_output.split('\n')
|
return ' --nic net-id=' + raw_output.strip('\n')
|
||||||
idx = int(len(ray) / 2)
|
|
||||||
return ' --nic net-id=' + ray[idx]
|
|
||||||
|
|
||||||
def server_create(self, name=None):
|
def server_create(self, name=None):
|
||||||
"""Create server. Add cleanup."""
|
"""Create server. Add cleanup."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user