Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test VR Validated condition #1577

Merged
merged 5 commits into from
Oct 9, 2024
Merged

Test VR Validated condition #1577

merged 5 commits into from
Oct 9, 2024

Conversation

nirs
Copy link
Member

@nirs nirs commented Sep 26, 2024

Enhance the vrg test infrastructure so we can test negative flows when VR has failed validation does not complete.

Add new tests for:

  • csi-addons >= 0.10.0:
    • Failed VR with Validated condition
  • csi-addons < 0.10.0:
    • Failed VR without Validated condition
    • Completed VR without Validated condition

Based on #1570, required to pass the new tests.

@nirs nirs force-pushed the vr-validated-test branch from 283a6ad to 5735835 Compare October 1, 2024 13:41
nirs added 5 commits October 9, 2024 11:04
This helper fail with this error:

    "failed to wait for volRep condition type to change to 'ConditionCompleted' (%d)"

But the actual check was:

    len(updatedVolRep.Status.Conditions) == 3

and no condition status was checked. This causes 24 tests to fail when
adding the new Validated condition to match csi-addons 0.10.0 conditions.

Now we check that the Completed condition is true and log a more
sensible error message.

Signed-off-by: Nir Soffer <nsoffer@redhat.com>
Split to:
- waitForVolRepCondition() - accept condition name and status. With this
  we can wait until VR is Completed=true, or Validated=false.
- waitForProtectedPVC() - wait until the related protected pvc is
  successful. Used only for positive tests.

Signed-off-by: Nir Soffer <nsoffer@redhat.com>
Add the new VR Validate condition to all tests, and allow testing
negative flows like VR that failed validation or missing Validated
condition.

New promoteOptions{} allows simulation of 2 issues:

- Validated failed: The VR will never complete, blocking deletion of the
  VR and VRG. With this fix deletion will succeed.

- Validated condition missing - running ramen 4.17 on system with older
  csi-addons that does not report the condition. In this case ramen
  continue normally, and deletion of the VR and VRG will be blocked.

We can extend this later to support more options.

Signed-off-by: Nir Soffer <nsoffer@redhat.com>
This simulates the bug when user select the wrong dr policy without
flattening enabled when protecting for a PVC that needs flattening.
Without the fix this test will timeout when deleting the VRG. With the
fix the VRG should be deleted.

Signed-off-by: Nir Soffer <nsoffer@redhat.com>
In csi-addons < 0.10.0 we could not detect failed validation since the
Validated condition is missing.

Add 2 tests:

- VR failed validation: the VRG should block deletion until the VR is
  deleted manually.
- VR completed: the VRG should not block deletion because the Validated
  condition is missing.

Signed-off-by: Nir Soffer <nsoffer@redhat.com>
@nirs nirs force-pushed the vr-validated-test branch from 5735835 to 1f247fc Compare October 9, 2024 08:04
@BenamarMk BenamarMk merged commit bed4c01 into RamenDR:main Oct 9, 2024
20 checks passed
@nirs nirs deleted the vr-validated-test branch November 11, 2024 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants