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
2 changes: 2 additions & 0 deletions harvester_e2e_tests/integrations/test_0_storage_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ def cluster_network(request, api_client, unique_name):
assert 200 == code, (code, data)


@pytest.mark.robot_ported
@pytest.mark.p0
@pytest.mark.smoke
@pytest.mark.settings
Expand Down Expand Up @@ -147,6 +148,7 @@ def test_enable_storage_network(
assert snet_enabled, (code, data)


@pytest.mark.robot_ported
@pytest.mark.p0
@pytest.mark.smoke
@pytest.mark.settings
Expand Down
14 changes: 8 additions & 6 deletions harvester_robot_tests/keywords/common.resource
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@ Set up test environment
common_keywords.init k8s api client

Generate Unique Name
[Arguments] ${prefix1}=${EMPTY} ${prefix2}=${EMPTY}
[Documentation] Generate a unique name with optional prefixes and yymmdd-HHMMSS-ffffqa timestamp suffix
... Generate Unique Name -> '260603-145834-1273qa'
... Generate Unique Name foo -> 'foo-260603-145834-1273qa'
... Generate Unique Name foo bar -> 'foo-bar-2260603-145834-1273qa'
${name}= common_keywords.generate_name_with_suffix ${prefix1} ${prefix2}
[Arguments] ${prefix1}=${EMPTY} ${prefix2}=${EMPTY} ${precise}=${FALSE}
[Documentation] Generate a name with timestamp suffix and optional prefixes
... The timestamp format is `%m%d%H%M` by default and `%m%d%H%M%S%f` when precise=${TRUE}
... Examples:
... Generate Unique Name -> '06181015'
... Generate Unique Name foo -> 'foo-06181015'
... Generate Unique Name foo bar precise=${TRUE}-> 'foo-bar-0618101519681156'
${name}= common_keywords.generate_name_with_suffix ${prefix1} ${prefix2} ${precise}
RETURN ${name}

Cleanup test resources
Expand Down
18 changes: 2 additions & 16 deletions harvester_robot_tests/keywords/rancher.resource
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,6 @@ Clear State
[Documentation] Clear state - either specific key or all
rancher_keywords.clear_state ${key}

Generate Unique Name
[Arguments] ${prefix}=test
[Documentation] Generate unique name with timestamp
${name}= rancher_keywords.generate_unique_name ${prefix}
Log Generated unique name: ${name}
RETURN ${name}

# Harvester Management Cluster Operations
Create Harvester Mgmt Cluster
[Arguments] ${cluster_name}
Expand Down Expand Up @@ -974,13 +967,6 @@ Get Storage Network Status
${status}= storage_network.Get Status
RETURN ${status}

Wait For Storage Network Ready
[Arguments] ${timeout}=${RANCHER_WAIT_TIMEOUT}
[Documentation] Wait for storage-network to be applied and completed.
... Delegates to Storage Network module.
${data}= storage_network.Wait For Ready ${timeout}
RETURN ${data}

Get Vlan Network CIDR
[Arguments] ${vlan_id} ${cluster_network}
[Documentation] Get the CIDR for a VLAN network by creating a temp network.
Expand Down Expand Up @@ -1172,7 +1158,7 @@ Storage network is configured for RWX
${cluster_network}= Set Variable %{CLUSTER_NETWORK=mgmt}
${cidr}= Get Vlan Network CIDR ${VLAN_ID} ${cluster_network}
Enable Storage Network ${VLAN_ID} ${cluster_network} ${cidr} share_rwx=${TRUE}
Wait For Storage Network Ready ${RANCHER_WAIT_TIMEOUT}
storage_network.Wait For Enabled ${cidr} ${RANCHER_WAIT_TIMEOUT}
Log Storage network configured for RWX console=yes

Storage network is enabled for RWX
Expand All @@ -1197,7 +1183,7 @@ Storage network is enabled for RWX
${cluster_network}= Set Variable %{CLUSTER_NETWORK=mgmt}
${cidr}= Get Vlan Network CIDR ${VLAN_ID} ${cluster_network}
Enable Storage Network ${VLAN_ID} ${cluster_network} ${cidr} share_rwx=${TRUE}
Wait For Storage Network Ready ${RANCHER_WAIT_TIMEOUT}
storage_network.Wait For Enabled ${cidr} ${RANCHER_WAIT_TIMEOUT}
Log Storage network enabled console=yes

# Start VMs back up
Expand Down
20 changes: 15 additions & 5 deletions harvester_robot_tests/keywords/storage_network.resource
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,22 @@ Get Status
${status}= storage_network_keywords.get_storage_network_status
RETURN ${status}

Wait For Ready
Is Enabled
[Arguments] ${snet_cidr}
${enabled}= storage_network_keywords.is_storage_network_enabled_in_config
Should Be True ${enabled} Storage network config (Harvester) is NOT enabled
${enabled}= storage_network_keywords.is_storage_network_enabled_on_pods ${snet_cidr}
Should Be True ${enabled} Storage network service (Longhorn) is NOT enabled

Wait For Enabled
[Arguments] ${snet_cidr} ${timeout}=${WAIT_TIMEOUT}
storage_network_keywords.wait_storage_network_enabled_in_config ${timeout}
storage_network_keywords.wait_storage_network_enabled_on_pods ${snet_cidr} ${timeout}

Wait For Disabled
[Arguments] ${timeout}=${WAIT_TIMEOUT}
[Documentation] Wait for storage-network to be applied and completed.
Log Waiting for storage network to be ready
${data}= storage_network_keywords.wait_for_storage_network_ready ${timeout}
RETURN ${data}
storage_network_keywords.wait_storage_network_disabled_in_config ${timeout}
storage_network_keywords.wait_storage_network_disabled_on_pods ${timeout}

Get Vlan Network CIDR
[Arguments] ${vlan_id} ${cluster_network}
Expand Down
Loading
Loading