Skip to content

Commit

Permalink
[ISSUE-1215]: Add const values
Browse files Browse the repository at this point in the history
Signed-off-by: Malgorzata Dutka <[email protected]>
  • Loading branch information
mdutka-dell committed Jul 23, 2024
1 parent 705a439 commit 6b32517
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
1 change: 1 addition & 0 deletions tests/e2e-test-framework/framework/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
FAKE_ATTACH_PVC_ANNOTATION_KEY = "pv.attach.kubernetes.io/ignore-if-inaccessible"

# annotation values
DRIVE_HEALTH_ANNOTATION = "BAD"
VOLUME_RELEASE_DONE_VALUE = "done"
FAKE_ATTACH_PVC_ANNOTATION_VALUE = "yes"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ def test_5921_auto_drive_replacement_with_multiple_volumes_per_pod(self):
self.utils.annotate_custom_resource(
resource_name=drive_name,
resource_type="drives",
annotation_key="health",
annotation_value="BAD"
annotation_key=const.DRIVE_HEALTH_ANNOTATION,
annotation_value=const.DRIVE_HEALTH_ANNOTATION
)
logging.info(f"drive: {drive_name} was annotated with health=BAD")
# 3. wait until drive health is BAD, status=ONLINE, usage=RELEASING.
Expand Down Expand Up @@ -99,8 +99,8 @@ def test_5921_auto_drive_replacement_with_multiple_volumes_per_pod(self):
self.utils.annotate_custom_resource(
resource_name=volume_name,
resource_type="volumes",
annotation_key="release",
annotation_value="done",
annotation_key=const.VOLUME_RELEASE_ANNOTATION,
annotation_value=const.VOLUME_RELEASE_DONE_VALUE,
namespace=volume['metadata']['namespace']
)
logging.info(f"volume: {volume_name} was annotated with release=done")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,15 @@ def test_5955_auto_drive_replacement_with_multiple_volumes_per_pod_single_failur
namespace=volume["metadata"]["namespace"])
drives.append(drive)
failed_drive = drives[0]
health_drive = drives[1]
healthy_drive = drives[1]
failed_volume = volumes[0]
# 2. simulate drive failure. Annotate drive used by pod with health=BAD
failed_drive_name = failed_drive["metadata"]["name"]
self.utils.annotate_custom_resource(
resource_name=failed_drive_name,
resource_type="drives",
annotation_key="health",
annotation_value="BAD"
annotation_key=const.DRIVE_HEALTH_ANNOTATION,
annotation_value=const.DRIVE_HEALTH_ANNOTATION
)
logging.info(f"drive: {failed_drive_name} was annotated with health=BAD")
# 3. wait until drive health is BAD, status=ONLINE, usage=RELEASING.
Expand Down Expand Up @@ -94,8 +94,8 @@ def test_5955_auto_drive_replacement_with_multiple_volumes_per_pod_single_failur
self.utils.annotate_custom_resource(
resource_name=failed_volume_name,
resource_type="volumes",
annotation_key="release",
annotation_value="done",
annotation_key=const.VOLUME_RELEASE_ANNOTATION,
annotation_value=const.VOLUME_RELEASE_DONE_VALUE,
namespace=volume['metadata']['namespace']
)
logging.info(f"volume: {failed_volume_name} was annotated with release=done")
Expand Down Expand Up @@ -154,11 +154,11 @@ def test_5955_auto_drive_replacement_with_multiple_volumes_per_pod_single_failur
cr_existence=False
), f"Drive CR {failed_drive_name} still exists"

health_drive_name = health_drive['metadata']['name']
healthy_drive_name = healthy_drive['metadata']['name']
assert self.utils.check_drive_cr_exist_or_not(
drive_name=health_drive_name,
drive_name=healthy_drive_name,
cr_existence=True,
), f"Drive CR {health_drive_name} does not exist"
), f"Drive CR {healthy_drive_name} does not exist"
# 16. check for events DriveSuccessfullyRemoved in kubernetes events
assert self.utils.event_in(
resource_name=failed_drive_name,
Expand Down

0 comments on commit 6b32517

Please sign in to comment.