test(robot): add volume endpoint check keywords and integrate into upgrade tests#3503
test(robot): add volume endpoint check keywords and integrate into upgrade tests#3503roger-ryao wants to merge 4 commits into
Conversation
|
This pull request is now in conflict. Could you fix it @roger-ryao? 🙏 |
|
@roger-ryao Please help resolve the conflicts. |
Update. |
| ${node_name} = get_volume_node ${volume_name} | ||
| check_volume_endpoint_on_node ${volume_name} ${node_name} | ||
|
|
||
| Check volume endpoint on node ${node_id} |
There was a problem hiding this comment.
This keyword isn't used, and it doesn't appear to have been updated. It still only shows the warning message.
There was a problem hiding this comment.
Hi @yangchiu
Check volume endpoint on node ${node_id} is intentionally kept even though it is not currently used.
It can be helpful for debugging purposes. WDYT
There was a problem hiding this comment.
Following other similar functions to implement a mechanism that intentionally waits for a period before failing the test case.
| logging(f"SSH into node {node_name} and run command: {cmd}") | ||
| return ssh_exec(node_name, cmd) | ||
|
|
||
| def check_volume_endpoint_on_node(self, volume_name, node_name): |
There was a problem hiding this comment.
Following other similar functions to implement a mechanism that intentionally waits for a period before failing the test case.
| ${node_name} = get_volume_node ${volume_name} | ||
| check_volume_endpoint_on_node ${volume_name} ${node_name} | ||
|
|
||
| Check volume endpoint on node ${node_id} |
There was a problem hiding this comment.
Following other similar functions to implement a mechanism that intentionally waits for a period before failing the test case.
| ... ELSE | ||
| ... get_workload_volume_name ${resource_name} | ||
| ${node_name} = get_volume_node ${volume_name} | ||
| check_volume_endpoint_on_node ${volume_name} ${node_name} |
There was a problem hiding this comment.
Similar to how you implemented Check volume endpoint on node ${node_id}. You could reuse the existing keyword/function Run command on node ${node_id} and wait for output.
There was a problem hiding this comment.
I'll refine it by using Run command on node ${node_id} and not expect output to keep the original logic.
…grade tests
Add two new keywords to keywords/host.resource for logging /dev/longhorn/
device endpoints on nodes, useful for diagnosing volume state before/after
Longhorn upgrades:
- "Check volume endpoint on node of ${resource_kind} ${resource_id}"
- "Check volume endpoint on node ${node_id}"
Both keywords log a WARNING instead of failing when the path doesn't exist.
Integrate the new keywords into:
- tests/prerelease_checks.robot: import host.resource and call
"Check volume endpoint on node of ..." before each post-system-upgrade
and post-engine-upgrade data integrity check for all volumes/workloads.
- tests/regression/test_encrypted_volume.robot: call
"Check volume endpoint on node of deployment ${i}" for deployments 0-6
before and after Longhorn upgrade in Test Encrypted Volume Upgrade.
longhorn/longhorn#13256
Signed-off-by: Roger Yao <roger.yao@suse.com>
- Extracting the check into a new Python keyword `check_volume_endpoint_on_node`, which asserts the endpoint exists and raises a clear error if not. - simplify node-level directory check to always log as WARNING. longhorn/longhorn#13256 Signed-off-by: Roger Yao <roger.yao@suse.com>
longhorn/longhorn#13256 Signed-off-by: Roger Yao <roger.yao@suse.com>
Remove custom Python keyword `check_volume_endpoint_on_node` and call `execute_command_on_node_and_wait_for_output` directly from the Robot keyword instead. Use `brw` as expected output since it only appears when the endpoint exists as a block device. longhorn/longhorn#13256 Signed-off-by: Roger Yao <roger.yao@suse.com>
|
Tick the box to add this pull request to the merge queue (same as
|
Which issue(s) this PR fixes:
longhorn/longhorn#13256
What this PR does / why we need it:
Add two new keywords to keywords/host.resource for logging /dev/longhorn/ device endpoints on nodes, useful for diagnosing volume state before/after Longhorn upgrades:
Integrate the new keywords into:
Special notes for your reviewer:
Additional documentation or context
longhorn/longhorn#13194