-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Yang Chiu <[email protected]>
- Loading branch information
Showing
21 changed files
with
646 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
*** Settings *** | ||
Documentation Workload Keywords | ||
Library Collections | ||
Library ../libs/keywords/workload_keywords.py | ||
|
||
*** Keywords *** | ||
Create deployment ${idx} with ${volume_type} volume | ||
${deployment_name} = create_deployment ${volume_type} | ||
Insert Into List ${deployment_list} ${idx} ${deployment_name} | ||
|
||
Create statefulset ${idx} with ${volume_type} volume | ||
${statefulset_name} = create_statefulset ${volume_type} | ||
Insert Into List ${statefulset_list} ${idx} ${statefulset_name} | ||
|
||
Keep writing data to deployment ${idx} | ||
${pod_name} = get_workload_pod_name ${deployment_list}[${idx}] | ||
keep_writing_pod_data ${pod_name} | ||
|
||
Keep writing data to statefulset ${idx} | ||
${pod_name} = get_workload_pod_name ${statefulset_list}[${idx}] | ||
keep_writing_pod_data ${pod_name} | ||
|
||
Check deployment ${idx} works | ||
${pod_name} = get_workload_pod_name ${deployment_list}[${idx}] | ||
${pod_data_checksum} = write_pod_random_data ${pod_name} 1024 | ||
check_pod_data ${pod_name} ${pod_data_checksum} | ||
|
||
Check statefulset ${idx} works | ||
${pod_name} = get_workload_pod_name ${statefulset_list}[${idx}] | ||
${pod_data_checksum} = write_pod_random_data ${pod_name} 1024 | ||
check_pod_data ${pod_name} ${pod_data_checksum} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
from workload.workload import * | ||
import logging | ||
|
||
class workload_keywords: | ||
|
||
def __init__(self): | ||
logging.warn("initialize workload_keywords class") | ||
|
||
def create_deployment(self, volume_type="rwo"): | ||
pvc_filepath = f"./templates/workload/{volume_type}_pvc.yaml" | ||
deployment_filepath = f"./templates/workload/deployment_with_{volume_type}_volume.yaml" | ||
pvc_name = create_pvc(pvc_filepath) | ||
deployment_name = create_deployment(deployment_filepath) | ||
return deployment_name | ||
|
||
def create_statefulset(self, volume_type="rwo"): | ||
statefulset_filepath = f"./templates/workload/statefulset_with_{volume_type}_volume.yaml" | ||
statefulset_name = create_statefulset(statefulset_filepath) | ||
return statefulset_name | ||
|
||
def get_workload_pod_name(self, workload_name): | ||
return get_workload_pod_names(workload_name)[0] | ||
|
||
def get_workload_volume_name(self, workload_name): | ||
return get_workload_volume_name(workload_name) | ||
|
||
def keep_writing_pod_data(self, pod_name): | ||
return keep_writing_pod_data(pod_name) | ||
|
||
def write_pod_random_data(self, pod, size_in_mb): | ||
return write_pod_random_data(pod, size_in_mb) | ||
|
||
def check_pod_data(self, pod_name, checksum): | ||
print(f"check pod {pod_name} data with checksum {checksum}") | ||
check_pod_data(pod_name, checksum) | ||
|
||
def cleanup_deployments(self, deployment_names): | ||
for name in deployment_names: | ||
pvc_name = get_workload_pvc_name(name) | ||
delete_deployment(name) | ||
delete_pvc(pvc_name) | ||
|
||
def cleanup_statefulsets(self, statefulset_names): | ||
for name in statefulset_names: | ||
pvc_name = get_workload_pvc_name(name) | ||
delete_statefulset(name) | ||
delete_pvc(pvc_name) | ||
|
||
def wait_for_workload_pod_stable(self, workload_name): | ||
return wait_for_workload_pod_stable(workload_name) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from workload import workload |
Oops, something went wrong.