summaryrefslogtreecommitdiff
path: root/functionaltests/common/cleanup.py
diff options
context:
space:
mode:
authorMauricio Harley <mharley@redhat.com>2022-11-24 10:50:27 +0100
committerAndre Aranha <afariasa@redhat.com>2023-02-07 13:50:51 +0100
commit7f6b3cf790e7d37e85fb38d300fb43573f31184c (patch)
treea89292f06044ac6a5368d8261e015900b0864536 /functionaltests/common/cleanup.py
parent3ffa1600af21620d7f141faee9389c7e7e9079e3 (diff)
downloadpython-barbicanclient-7f6b3cf790e7d37e85fb38d300fb43573f31184c.tar.gz
Added the force parameter to consumer removal and the corresponding CLI commands
When deleting a secret that has consumers, the --force parameter must be specified in the CLI. Change-Id: I49d19ac843d5c805fd7f533d07a3a719ce9a1104
Diffstat (limited to 'functionaltests/common/cleanup.py')
-rw-r--r--functionaltests/common/cleanup.py20
1 files changed, 19 insertions, 1 deletions
diff --git a/functionaltests/common/cleanup.py b/functionaltests/common/cleanup.py
index 031ed58..37439bb 100644
--- a/functionaltests/common/cleanup.py
+++ b/functionaltests/common/cleanup.py
@@ -58,6 +58,24 @@ class CleanUp(object):
self.created_entities[entity_type].append(entity_ref)
return entity_ref
+ def delete_entity(self, entity):
+ """Deletes an entity from Barbican
+
+ Used for testing. Individually deletes an entity.
+
+ """
+ entity_type = entity.lower()
+ if 'acl' in entity_type:
+ entity_type = 'acl'
+ elif 'secret' in entity_type:
+ entity_type = 'secret'
+ elif 'container' in entity_type:
+ entity_type = 'container'
+ else:
+ entity_type = 'order'
+
+ self.created_entities[entity_type].remove(entity)
+
def _delete_all_containers(self):
"""Helper method to delete all containers used for testing"""
for container_ref in self.created_entities['container']:
@@ -66,7 +84,7 @@ class CleanUp(object):
def _delete_all_secrets(self):
"""Helper method to delete all secrets used for testing"""
for secret_ref in self.created_entities['secret']:
- self.barbicanclient.secrets.delete(secret_ref)
+ self.barbicanclient.secrets.delete(secret_ref, True)
def _delete_all_acls(self):
"""Helper method to delete all acls used for testing"""