示例#1
0
    def test_positive_create_deployment(self):
        """Create a simple deployment.

        @Assert: An RHCI deployment is created with a random name.

        @Feature: RHCI Deployment

        """
        for name in (gen_string(str_type='alpha'),
                     gen_string(str_type='alphanumeric'),
                     gen_string(str_type='cjk'),
                     gen_string(str_type='latin1')):
            with self.subTest(name):
                deployment = entities.RHCIDeployment(
                    name=name,
                    organization=self.org,
                    lifecycle_environment=self.lc_env,
                    deploy_rhev=True,
                    rhev_engine_host=self.rhev_engine_host,
                    rhev_storage_type='NFS',
                    rhev_engine_admin_password='******',
                ).create()
                self.assertEquals(deployment.name, name)
                self.assertEqual(deployment.organization.id, self.org.id)
                self.assertEqual(deployment.lifecycle_environment.id,
                                 self.lc_env.id)
                self.to_delete.append(deployment)
示例#2
0
    def test_positive_update_name(self):
        """Update a deployment's name.

        @Assert: An RHCI deployment is updated with a random name.

        @Feature: RHCI Deployment

        """
        for data in valid_name_update_tests():
            with self.subTest(data):
                deployment = entities.RHCIDeployment(
                    name=data['name'],
                    organization=self.org,
                    lifecycle_environment=self.lc_env,
                    deploy_rhev=True,
                    rhev_engine_host=self.rhev_engine_host,
                    rhev_storage_type='NFS',
                    rhev_engine_admin_password='******',
                ).create()
                self.assertEquals(deployment.name, data['name'])

                # perform the update
                deployment.name = data['new-name']
                deployment = deployment.update(['name'])
                self.assertEqual(deployment.name, data['new-name'])
                self.to_delete.append(deployment)
示例#3
0
    def test_positive_delete_deployment(self):
        """Create and delete a simple deployment.

        @Assert: An RHCI deployment is deleted.

        @Feature: RHCI Deployment

        """
        data = gen_string(str_type='alpha')
        deployment = entities.RHCIDeployment(
            name=data,
            organization=self.org,
            lifecycle_environment=self.lc_env,
            deploy_rhev=True,
            rhev_engine_host=self.rhev_engine_host,
            rhev_storage_type='NFS',
            rhev_engine_admin_password='******',
        ).create()
        self.assertEquals(deployment.name, data)

        # Perform the delete
        deployment.delete()

        # Check to make sure the deployment has been deleted
        with self.assertRaises(HTTPError):
            deployment.read()