diff options
author | Ghanshyam Mann <gmann@ghanshyammann.com> | 2022-04-05 17:38:00 -0500 |
---|---|---|
committer | Ghanshyam <gmann@ghanshyammann.com> | 2022-04-05 23:41:14 +0000 |
commit | fc1791f8589cb8dba9d8d9ef7856be17b2bc77f3 (patch) | |
tree | 034f0b3ccd9559c3227abac0e54abbd3f4f67920 /tempest_lib/tests/services/compute/test_interfaces_client.py | |
parent | 023426894a4f72d906ed6f79c55ed7152a732b44 (diff) | |
download | tempest-lib-master.tar.gz |
As of the 1.0.0 release tempest-lib as a separate
repository and project is deprecated. We moved all the
code to tempest.lib temepst version 10.
Hoping everyone is moved to tempest.lib now, We can retire
the tempest-lib. We discussed the same in PTG and agreed to
proceed on retirement
- https://etherpad.opendev.org/p/qa-zed-ptg
Needed-By: https://review.opendev.org/c/openstack/governance/+/836704
Change-Id: I37ceb96e084f569ea59e4849ca8770742ce17846
Diffstat (limited to 'tempest_lib/tests/services/compute/test_interfaces_client.py')
-rw-r--r-- | tempest_lib/tests/services/compute/test_interfaces_client.py | 98 |
1 files changed, 0 insertions, 98 deletions
diff --git a/tempest_lib/tests/services/compute/test_interfaces_client.py b/tempest_lib/tests/services/compute/test_interfaces_client.py deleted file mode 100644 index 4456ce7..0000000 --- a/tempest_lib/tests/services/compute/test_interfaces_client.py +++ /dev/null @@ -1,98 +0,0 @@ -# Copyright 2015 NEC Corporation. All rights reserved. -# -# 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 tempest_lib.services.compute import interfaces_client -from tempest_lib.tests import fake_auth_provider -from tempest_lib.tests.services.compute import base - - -class TestInterfacesClient(base.BaseComputeServiceTest): - # Data Values to be used for testing # - FAKE_INTERFACE_DATA = { - "fixed_ips": [{ - "ip_address": "192.168.1.1", - "subnet_id": "f8a6e8f8-c2ec-497c-9f23-da9616de54ef" - }], - "mac_addr": "fa:16:3e:4c:2c:30", - "net_id": "3cb9bc59-5699-4588-a4b1-b87f96708bc6", - "port_id": "ce531f90-199f-48c0-816c-13e38010b442", - "port_state": "ACTIVE"} - - FAKE_SHOW_DATA = { - "interfaceAttachment": FAKE_INTERFACE_DATA} - FAKE_LIST_DATA = { - "interfaceAttachments": [FAKE_INTERFACE_DATA]} - - FAKE_SERVER_ID = "ec14c864-096e-4e27-bb8a-2c2b4dc6f3f5" - FAKE_PORT_ID = FAKE_SHOW_DATA['interfaceAttachment']['port_id'] - func2mock = { - 'delete': 'tempest_lib.common.rest_client.RestClient.delete', - 'get': 'tempest_lib.common.rest_client.RestClient.get', - 'post': 'tempest_lib.common.rest_client.RestClient.post'} - - def setUp(self): - super(TestInterfacesClient, self).setUp() - fake_auth = fake_auth_provider.FakeAuthProvider() - self.client = interfaces_client.InterfacesClient(fake_auth, - "compute", - "regionOne") - - def _test_interface_operation(self, operation="create", bytes_body=False): - response_code = 200 - expected_op = self.FAKE_SHOW_DATA - mock_operation = self.func2mock['get'] - params = {'server_id': self.FAKE_SERVER_ID, - 'port_id': self.FAKE_PORT_ID} - if operation == 'list': - expected_op = self.FAKE_LIST_DATA - function = self.client.list_interfaces - params = {'server_id': self.FAKE_SERVER_ID} - elif operation == 'show': - function = self.client.show_interface - elif operation == 'delete': - expected_op = {} - mock_operation = self.func2mock['delete'] - function = self.client.delete_interface - response_code = 202 - else: - function = self.client.create_interface - mock_operation = self.func2mock['post'] - - self.check_service_client_function( - function, mock_operation, expected_op, - bytes_body, response_code, **params) - - def test_list_interfaces_with_str_body(self): - self._test_interface_operation('list') - - def test_list_interfaces_with_bytes_body(self): - self._test_interface_operation('list', True) - - def test_show_interface_with_str_body(self): - self._test_interface_operation('show') - - def test_show_interface_with_bytes_body(self): - self._test_interface_operation('show', True) - - def test_delete_interface_with_str_body(self): - self._test_interface_operation('delete') - - def test_delete_interface_with_bytes_body(self): - self._test_interface_operation('delete', True) - - def test_create_interface_with_str_body(self): - self._test_interface_operation() - - def test_create_interface_with_bytes_body(self): - self._test_interface_operation(bytes_body=True) |