Create clouds.yaml for functional tests
Change-Id: I5d6d0c587b65e0ca877a4d13c89c4cd6ac90ef50
This commit is contained in:
parent
aeeae00445
commit
c0358d0bd5
30
create_yaml.sh
Executable file
30
create_yaml.sh
Executable file
@ -0,0 +1,30 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# NOTE(thowe): There are some issues with OCC envvars that force us to do
|
||||||
|
# this for now.
|
||||||
|
#
|
||||||
|
mkdir -p ~/.config/openstack/
|
||||||
|
FILE=~/.config/openstack/clouds.yaml
|
||||||
|
echo 'clouds:' >$FILE
|
||||||
|
echo ' test_cloud:' >>$FILE
|
||||||
|
env | grep OS_ | tr '=' ' ' | while read k v
|
||||||
|
do
|
||||||
|
k=$(echo $k | sed -e 's/OS_//')
|
||||||
|
k=$(echo $k | tr '[A-Z]' '[a-z]')
|
||||||
|
case "$k" in
|
||||||
|
region_name|*_api_version)
|
||||||
|
echo " $k: $v" >>$FILE
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
echo " auth:" >>$FILE
|
||||||
|
env | grep OS_ | tr '=' ' ' | while read k v
|
||||||
|
do
|
||||||
|
k=$(echo $k | sed -e 's/OS_//')
|
||||||
|
k=$(echo $k | tr '[A-Z]' '[a-z]')
|
||||||
|
case "$k" in
|
||||||
|
region_name|*_api_version)
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo " $k: $v" >>$FILE
|
||||||
|
esac
|
||||||
|
done
|
@ -24,11 +24,16 @@ class TestStack(base.BaseFunctionalTest):
|
|||||||
super(TestStack, cls).setUpClass()
|
super(TestStack, cls).setUpClass()
|
||||||
if cls.conn.compute.find_keypair(cls.NAME) is None:
|
if cls.conn.compute.find_keypair(cls.NAME) is None:
|
||||||
cls.conn.compute.create_keypair(name=cls.NAME)
|
cls.conn.compute.create_keypair(name=cls.NAME)
|
||||||
|
image = cls.conn.image.find_image('fedora-20.x86_64')
|
||||||
|
if image is None:
|
||||||
|
image = cls.conn.image.find_image('cirros-0.3.4-x86_64-uec')
|
||||||
|
if image is None:
|
||||||
|
image = cls.conn.image.images().next()
|
||||||
template_url = ('http://git.openstack.org/cgit/openstack/' +
|
template_url = ('http://git.openstack.org/cgit/openstack/' +
|
||||||
'heat-templates/plain/hot/F20/WordPress_Native.yaml')
|
'heat-templates/plain/hot/F20/WordPress_Native.yaml')
|
||||||
sot = cls.conn.orchestration.create_stack(
|
sot = cls.conn.orchestration.create_stack(
|
||||||
name=cls.NAME,
|
name=cls.NAME,
|
||||||
parameters={'key_name': cls.NAME, 'image_id': 'fedora-20.x86_64'},
|
parameters={'key_name': cls.NAME, 'image_id': image.id},
|
||||||
template_url=template_url,
|
template_url=template_url,
|
||||||
)
|
)
|
||||||
assert isinstance(sot, stack.Stack)
|
assert isinstance(sot, stack.Stack)
|
||||||
@ -44,5 +49,5 @@ class TestStack(base.BaseFunctionalTest):
|
|||||||
cls.conn.compute.delete_keypair(cls.NAME)
|
cls.conn.compute.delete_keypair(cls.NAME)
|
||||||
|
|
||||||
def test_list(self):
|
def test_list(self):
|
||||||
names = [o.name for o in self.conn.orchestration.list_stacks()]
|
names = [o.name for o in self.conn.orchestration.stacks()]
|
||||||
self.assertIn(self.NAME, names)
|
self.assertIn(self.NAME, names)
|
||||||
|
@ -9,9 +9,11 @@ DIR=$(cd $(dirname "$0") && pwd)
|
|||||||
echo "Running SDK functional test suite"
|
echo "Running SDK functional test suite"
|
||||||
sudo -H -u stack -i <<!
|
sudo -H -u stack -i <<!
|
||||||
source ~stack/devstack/accrc/admin/admin
|
source ~stack/devstack/accrc/admin/admin
|
||||||
export OS_CLOUD=envvars
|
export OS_CLOUD=test_cloud
|
||||||
echo 'Running tests with:'
|
echo 'Running tests with:'
|
||||||
env | grep OS_
|
env | grep OS_
|
||||||
|
${DIR}/create_yaml.sh
|
||||||
|
|
||||||
cd ${DIR}
|
cd ${DIR}
|
||||||
tox -e functional
|
tox -e functional
|
||||||
!
|
!
|
||||||
|
Loading…
x
Reference in New Issue
Block a user