-
Notifications
You must be signed in to change notification settings - Fork 39
Add lvm test cases #2678
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add lvm test cases #2678
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,9 @@ | ||
| *** Settings *** | ||
| Documentation Common Keywords | ||
| Library ../libs/keywords/common_keywords.py | ||
| Library ../libs/keywords/image_keywords.py | ||
| Library ../libs/keywords/network_keywords.py | ||
| Library ../libs/keywords/volume_keywords.py | ||
| Resource variables.resource | ||
|
|
||
|
|
||
|
|
@@ -32,3 +35,50 @@ Count Pods By Label | |
| ${pods}= common_keywords.list_pods_by_label ${namespace} ${label_selector} ${status} | ||
| ${count}= Get Length ${pods} | ||
| RETURN ${count} | ||
|
|
||
| Suite Setup For Shared Resources | ||
| [Documentation] Suite setup for shared resources | ||
| Log Setting up shared resources for the test suite | ||
|
|
||
| # Initialize test variables | ||
| ${timestamp}= Evaluate __import__('datetime').datetime.now().strftime("%Y%m%d%H%M%S") | ||
| Set Suite Variable ${UNIQUE_NAME} ${timestamp} | ||
| Set Suite Variable ${VLAN_NETWORK_NAME} vlan-network-${VLAN_ID} | ||
| # Harvester enforces a 12-character max on ClusterNetwork and VlanConfig names. | ||
| ${ts_short}= Evaluate '${timestamp}'[-7:] | ||
| Set Suite Variable ${CLUSTER_NETWORK_NAME} cnet-${ts_short} | ||
| Set Suite Variable ${VLAN_CONFIG_NAME} vcfg-${ts_short} | ||
| Set Suite Variable ${IP_POOL_NAME} ippool-vlan${VLAN_ID} | ||
| Set Suite Variable ${IMAGE_NAME} opensuse-${timestamp} | ||
|
|
||
| # Create shared resources | ||
| network_keywords.create_cluster_network ${CLUSTER_NETWORK_NAME} | ||
| network_keywords.create_vlan_config ${VLAN_CONFIG_NAME} ${CLUSTER_NETWORK_NAME} ${VLAN_NIC} | ||
| network_keywords.wait_for_cluster_network_ready ${CLUSTER_NETWORK_NAME} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we prefer the style to handle most logic in python layer and just call them in the RF layer?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good idea! I'll update the Readme |
||
| network_keywords.create_vlan_network ${VLAN_NETWORK_NAME} ${VLAN_ID} ${CLUSTER_NETWORK_NAME} | ||
| network_keywords.create_ip_pool | ||
| ... ${IP_POOL_NAME} | ||
| ... ${IP_POOL_SUBNET} | ||
| ... ${IP_POOL_START} | ||
| ... ${IP_POOL_END} | ||
| ... ${DEFAULT_NAMESPACE}/${VLAN_NETWORK_NAME} | ||
| image_keywords.create image from url ${IMAGE_NAME} ${OPENSUSE_IMAGE_URL} | ||
| image_keywords.wait for image downloaded ${IMAGE_NAME} | ||
|
|
||
| Log Test environment ready (image: ${IMAGE_NAME}, vlan: ${VLAN_NETWORK_NAME}, timestamp: ${timestamp}) console=yes | ||
|
|
||
| Suite Teardown For Shared Resources | ||
| [Documentation] Cleanup all resources after tests. | ||
| Log Running shared resources teardown | ||
|
|
||
| # Delete shared resources | ||
| Run Keyword And Ignore Error network_keywords.delete_ip_pool ${IP_POOL_NAME} | ||
| Run Keyword And Ignore Error network_keywords.delete_vlan_network ${VLAN_NETWORK_NAME} | ||
| Run Keyword And Ignore Error network_keywords.delete_vlan_config ${VLAN_CONFIG_NAME} | ||
| Run Keyword And Ignore Error network_keywords.wait_for_vlan_config_deleted ${VLAN_CONFIG_NAME} | ||
| Run Keyword And Ignore Error network_keywords.delete_cluster_network ${CLUSTER_NETWORK_NAME} | ||
| Run Keyword And Ignore Error volume_keywords.cleanup_volumes | ||
| Run Keyword And Ignore Error image_keywords.delete image ${IMAGE_NAME} | ||
|
|
||
| Cleanup test resources | ||
| Log Suite teardown completed for shared resources | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fetching timestamps is a frequently used operation, may have a common keyword
Get Timestampand support different forms?