Skip to content

test(robot): add volume endpoint check keywords and integrate into upgrade tests#3503

Open
roger-ryao wants to merge 4 commits into
longhorn:masterfrom
roger-ryao:issue13256
Open

test(robot): add volume endpoint check keywords and integrate into upgrade tests#3503
roger-ryao wants to merge 4 commits into
longhorn:masterfrom
roger-ryao:issue13256

Conversation

@roger-ryao

Copy link
Copy Markdown
Contributor

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:

  • "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.

Special notes for your reviewer:

Additional documentation or context

longhorn/longhorn#13194

@roger-ryao roger-ryao self-assigned this Jun 16, 2026
@roger-ryao roger-ryao requested a review from a team as a code owner June 16, 2026 06:06
Comment thread e2e/keywords/host.resource Outdated
Comment thread e2e/keywords/host.resource Outdated
@mergify

mergify Bot commented Jun 30, 2026

Copy link
Copy Markdown

This pull request is now in conflict. Could you fix it @roger-ryao? 🙏

@yangchiu

yangchiu commented Jul 9, 2026

Copy link
Copy Markdown
Member

@roger-ryao Please help resolve the conflicts.

@roger-ryao

Copy link
Copy Markdown
Contributor Author

@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}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This keyword isn't used, and it doesn't appear to have been updated. It still only shows the warning message.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Following other similar functions to implement a mechanism that intentionally waits for a period before failing the test case.

@roger-ryao roger-ryao requested a review from yangchiu July 13, 2026 01:04
Comment thread e2e/libs/keywords/host_keywords.py Outdated
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):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Following other similar functions to implement a mechanism that intentionally waits for a period before failing the test case.

@roger-ryao roger-ryao requested a review from yangchiu July 13, 2026 06:41
Comment thread e2e/keywords/host.resource Outdated
... ELSE
... get_workload_volume_name ${resource_name}
${node_name} = get_volume_node ${volume_name}
check_volume_endpoint_on_node ${volume_name} ${node_name}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
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>
@mergify

mergify Bot commented Jul 15, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

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.

2 participants