Cluster template cleanup 37/48037/1
authorspisarski <s.pisarski@cablelabs.com>
Wed, 29 Nov 2017 20:11:20 +0000 (13:11 -0700)
committerspisarski <s.pisarski@cablelabs.com>
Wed, 29 Nov 2017 20:11:20 +0000 (13:11 -0700)
Removal of negative tests where an invalid keypair is being
configured. This test was not operating consistently between
pods

Update testing documentation

Updated some invalid class names in pydoc

Change-Id: I7a392e9ed993450de40a20457044ba8294d45044
Signed-off-by: spisarski <s.pisarski@cablelabs.com>
docs/how-to-use/APITests.rst
docs/how-to-use/IntegrationTests.rst
snaps/config/cluster_template.py
snaps/openstack/tests/cluster_template_tests.py
snaps/openstack/utils/tests/magnum_utils_tests.py

index 86c855f..50cd437 100644 (file)
@@ -562,10 +562,6 @@ magnum_utils_tests.py - MagnumUtilsTests
 |                                       |               | magnum_utils.create_cluster_template() will raise a       |
 |                                       |               | BadRequest exception when the image does not exist        |
 +---------------------------------------+---------------+-----------------------------------------------------------+
-| test_create_cluster_template_bad_kp   | 1             | Ensures the function                                      |
-|                                       |               | magnum_utils.create_cluster_template() will raise a       |
-|                                       |               | NotFound exception when the keypair does not exist        |
-+---------------------------------------+---------------+-----------------------------------------------------------+
 | test_create_cluster_template_bad_ext  | 1             | Ensures the function                                      |
 | _net                                  |               | magnum_utils.create_cluster_template() will raise a       |
 |                                       |               | BadRequest exception when the external network does not   |
index 80c93d0..1856bb9 100644 (file)
@@ -695,9 +695,6 @@ cluster_template_tests.py - CreateClusterTemplateTests
 |                                        |               | raise an exception when the image is invalid              |
 +----------------------------------------+---------------+-----------------------------------------------------------+
 | test_create_cluster_template_bad       | 1             | Tests to ensure OpenStackClusterTemplate#create() will    |
-| _keypair                               |               | raise an exception when the keypair is invalid            |
-+----------------------------------------+---------------+-----------------------------------------------------------+
-| test_create_cluster_template_bad       | 1             | Tests to ensure OpenStackClusterTemplate#create() will    |
 | _network_driver                        |               | raise an exception when the network driver is invalid     |
 +----------------------------------------+---------------+-----------------------------------------------------------+
 | test_create_cluster_template_bad       | 1             | Tests to ensure OpenStackClusterTemplate#create() will    |
index a9ef45c..0acf25a 100644 (file)
@@ -255,7 +255,7 @@ def map_server_type(server_type):
     return None
     :param server_type: the server_type value to map
     :return: the ServerType enum object
-    :raise: ClusterTypeConfigError if value is invalid
+    :raise: ClusterTemplateConfigError if value is invalid
     """
     if not server_type:
         return None
@@ -275,7 +275,7 @@ def map_coe(coe):
     When None return None
     :param coe: the COE value to map
     :return: the ContainerOrchestrationEngine enum object
-    :raise: ClusterTypeConfigError if value is invalid
+    :raise: ClusterTemplateConfigError if value is invalid
     """
     if not coe:
         return None
@@ -294,7 +294,7 @@ def map_docker_storage_driver(driver):
     When None return None
     :param driver: the docker storage driver value to map
     :return: the DockerStorageDriver enum object
-    :raise: ClusterTypeConfigError if value is invalid
+    :raise: ClusterTemplateConfigError if value is invalid
     """
     if not driver:
         return None
index 791ace2..355467d 100644 (file)
@@ -12,7 +12,7 @@
 # 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 magnumclient.common.apiclient.exceptions import BadRequest, NotFound
+from magnumclient.common.apiclient.exceptions import BadRequest
 
 from snaps.config.cluster_template import ClusterTemplateConfig
 from snaps.config.flavor import FlavorConfig
@@ -241,25 +241,6 @@ class CreateClusterTemplateTests(OSIntegrationTestCase):
         with self.assertRaises(BadRequest):
             self.cluster_template_creator.create()
 
-    def test_create_cluster_template_bad_keypair(self):
-        """
-        Tests the creation of an OpenStack cluster template raises an
-        exception with an invalid keypair.
-        """
-        # Create ClusterTemplate
-        cluster_template_config = ClusterTemplateConfig(
-            name=self.cluster_type_name,
-            image=self.image_creator.image_settings.name,
-            keypair='foo',
-            external_net=self.ext_net_name,
-            flavor=self.flavor_creator.flavor_settings.name)
-
-        self.cluster_template_creator = OpenStackClusterTemplate(
-            self.os_creds, cluster_template_config)
-
-        with self.assertRaises(NotFound):
-            self.cluster_template_creator.create()
-
     def test_create_cluster_template_bad_network_driver(self):
         """
         Tests the creation of an OpenStack cluster template raises an
index 766e3f2..f841c48 100644 (file)
@@ -15,7 +15,7 @@
 import logging
 import uuid
 
-from magnumclient.common.apiclient.exceptions import BadRequest, NotFound
+from magnumclient.common.apiclient.exceptions import BadRequest
 
 from snaps.config.cluster_template import (
     ClusterTemplateConfig, ServerType,  ContainerOrchestrationEngine,
@@ -194,18 +194,6 @@ class MagnumUtilsClusterTypeTests(OSComponentTestCase):
             self.cluster_template = magnum_utils.create_cluster_template(
                 self.magnum, config)
 
-    def test_create_cluster_template_bad_kp(self):
-        config = ClusterTemplateConfig(
-            name=self.cluster_type_name,
-            image=self.image_creator.image_settings.name,
-            keypair='foo',
-            external_net=self.ext_net_name,
-            flavor=self.flavor_creator.flavor_settings.name)
-
-        with self.assertRaises(NotFound):
-            self.cluster_template = magnum_utils.create_cluster_template(
-                self.magnum, config)
-
     def test_create_cluster_template_bad_ext_net(self):
         config = ClusterTemplateConfig(
             name=self.cluster_type_name,