-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
currently only support k3s Signed-off-by: Yang Chiu <[email protected]>
- Loading branch information
Showing
7 changed files
with
159 additions
and
36 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
*** Settings *** | ||
Documentation Kubelet keywords | ||
Library ../libs/keywords/kubelet_keywords.py | ||
Library ../libs/keywords/workload_keywords.py | ||
Library ../libs/keywords/volume_keywords.py | ||
|
||
*** Variables *** | ||
|
||
|
||
*** Keywords *** | ||
Stop volume node kubelet of statefulset ${idx} for ${stop_time_in_sec} seconds | ||
${volume_name} = get_workload_volume_name ${statefulset_list}[${idx}] | ||
${node_name} = get_volume_node ${volume_name} | ||
restart_kubelet ${node_name} ${stop_time_in_sec} |
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,6 @@ | ||
from kubelet.kubelet import restart_kubelet | ||
|
||
class kubelet_keywords: | ||
|
||
def restart_kubelet(self, node_name, stop_time_in_sec): | ||
restart_kubelet(node_name, int(stop_time_in_sec)) |
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,22 @@ | ||
from utility.utility import logging | ||
import time | ||
|
||
from workload.pod import new_pod_manifest | ||
from workload.pod import create_pod | ||
from workload.pod import wait_for_pod_status | ||
from workload.pod import delete_pod | ||
from workload.pod import IMAGE_UBUNTU | ||
|
||
def restart_kubelet(node_name, stop_time_in_sec=10): | ||
manifest = new_pod_manifest( | ||
image=IMAGE_UBUNTU, | ||
command=["/bin/bash"], | ||
args=["-c", f"sleep 10 && systemctl stop k3s-agent && sleep {stop_time_in_sec} && systemctl start k3s-agent"], | ||
node_name=node_name | ||
) | ||
pod_name = manifest['metadata']['name'] | ||
create_pod(manifest, is_wait_for_pod_running=True) | ||
|
||
time.sleep(stop_time_in_sec) | ||
|
||
delete_pod(pod_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,36 @@ | ||
*** Settings *** | ||
Documentation Negative Test Cases | ||
Resource ../keywords/workload.resource | ||
Resource ../keywords/volume.resource | ||
Resource ../keywords/node.resource | ||
Resource ../keywords/common.resource | ||
Resource ../keywords/kubelet.resource | ||
|
||
Test Setup Set test environment | ||
Test Teardown Cleanup test resources | ||
|
||
*** Variables *** | ||
${LOOP_COUNT} 1 | ||
${RETRY_COUNT} 300 | ||
${RETRY_INTERVAL} 1 | ||
|
||
*** Test Cases *** | ||
Restart Volume Node Kubelet While Workload Heavy Writing | ||
Given Create statefulset 0 with rwo volume | ||
FOR ${i} IN RANGE ${LOOP_COUNT} | ||
And Keep writing data to statefulset 0 | ||
When Stop volume node kubelet of statefulset 0 for 10 seconds | ||
And Wait for volume of statefulset 0 healthy | ||
And Wait for statefulset 0 stable | ||
Then Check statefulset 0 works | ||
END | ||
|
||
Stop Volume Node Kubelet For More Than Pod Eviction Timeout While Workload Heavy Writing | ||
Given Create statefulset 0 with rwo volume | ||
FOR ${i} IN RANGE ${LOOP_COUNT} | ||
And Keep writing data to statefulset 0 | ||
When Stop volume node kubelet of statefulset 0 for 360 seconds | ||
And Wait for volume of statefulset 0 healthy | ||
And Wait for statefulset 0 stable | ||
Then Check statefulset 0 works | ||
END |