Skip to content

Commit

Permalink
removed files that are not supposed to be in the PR
Browse files Browse the repository at this point in the history
Signed-off-by: Katharina Trentau <[email protected]>
  • Loading branch information
fraugabel committed Nov 11, 2024
1 parent 92ea10e commit f9436e5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 29 deletions.
43 changes: 15 additions & 28 deletions Tests/iaas/key-manager/check-for-key-manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,23 +77,6 @@ def check_key_manager_permissions(conn: openstack.connection.Connection) -> None
has sufficient access to the Key Manager API functionality.
"""
secret_name = "scs-member-role-test-secret"
if not check_for_member_role(conn):
logger.warning("Cannot test key-manager permissions. " "User has wrong roles")
return None

def _find_secret(secret_name_or_id: str):
"""Replacement method for finding secrets.
Mimicks the behavior of Connection.key_manager.find_secret()
but fixes an issue with the internal implementation raising an
exception due to an unexpected microversion parameter.
"""
secrets = conn.key_manager.secrets()
for s in secrets:
if s.name == secret_name_or_id or s.id == secret_name_or_id:
return s
return None

try:
existing_secret = _find_secret(conn, secret_name)
if existing_secret:
Expand All @@ -105,21 +88,25 @@ def _find_secret(secret_name_or_id: str):
secret_type="opaque",
payload="foo",
)

new_secret = _find_secret(secret_name)
assert new_secret, (
f"Secret created with name '{secret_name}' was not discoverable by "
f"the user"
try:
new_secret = _find_secret(conn, secret_name)
if not new_secret:
raise ValueError(f"Secret '{secret_name}' was not discoverable by the user")
finally:
conn.key_manager.delete_secret(new_secret)
except openstack.exceptions.ForbiddenException:
logger.debug('exception details', exc_info=True)
logger.error(
"Users with the 'member' role can use Key Manager API: FAIL"
)
conn.key_manager.delete_secret(new_secret)
except openstack.exceptions.ForbiddenException as e:
print("Users of the 'member' role can use Key Manager API: FAIL")
print(f"ERROR: {str(e)}")
exit(1)
print("Users of the 'member' role can use Key Manager API: PASS")
return 1
logger.info(
"Users with the 'member' role can use Key Manager API: PASS"
)


def main():
initialize_logging()
parser = argparse.ArgumentParser(description="SCS Mandatory IaaS Service Checker")
parser.add_argument(
"--os-cloud",
Expand Down
1 change: 0 additions & 1 deletion Tests/iaas/security-groups/default-security-group-rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ def handle(self, record):
self.bylevel[record.levelno] += 1



def main():
parser = argparse.ArgumentParser(
description="SCS Default Security Group Rules Checker",
Expand Down

0 comments on commit f9436e5

Please sign in to comment.