diff options
Diffstat (limited to 'functional/tests/common')
| -rw-r--r-- | functional/tests/common/__init__.py | 0 | ||||
| -rw-r--r-- | functional/tests/common/test_availability_zone.py | 25 | ||||
| -rw-r--r-- | functional/tests/common/test_configuration.py | 44 | ||||
| -rw-r--r-- | functional/tests/common/test_help.py | 66 | ||||
| -rw-r--r-- | functional/tests/common/test_quota.py | 42 |
5 files changed, 0 insertions, 177 deletions
diff --git a/functional/tests/common/__init__.py b/functional/tests/common/__init__.py deleted file mode 100644 index e69de29b..00000000 --- a/functional/tests/common/__init__.py +++ /dev/null diff --git a/functional/tests/common/test_availability_zone.py b/functional/tests/common/test_availability_zone.py deleted file mode 100644 index da8aad7d..00000000 --- a/functional/tests/common/test_availability_zone.py +++ /dev/null @@ -1,25 +0,0 @@ -# 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. - -from functional.common import test - - -class AvailabilityZoneTests(test.TestCase): - """Functional tests for availability zone. """ - HEADERS = ["'Zone Name'"] - # So far, all components have the same default availability zone name. - DEFAULT_AZ_NAME = 'nova' - - def test_availability_zone_list(self): - opts = self.get_opts(self.HEADERS) - raw_output = self.openstack('availability zone list' + opts) - self.assertIn(self.DEFAULT_AZ_NAME, raw_output) diff --git a/functional/tests/common/test_configuration.py b/functional/tests/common/test_configuration.py deleted file mode 100644 index 801ee10d..00000000 --- a/functional/tests/common/test_configuration.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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 os - -from functional.common import test -from openstackclient.common import configuration - - -BASIC_CONFIG_HEADERS = ['Field', 'Value'] - - -class ConfigurationTests(test.TestCase): - - opts = "-f value -c auth.password" - - def test_configuration_show(self): - raw_output = self.openstack('configuration show') - items = self.parse_listing(raw_output) - self.assert_table_structure(items, BASIC_CONFIG_HEADERS) - - def test_configuration_show_unmask(self): - raw_output = self.openstack('configuration show --unmask ' + self.opts) - # If we are using os-client-config, this will not be set. Rather than - # parse clouds.yaml to get the right value, just make sure - # we are not getting redacted. - passwd = os.environ.get('OS_PASSWORD') - if passwd: - self.assertEqual(passwd + '\n', raw_output) - else: - self.assertNotEqual(configuration.REDACTED + '\n', raw_output) - - def test_configuration_show_mask(self): - raw_output = self.openstack('configuration show --mask ' + self.opts) - self.assertEqual(configuration.REDACTED + '\n', raw_output) diff --git a/functional/tests/common/test_help.py b/functional/tests/common/test_help.py deleted file mode 100644 index 7601c41b..00000000 --- a/functional/tests/common/test_help.py +++ /dev/null @@ -1,66 +0,0 @@ -# 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. - -from functional.common import test - - -class HelpTests(test.TestCase): - """Functional tests for openstackclient help output.""" - - SERVER_COMMANDS = [ - ('server add security group', 'Add security group to server'), - ('server add volume', 'Add volume to server'), - ('server backup create', 'Create a server backup image'), - ('server create', 'Create a new server'), - ('server delete', 'Delete server(s)'), - ('server dump create', 'Create a dump file in server(s)'), - ('server image create', - 'Create a new server disk image from an existing server'), - ('server list', 'List servers'), - ('server lock', - 'Lock server(s). ' - 'A non-admin user will not be able to execute actions'), - ('server migrate', 'Migrate server to different host'), - ('server pause', 'Pause server(s)'), - ('server reboot', 'Perform a hard or soft server reboot'), - ('server rebuild', 'Rebuild server'), - ('server remove security group', 'Remove security group from server'), - ('server remove volume', 'Remove volume from server'), - ('server rescue', 'Put server in rescue mode'), - ('server resize', 'Scale server to a new flavor'), - ('server resume', 'Resume server(s)'), - ('server set', 'Set server properties'), - ('server shelve', 'Shelve server(s)'), - ('server show', 'Show server details'), - ('server ssh', 'SSH to server'), - ('server start', 'Start server(s).'), - ('server stop', 'Stop server(s).'), - ('server suspend', 'Suspend server(s)'), - ('server unlock', 'Unlock server(s)'), - ('server unpause', 'Unpause server(s)'), - ('server unrescue', 'Restore server from rescue mode'), - ('server unset', 'Unset server properties'), - ('server unshelve', 'Unshelve server(s)') - ] - - def test_server_commands_main_help(self): - """Check server commands in main help message.""" - raw_output = self.openstack('help') - for command, description in self.SERVER_COMMANDS: - self.assertIn(command, raw_output) - self.assertIn(description, raw_output) - - def test_server_only_help(self): - """Check list of server-related commands only.""" - raw_output = self.openstack('help server') - for command in [row[0] for row in self.SERVER_COMMANDS]: - self.assertIn(command, raw_output) diff --git a/functional/tests/common/test_quota.py b/functional/tests/common/test_quota.py deleted file mode 100644 index 0316de25..00000000 --- a/functional/tests/common/test_quota.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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. - -from functional.common import test - - -class QuotaTests(test.TestCase): - """Functional tests for quota. """ - # Test quota information for compute, network and volume. - EXPECTED_FIELDS = ['instances', 'networks', 'volumes'] - PROJECT_NAME = None - - @classmethod - def setUpClass(cls): - cls.PROJECT_NAME =\ - cls.get_openstack_configuration_value('auth.project_name') - - def test_quota_set(self): - self.openstack('quota set --instances 11 --volumes 11 --networks 11 ' - + self.PROJECT_NAME) - opts = self.get_opts(self.EXPECTED_FIELDS) - raw_output = self.openstack('quota show ' + self.PROJECT_NAME + opts) - self.assertEqual("11\n11\n11\n", raw_output) - - def test_quota_show(self): - raw_output = self.openstack('quota show ' + self.PROJECT_NAME) - for expected_field in self.EXPECTED_FIELDS: - self.assertIn(expected_field, raw_output) - - def test_quota_show_default_project(self): - raw_output = self.openstack('quota show') - for expected_field in self.EXPECTED_FIELDS: - self.assertIn(expected_field, raw_output) |
