Remove retired congress

Congress has been retired and requirements-check fails now, remove
congress.

See also https://review.opendev.org/721741

Change-Id: Ic2d74543f65a60ccb567aae4c4012c422884bb50
This commit is contained in:
Andreas Jaeger 2020-06-06 09:08:20 +02:00
parent 32ce7f05ad
commit 110bde6cd8
4 changed files with 0 additions and 193 deletions

View File

@ -12,9 +12,6 @@
# License for the specific language governing permissions and limitations
# under the License.
import congressclient.v1.client as cclient
from keystoneauth1 import identity
from keystoneauth1 import session as ksasession
import keystoneclient.v3 as ksclient
from tempest import config
@ -33,17 +30,3 @@ class TempestDeployTestMixin(common_utils.DeployTestMixin):
password=CONF.auth.admin_password,
tenant_name=CONF.auth.admin_project_name,
auth_url=CONF.identity.uri_v3)
@staticmethod
@common_utils.memoize
def congress_client():
auth = identity.v3.Password(
auth_url=CONF.identity.uri_v3,
username=CONF.auth.admin_username,
password=CONF.auth.admin_password,
project_name=CONF.auth.admin_project_name,
user_domain_name=CONF.auth.admin_domain_name,
project_domain_name=CONF.auth.admin_domain_name)
session = ksasession.Session(auth=auth)
return cclient.Client(session=session,
service_type='policy')

View File

@ -15,7 +15,6 @@
import os
import uuid
from keystoneclient import exceptions as keystone_exceptions
import mistralclient.api.client as mistralclient
import testresources
import testtools
@ -71,87 +70,3 @@ class MistralIntegration(testtools.TestCase, testtools.testcase.WithAttributes,
"id": str(uuid.uuid4())
}
}
class CongressIntegration(testtools.TestCase,
testtools.testcase.WithAttributes,
testresources.ResourcedTestCase,
tempest_utils.TempestDeployTestMixin):
@classmethod
def _create_policy_req(cls, policy_name):
return {'abbreviation': None, 'kind': None,
'name': policy_name,
'description': None}
@classmethod
def _upload_policy_enf_app(cls):
app_dir = 'io.murano.apps.test.PolicyEnforcementTestApp'
zip_file_path = cls.zip_dir(os.path.dirname(__file__), app_dir)
cls.init_list("_package_files")
cls._package_files.append(zip_file_path)
return cls.upload_package(
'PolicyEnforcementTestApp',
{"categories": ["Web"], "tags": ["tag"]},
zip_file_path)
@classmethod
def _create_policy(cls, policy_names, kind=None):
for name in policy_names:
policy_req = {"name": name}
if kind:
policy_req["kind"] = kind
with utils.ignored(keystone_exceptions.Conflict):
cls.congress_client().create_policy(policy_req)
rules = []
rules_file = os.path.join(
os.path.dirname(__file__),
"rules_" + name + ".txt")
if os.path.isfile(rules_file):
with open(rules_file) as f:
rules = [rule.strip() for rule in f.readlines()
if rule.strip()]
for rule in rules:
with utils.ignored(keystone_exceptions.Conflict):
cls.congress_client().create_policy_rule(name,
{'rule': rule})
def _create_test_app(self, flavor, key):
"""Application create request body
Deployment is expected to fail earlier due to policy violation.
Not existing image prevents real deployment to happen
in case that test goes wrong way.
:param flavor: instance image flavor
:param key: key name
"""
return {
"instance": {
"flavor": flavor,
"keyname": key,
"image": "not_existing_image",
"assignFloatingIp": True,
"?": {
"type": "io.murano.resources.LinuxMuranoInstance",
"id": str(uuid.uuid4())
},
"name": "testMurano"
},
"name": "teMurano",
"?": {
"type": "io.murano.apps.test.PolicyEnforcementTestApp",
"id": str(uuid.uuid4())
}
}
def _check_deploy_failure(self, post_body, expected_text):
environment_name = 'PolicyEnfTestEnv' + uuid.uuid4().hex[:5]
env = self.deploy_apps(environment_name, post_body)
status = self.wait_for_final_status(env)
self.assertIn("failure", status[0], "Unexpected status : " + status[0])
self.assertIn(expected_text, status[1].lower(),
"Unexpected status : " + status[1])

View File

@ -1,90 +0,0 @@
# Copyright (c) 2015 OpenStack Foundation
#
# 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 muranoclient.common.exceptions as murano_exceptions
import murano_tempest_tests.tests.functional.common.utils as common_utils
import murano_tempest_tests.tests.functional.integration.integration_base \
as core
from tempest.lib import decorators
class PolicyEnforcementTest(core.CongressIntegration):
@classmethod
def setUpClass(cls):
super(PolicyEnforcementTest, cls).setUpClass()
cls._create_policy(["murano", "murano_system"])
cls._create_policy(["murano_action"], kind="action")
with common_utils.ignored(murano_exceptions.HTTPInternalServerError):
cls._upload_policy_enf_app()
@classmethod
def tearDownClass(cls):
cls.purge_uploaded_packages()
def tearDown(self):
super(PolicyEnforcementTest, self).tearDown()
self.purge_environments()
@decorators.attr(type=['all', 'coverage'])
def test_deploy_policy_fail_key(self):
"""Test expects failure due to empty key name.
In rules_murano_system.txt file are defined congress
rules preventing deploy environment where instances
have empty keyname property. In other words admin
prevented spawn instance without assigned key pair.
"""
self._check_deploy_failure(
self._create_test_app(key='',
flavor='m1.small'),
'missing key')
@decorators.attr(type=['all', 'coverage'])
def test_deploy_policy_fail_flavor(self):
"""Test expects failure due to blacklisted flavor
In rules_murano_system.txt file are defined congress
rules preventing deploy environment where instances
have flavor property set to 'really.bad.flavor'.
"""
self._check_deploy_failure(
self._create_test_app(flavor='really.bad.flavor',
key='test-key'),
'bad flavor')
@decorators.attr(type=['all', 'coverage'])
def test_set_property_policy(self):
"""Tests environment modification by policy
In rules_murano_system.txt file are defined congress
rules changing flavor property. There are defined
synonyms for 'really.bad.flavor'. One of such synonyms
is 'horrible.flavor' Environment is modified prior deployment.
The synonym name 'horrible.flavor' is set to original
value 'really.bad.flavor' and then deployment is aborted
because instances of 'really.bad.flavor' are prevented
to be deployed like for the test above.
"""
self._check_deploy_failure(
self._create_test_app(key="test-key",
flavor="horrible.flavor"),
"bad flavor")

View File

@ -15,5 +15,4 @@ python-keystoneclient>=3.8.0 # Apache-2.0
python-heatclient>=1.10.0 # Apache-2.0
python-neutronclient>=6.7.0 # Apache-2.0
python-muranoclient>=0.8.2 # Apache-2.0
python-congressclient<2000,>=1.9.0 # Apache-2.0
python-mistralclient!=3.2.0,>=3.1.0 # Apache-2.0