Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions e2e/keywords/host.resource
Original file line number Diff line number Diff line change
Expand Up @@ -166,3 +166,20 @@ Get host log list on path ${log_path} on node ${node_id}
${host_log_files} = get_host_log_files ${node_name} ${log_path}
log ${host_log_files}
Set Test Variable ${host_log_files}

Check volume endpoint on node of ${resource_kind} ${resource_id}
[Documentation] Find which node ${resource_kind} ${resource_id}'s volume is attached to,
... then run "ls -l /dev/longhorn/${volume_name}" on that node and log the output.
... Fails the test if the endpoint is empty or doesn't exist.
${resource_name} = generate_name_with_suffix ${resource_kind} ${resource_id}
${volume_name} = Run Keyword If '${resource_kind}' == 'volume'
... Set Variable ${resource_name}
... ELSE
... get_workload_volume_name ${resource_name}
${node_name} = get_volume_node ${volume_name}
execute_command_on_node_and_wait_for_output ls -l /dev/longhorn/${volume_name} ${node_name} brw

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.

[Documentation] Run "ls -l /dev/longhorn/" on node ${node_id} and log the output as a WARNING.
${result} = Run command on node ${node_id} and get output string ls -l /dev/longhorn/
Log /dev/longhorn/ on node ${node_id}:\n${result} level=WARN console=True
17 changes: 16 additions & 1 deletion e2e/tests/prerelease_checks.robot
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Resource ../keywords/system_backup.resource
Resource ../keywords/engine_image.resource
Resource ../keywords/longhorn.resource
Resource ../keywords/setting.resource
Resource ../keywords/host.resource

Test Setup Set up test environment
Test Teardown Cleanup test resources
Expand Down Expand Up @@ -227,33 +228,40 @@ Pre-release Checks
IF '${test_v2_only}' == 'false'

# (1-1) check the data integrity of the volume with revision counter enabled
And Check volume endpoint on node of volume vol-revision-enabled
And Check volume vol-revision-enabled data is intact
And Check volume vol-revision-enabled works

# (2-1) check the data integrity of the volume with revision counter disabled
And Check volume endpoint on node of volume vol-revision-disabled
And Check volume vol-revision-disabled data is intact
And Check volume vol-revision-disabled works

# (3-1) check pod didn't restart and the data integrity of the volume used by a pod
And Check volume endpoint on node of volume vol-pod
And Check pod vol-pod did not restart
And Check pod vol-pod data in file data.txt is intact
And Check pod vol-pod works

# (4-1) check statefulset pod didn't restart and the data integrity of the volume used by a statefulset
And Check volume endpoint on node of statefulset ss-upgrade
And Check statefulset ss-upgrade pods did not restart
And Check statefulset ss-upgrade data in file data.txt is intact
And Check statefulset ss-upgrade works

# (5-1) check the data integrity of the strict-local volume
And Check volume endpoint on node of volume vol-strict-local
And Check volume vol-strict-local data is intact
And Check volume vol-strict-local works

# (6-1) check deployment pod didn't restart and the data integrity of the volume of the rwx workload
And Check volume endpoint on node of deployment deploy-upgrade
And Check deployment deploy-upgrade pods did not restart
And Check deployment deploy-upgrade data in file data.txt is intact
And Check deployment deploy-upgrade works

# (7-1) check pod didn't restart and the data integrity of the volume with a backing image
And Check volume endpoint on node of volume vol-bi
And Check pod vol-pod-bi did not restart
And Check file guests/catparrot.gif exists in pod vol-pod-bi
And Check pod vol-pod-bi data in file data.txt is intact
Expand All @@ -272,33 +280,40 @@ Pre-release Checks
IF '${test_v2_only}' == 'false'

# (1-2) check the data integrity of the volume with revision counter enabled
Then Check volume vol-revision-enabled data is intact
Then Check volume endpoint on node of volume vol-revision-enabled
And Check volume vol-revision-enabled data is intact
And Check volume vol-revision-enabled works

# (2-2) check the data integrity of the volume with revision counter disabled
And Check volume endpoint on node of volume vol-revision-disabled
And Check volume vol-revision-disabled data is intact
And Check volume vol-revision-disabled works

# (3-2) check pod didn't restart and the data integrity of the volume used by a pod
And Check volume endpoint on node of volume vol-pod
And And Check pod vol-pod did not restart
And Check pod vol-pod data in file data.txt is intact
And Check pod vol-pod works

# (4-2) check statefulset pod didn't restart and the data integrity of the volume used by a statefulset
And Check volume endpoint on node of statefulset ss-upgrade
And Check statefulset ss-upgrade pods did not restart
And Check statefulset ss-upgrade data in file data.txt is intact
And Check statefulset ss-upgrade works

# (5-2) check the data integrity of the strict-local volume
And Check volume endpoint on node of volume vol-strict-local
And Check volume vol-strict-local data is intact
And Check volume vol-strict-local works

# (6-2) check deployment pod didn't restart and the data integrity of the volume of the rwx workload
And Check volume endpoint on node of deployment deploy-upgrade
And Check deployment deploy-upgrade pods did not restart
And Check deployment deploy-upgrade data in file data.txt is intact
And Check deployment deploy-upgrade works

# (7-2) check pod didn't restart and the data integrity of the volume with a backing image
And Check volume endpoint on node of volume vol-bi
And Check pod vol-pod-bi did not restart
And Check file guests/catparrot.gif exists in pod vol-pod-bi
And Check pod vol-pod-bi data in file data.txt is intact
Expand Down
9 changes: 9 additions & 0 deletions e2e/tests/regression/test_encrypted_volume.robot
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,11 @@ Test Encrypted Volume Upgrade

# ==================== Upgrade Longhorn (Keep Old Engine) ====================
When Setting concurrent-automatic-engine-upgrade-per-node-limit is set to 0

FOR ${i} IN RANGE 7
Check volume endpoint on node of deployment ${i}
END

When Upgrade Longhorn to custom version
And Wait for volume of deployment 0 healthy
And Wait for volume of deployment 1 healthy
Expand All @@ -579,6 +584,10 @@ Test Encrypted Volume Upgrade
And Wait for volume of deployment 5 healthy
And Wait for volume of deployment 6 healthy

FOR ${i} IN RANGE 7
Check volume endpoint on node of deployment ${i}
END

# ==================== Post-Upgrade: Initial State Verification ====================
# Verify old engine semantics are preserved after Longhorn system upgrade
# Deployment 0 (RWO Filesystem): device = 84 Mi, replica = 100 Mi
Expand Down
Loading