# Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import unittest import uuid from openstack.load_balancer.v2 import listener from openstack.load_balancer.v2 import load_balancer from openstack.tests.functional import base from openstack.tests.functional.load_balancer import base as lb_base @unittest.skipUnless(base.service_exists(service_type='load-balancer'), 'Load-balancer service does not exist') class TestLoadBalancer(lb_base.BaseLBFunctionalTest): LB_NAME = uuid.uuid4().hex LISTENER_NAME = uuid.uuid4().hex UPDATE_NAME = uuid.uuid4().hex LB_ID = None LISTENER_ID = None VIP_SUBNET_ID = None PROJECT_ID = None PROTOCOL = 'HTTP' PROTOCOL_PORT = 80 # Note: Creating load balancers can be slow on some hosts due to nova # instance boot times (up to ten minutes) so we are consolidating
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import unittest from openstack.tests.functional import base @unittest.skipUnless(base.service_exists(service_type="metering"), "Metering service does not exist") class TestCapability(base.BaseFunctionalTest): def test_list(self): ids = [o.id for o in self.conn.telemetry.capabilities()] self.assertIn('resources:query:simple', ids) self.assertIn('events:query:simple', ids) self.assertIn('meters:query:simple', ids) self.assertIn('statistics:query:simple', ids) self.assertIn('samples:query:simple', ids)
# Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import unittest from openstack import exceptions from openstack.orchestration.v1 import stack from openstack.tests.functional import base from openstack.tests.functional.network.v2 import test_network @unittest.skip("bug/1525005") @unittest.skipUnless(base.service_exists(service_type='orchestration'), 'Orchestration service does not exist') class TestStack(base.BaseFunctionalTest): NAME = 'test_stack' stack = None network = None subnet = None cidr = '10.99.99.0/16' @classmethod def setUpClass(cls): super(TestStack, cls).setUpClass() if cls.conn.compute.find_keypair(cls.NAME) is None: cls.conn.compute.create_keypair(name=cls.NAME) image = next(cls.conn.image.images())
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import unittest from openstack.tests.functional import base @unittest.skipUnless(base.service_exists(service_type="metering"), "Metering service does not exist") class TestCapability(base.BaseFunctionalTest): def test_list(self): ids = [o.id for o in self.conn.telemetry.capabilities()] self.assertIn('resources:query:simple', ids) self.assertIn('meters:query:simple', ids) self.assertIn('statistics:query:simple', ids) self.assertIn('samples:query:simple', ids)
# a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import unittest 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): @classmethod def tearDownClass(cls): super(TestAccount, cls).tearDownClass() account = cls.conn.object_store.get_account_metadata() cls.conn.object_store.delete_account_metadata(account.metadata.keys()) def test_system_metadata(self): account = self.conn.object_store.get_account_metadata() self.assertGreaterEqual(account.account_bytes_used, 0) self.assertGreaterEqual(account.account_container_count, 0) self.assertGreaterEqual(account.account_object_count, 0) def test_custom_metadata(self):
# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import unittest import uuid from openstack.load_balancer.v2 import load_balancer 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): NAME = uuid.uuid4().hex ID = None VIP_SUBNET_ID = uuid.uuid4().hex @classmethod def setUpClass(cls): super(TestLoadBalancer, cls).setUpClass() test_lb = cls.conn.load_balancer.create_load_balancer( name=cls.NAME, vip_subnet_id=cls.VIP_SUBNET_ID) assert isinstance(test_lb, load_balancer.LoadBalancer) cls.assertIs(cls.NAME, test_lb.name) cls.ID = test_lb.id
# a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import unittest 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): @classmethod def tearDownClass(cls): super(TestAccount, cls).tearDownClass() account = cls.conn.object_store.get_account_metadata() cls.conn.object_store.delete_account_metadata(account.metadata.keys()) def test_system_metadata(self): account = self.conn.object_store.get_account_metadata() self.assertGreaterEqual(account.account_bytes_used, 0) self.assertGreaterEqual(account.account_container_count, 0) self.assertGreaterEqual(account.account_object_count, 0)
# Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import unittest from openstack import exceptions from openstack.orchestration.v1 import stack from openstack.tests.functional import base from openstack.tests.functional.network.v2 import test_network @unittest.skip("bug/1525005") @unittest.skipUnless(base.service_exists(service_type='orchestration'), 'Orchestration service does not exist') class TestStack(base.BaseFunctionalTest): NAME = 'test_stack' stack = None network = None subnet = None cidr = '10.99.99.0/16' @classmethod def setUpClass(cls): super(TestStack, cls).setUpClass() if cls.conn.compute.find_keypair(cls.NAME) is None: cls.conn.compute.create_keypair(name=cls.NAME) image = next(cls.conn.image.images())