Skip to content

Commit

Permalink
refactor(robot): abstract state validation from volume detachement
Browse files Browse the repository at this point in the history
longhorn/longhorn-9781

Signed-off-by: Chin-Ya Huang <[email protected]>
  • Loading branch information
c3y1huang committed Nov 14, 2024
1 parent b52d00e commit d2d585a
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 2 deletions.
2 changes: 0 additions & 2 deletions e2e/libs/volume/crd.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,6 @@ def detach(self, volume_name, node_name):
# https://github.com/longhorn/longhorn/issues/3715
if e.reason != "Not Found":
Exception(f'exception for patching volumeattachments:', e)
if len(body['spec']['attachmentTickets']) == 0:
self.wait_for_volume_state(volume_name, "detached")

def get(self, volume_name):
return self.obj_api.get_namespaced_custom_object(
Expand Down
1 change: 1 addition & 0 deletions e2e/tests/negative/network_disconnect.robot
Original file line number Diff line number Diff line change
Expand Up @@ -164,4 +164,5 @@ Node Disconnect With Statefulset
And Wait for volume 0 healthy

And Detach volume 0 from attached node
And Wait for volume 0 detached
Then Wait for volume 0 detached
1 change: 1 addition & 0 deletions e2e/tests/negative/stress_cpu.robot
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ Stress Volume Node CPU When Volume Is Detaching and Attaching
FOR ${i} IN RANGE ${LOOP_COUNT}
When Stress CPU of node with volume 0
And Detach volume 0
And Wait for volume 0 detached
And Attach volume 0
And Wait for volume 0 healthy
Then Check volume 0 data is intact
Expand Down
1 change: 1 addition & 0 deletions e2e/tests/negative/stress_filesystem.robot
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ Stress Volume Node Filesystem When Volume Is Detaching and Attaching

FOR ${i} IN RANGE ${LOOP_COUNT}
And Detach volume 0
And Wait for volume 0 detached
And Attach volume 0
And Wait for volume 0 healthy
And Check volume 0 data is intact
Expand Down
1 change: 1 addition & 0 deletions e2e/tests/negative/stress_memory.robot
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ Stress Volume Node Memory When Volume Is Detaching and Attaching
When Stress memory of node with volume 0

And Detach volume 0
And Wait for volume 0 detached
And Attach volume 0
And Wait for volume 0 healthy
Then Check volume 0 data is intact
Expand Down
1 change: 1 addition & 0 deletions e2e/tests/regression/test_backing_image.robot
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Test Backing Image Basic Operation
And Verify clean up backing image bi from a disk will fail
And Verify delete backing image bi will fail
And Detach volume 0
And Wait for volume 0 detached
And Delete volume 0
And Clean up backing image bi from a disk
And Delete backing image bi
1 change: 1 addition & 0 deletions e2e/tests/regression/test_backup.robot
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ Test Incremental Restore
And Wait for volume 3 healthy
And Check volume 3 data is backup 2
And Detach volume 3
And Wait for volume 3 detached

When Create persistentvolume for volume 3
And Create persistentvolumeclaim for volume 3
Expand Down
3 changes: 3 additions & 0 deletions e2e/tests/regression/test_basic.robot
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ Test Volume Basic
Then Check volume 0 data is intact

And Detach volume 0
And Wait for volume 0 detached
And Delete volume 0

Test Snapshot
Expand Down Expand Up @@ -80,11 +81,13 @@ Test Snapshot
And Check volume 0 data is data 2

When Detach volume 0
And Wait for volume 0 detached
And Attach volume 0 in maintenance mode
And Wait for volume 0 healthy

And Revert volume 0 to snapshot 1
And Detach volume 0
And Wait for volume 0 detached
And Attach volume 0
And Wait for volume 0 healthy
Then Check volume 0 data is data 1
Expand Down
1 change: 1 addition & 0 deletions e2e/tests/regression/test_settings.robot
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ Test Setting Concurrent Rebuild Limit
# Test the setting won't intervene normal attachment.
Given Set setting concurrent-replica-rebuild-per-node-limit to 1
When Detach volume 1
And Wait for volume 1 detached
And Delete volume 0 replica on replica node
And Wait until volume 0 replica rebuilding started on replica node
And Attach volume 1
Expand Down
1 change: 1 addition & 0 deletions e2e/tests/regression/test_v2.robot
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ Test V2 Volume Basic
And Write data to volume 0
Then Check volume 0 data is intact
And Detach volume 0
And Wait for volume 0 detached
And Delete volume 0

Degraded Volume Replica Rebuilding
Expand Down

0 comments on commit d2d585a

Please sign in to comment.