functional tests: minor cleanup

* Check service availability for swift, heat and octavia

* Use OS_CLOUD=devstack-admin. DevStack sets up default clouds.yaml
  for member and admin roles. The current OpenStackSDK functest prepares
  its own clouds.yaml based on DevStack admin account, so there is no
  difference from 'devstack-admin'. It simplifies the post_gate_hook process.

* Skip openstack.tests.functional.network.v2.test_quota.TestQuota.test_set
  (Related-Bug: #1687202)

Change-Id: I571e437dd7e439d2ad8a1d7ed9a5a24361b1308e
This commit is contained in:
Akihiro Motoki 2017-04-29 14:39:35 +00:00
parent bfc88e76f3
commit dc9a3458ad
9 changed files with 24 additions and 8 deletions

View File

@ -32,11 +32,11 @@ utils.enable_logging(True, stream=sys.stdout)
#: file, typically in $HOME/.config/openstack/clouds.yaml. That configuration #: file, typically in $HOME/.config/openstack/clouds.yaml. That configuration
#: will determine where the examples will be run and what resource defaults #: will determine where the examples will be run and what resource defaults
#: will be used to run the examples. #: will be used to run the examples.
TEST_CLOUD = os.getenv('OS_TEST_CLOUD', 'test_cloud') TEST_CLOUD = os.getenv('OS_TEST_CLOUD', 'devstack-admin')
class Opts(object): class Opts(object):
def __init__(self, cloud_name='test_cloud', debug=False): def __init__(self, cloud_name='devstack-admin', debug=False):
self.cloud = cloud_name self.cloud = cloud_name
self.debug = debug self.debug = debug
# Use identity v3 API for examples. # Use identity v3 API for examples.

View File

@ -23,11 +23,11 @@ from openstack import connection
#: file, typically in $HOME/.config/openstack/clouds.yaml. That configuration #: file, typically in $HOME/.config/openstack/clouds.yaml. That configuration
#: will determine where the functional tests will be run and what resource #: will determine where the functional tests will be run and what resource
#: defaults will be used to run the functional tests. #: defaults will be used to run the functional tests.
TEST_CLOUD = os.getenv('OS_CLOUD', 'test_cloud') TEST_CLOUD = os.getenv('OS_CLOUD', 'devstack-admin')
class Opts(object): class Opts(object):
def __init__(self, cloud_name='test_cloud', debug=False): def __init__(self, cloud_name='devstack-admin', debug=False):
self.cloud = cloud_name self.cloud = cloud_name
self.debug = debug self.debug = debug

View File

@ -10,12 +10,15 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import unittest
import uuid import uuid
from openstack.load_balancer.v2 import load_balancer from openstack.load_balancer.v2 import load_balancer
from openstack.tests.functional import base from openstack.tests.functional import base
@unittest.skipUnless(base.service_exists(service_type='load_balancer'),
'Load-balancing service does not exist')
class TestLoadBalancer(base.BaseFunctionalTest): class TestLoadBalancer(base.BaseFunctionalTest):
NAME = uuid.uuid4().hex NAME = uuid.uuid4().hex

View File

@ -10,6 +10,8 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import unittest
from openstack.tests.functional import base from openstack.tests.functional import base
@ -20,6 +22,7 @@ class TestQuota(base.BaseFunctionalTest):
self.assertIsNotNone(qot.project_id) self.assertIsNotNone(qot.project_id)
self.assertIsNotNone(qot.networks) self.assertIsNotNone(qot.networks)
@unittest.skip('bug/1687202')
def test_set(self): def test_set(self):
attrs = {'networks': 123456789} attrs = {'networks': 123456789}
for project_quota in self.conn.network.quotas(): for project_quota in self.conn.network.quotas():

View File

@ -10,9 +10,13 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import unittest
from openstack.tests.functional import base from openstack.tests.functional import base
@unittest.skipUnless(base.service_exists(service_type='object-store'),
'Object Storage service does not exist')
class TestAccount(base.BaseFunctionalTest): class TestAccount(base.BaseFunctionalTest):
@classmethod @classmethod

View File

@ -10,12 +10,15 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import unittest
import uuid import uuid
from openstack.object_store.v1 import container as _container from openstack.object_store.v1 import container as _container
from openstack.tests.functional import base from openstack.tests.functional import base
@unittest.skipUnless(base.service_exists(service_type='object-store'),
'Object Storage service does not exist')
class TestContainer(base.BaseFunctionalTest): class TestContainer(base.BaseFunctionalTest):
NAME = uuid.uuid4().hex NAME = uuid.uuid4().hex

View File

@ -10,11 +10,14 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import unittest
import uuid import uuid
from openstack.tests.functional import base from openstack.tests.functional import base
@unittest.skipUnless(base.service_exists(service_type='object-store'),
'Object Storage service does not exist')
class TestObject(base.BaseFunctionalTest): class TestObject(base.BaseFunctionalTest):
FOLDER = uuid.uuid4().hex FOLDER = uuid.uuid4().hex

View File

@ -19,6 +19,8 @@ from openstack.tests.functional.network.v2 import test_network
@unittest.skip("bug/1525005") @unittest.skip("bug/1525005")
@unittest.skipUnless(base.service_exists(service_type='orchestration'),
'Orchestration service does not exist')
class TestStack(base.BaseFunctionalTest): class TestStack(base.BaseFunctionalTest):
NAME = 'test_stack' NAME = 'test_stack'

View File

@ -8,11 +8,9 @@ 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 export OS_CLOUD=devstack-admin
export OS_CLOUD=test_cloud
echo 'Running tests with:' echo 'Running tests with:'
env | grep OS_ cat /etc/openstack/clouds.yaml
${DIR}/create_yaml.sh
cd ${DIR} cd ${DIR}
echo '=functional==============================================' echo '=functional=============================================='