From dd5d449ba39b17bd98c2105c5cb794fa52e8558c Mon Sep 17 00:00:00 2001 From: Yang Chiu Date: Wed, 18 Dec 2024 15:25:20 +0800 Subject: [PATCH] test(robot): add node down during migration test cases Signed-off-by: Yang Chiu --- e2e/tests/negative/live_migration.robot | 67 +++++++++++++++++++++++++ 1 file changed, 67 insertions(+) diff --git a/e2e/tests/negative/live_migration.robot b/e2e/tests/negative/live_migration.robot index e1466164a..6919db0d3 100644 --- a/e2e/tests/negative/live_migration.robot +++ b/e2e/tests/negative/live_migration.robot @@ -37,3 +37,70 @@ Migration Confirmation After Migration Node Down Then Wait for volume 0 to migrate to node 1 And Wait for volume 0 healthy And Check volume 0 data is intact + +Migration Rollback After Migration Node Down + Given Create volume 0 with migratable=True accessMode=RWX dataEngine=${DATA_ENGINE} + And Attach volume 0 to node 0 + And Wait for volume 0 healthy + And Write data to volume 0 + + And Attach volume 0 to node 1 + And Wait for volume 0 migration to be ready + + # power off migration node + When Power off node 1 + # migration rollback by detaching from the migration node + And Detach volume 0 from node 1 + + # migration rollback succeed + Then Wait for volume 0 to stay on node 0 + And Wait for volume 0 degraded + And Check volume 0 data is intact + +Migration Confirmation After Original Node Down + Given Create volume 0 with migratable=True accessMode=RWX dataEngine=${DATA_ENGINE} + And Attach volume 0 to node 0 + And Wait for volume 0 healthy + And Write data to volume 0 + + And Attach volume 0 to node 1 + And Wait for volume 0 migration to be ready + + # power off original node + When Power off node 0 + # migration confirmation by detaching from the original node + And Detach volume 0 from node 0 + + # migration is stuck until the Kubernetes pod eviction controller decides to + # terminate the instance-manager pod that was running on the original node. + # then Longhorn detaches the volume and cleanly reattaches it to the migration node. + Then Wait for volume 0 to migrate to node 1 + And Wait for volume 0 degraded + And Check volume 0 data is intact + +Migration Rollback After Original Node Down + Given Create volume 0 with migratable=True accessMode=RWX dataEngine=${DATA_ENGINE} + And Attach volume 0 to node 0 + And Wait for volume 0 healthy + And Write data to volume 0 + + And Attach volume 0 to node 1 + And Wait for volume 0 migration to be ready + + # power off original node + When Power off node 0 + # migration rollback by detaching from the migration node + And Detach volume 0 from node 1 + + # migration is stuck until the Kubernetes pod eviction controller decides to + # terminate the instance-manager pod that was running on the original node. + # then Longhorn detaches the volume and attempts to cleanly reattach it to the original node, + # but it is stuck in attaching until the node comes back. + Then Check volume 0 kept in attaching + + # power on original node + When Power on off nodes + + Then Wait for volume 0 to stay on node 0 + And Wait for volume 0 healthy + And Check volume 0 data is intact