Skip to content

Commit b1c2508

Browse files
authored
ci: add node and CNS restart test case in dualstack (#2135)
* add noderestart test cases
1 parent e5d97bb commit b1c2508

File tree

4 files changed

+56
-8
lines changed

4 files changed

+56
-8
lines changed

.pipelines/singletenancy/aks/e2e-step-template.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ steps:
6060
kubectl get pods -A -o wide
6161
echo "Deploying test pods"
6262
cd test/integration/load
63-
go test -count 1 -timeout 30m -tags load -run ^TestLoad$ -tags=load -iterations=2 -scaleup=${{ parameters.scaleup }} -os=${{ parameters.os }}
63+
go test -count 1 -timeout 30m -tags load -run ^TestLoad$ -iterations=2 -scaleup=${{ parameters.scaleup }} -os=${{ parameters.os }}
6464
cd ../../..
6565
# Remove this once we have cniv1 support for validating the test cluster
6666
echo "Validate State skipped for linux cniv1 for now"

.pipelines/singletenancy/azure-cni-overlay/azure-cni-overlay-e2e-step-template.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ steps:
112112
make -C ./hack/aks azcfg AZCLI=az REGION=$(REGION_AKS_CLUSTER_TEST)
113113
kubectl get pods -owide -A
114114
echo "Validating Node Restart"
115-
sudo go test -timeout 30m -tags load -cni cniv2 -run ^TestValidateState$ -tags=load -restart-case=true
115+
sudo go test -timeout 30m -tags load -cni cniv2 -run ^TestValidateState$ -restart-case=true
116116
displayName: "Validate Node Restart"
117117
retryCountOnTaskFailure: 3
118118

@@ -121,12 +121,12 @@ steps:
121121
kubectl get pod -owide -A
122122
echo "validate pod state before CNS restarts"
123123
cd test/integration/load
124-
sudo go test -timeout 30m -tags load -cni cniv2 -run ^TestValidateState$ -tags=load
124+
sudo go test -timeout 30m -tags load -cni cniv2 -run ^TestValidateState$
125125
kubectl rollout restart ds azure-cns -n kube-system
126126
kubectl rollout status ds azure-cns -n kube-system
127127
kubectl get pod -owide -A
128128
echo "validate pods after CNS restart"
129-
sudo go test -timeout 30m -tags load -cni cniv2 -run ^TestValidateState$ -tags=load
129+
sudo go test -timeout 30m -tags load -cni cniv2 -run ^TestValidateState$
130130
name: "restartCNS_ValidatePodState"
131131
displayName: "Restart CNS and validate pod state"
132132
retryCountOnTaskFailure: 3

.pipelines/singletenancy/dualstack-overlay/dualstackoverlay-e2e-step-template.yaml

Lines changed: 51 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,14 @@ steps:
5252
displayName: "Run CNS Integration Tests on AKS DualStack Overlay"
5353
5454
- script: |
55+
set -e
5556
cd test/integration/load
5657
echo "DualStack Overlay Linux control plane Node properties test"
57-
sudo go test -timeout 30m -tags load -run ^TestDualStackProperties$ -tags=load
58+
sudo go test -timeout 30m -tags load -run ^TestDualStackProperties$
5859
echo "DualStack Overlay Linux control plane Load test"
59-
sudo go test -timeout 30m -tags load -run ^TestLoad$ -tags=load
60+
sudo go test -timeout 30m -tags load -run ^TestLoad$
6061
echo "DualStack Overlay Linux control plane CNS validation test"
61-
make test-validate-state OS=${{ parameters.os }} CNI_TYPE=${{ parameters.cni }}
62+
sudo go test -timeout 30m -tags load -cni dualstack -run ^TestValidateState$
6263
cd ../datapath
6364
echo "Dualstack Overlay Linux datapath IPv6 test"
6465
sudo go test -count=1 datapath_linux_test.go -timeout 1m -tags connection -run ^TestDatapathLinux$ -tags=connection,integration -isDualStack=true
@@ -67,3 +68,50 @@ steps:
6768
retryCountOnTaskFailure: 3
6869
name: "DualStack_Overlay_Linux_Tests"
6970
displayName: "DualStack Overlay Linux Tests"
71+
72+
- task: AzureCLI@1
73+
inputs:
74+
azureSubscription: $(AZURE_TEST_AGENT_SERVICE_CONNECTION)
75+
scriptLocation: "inlineScript"
76+
scriptType: "bash"
77+
addSpnToEnvironment: true
78+
inlineScript: |
79+
set -e
80+
clusterName=${{ parameters.clusterName }}
81+
echo "Restarting nodes"
82+
for val in $(az vmss list -g MC_${clusterName}_${clusterName}_$(REGION_DUALSTACKOVERLAY_CLUSTER_TEST) --query "[].name" -o tsv); do
83+
make -C ./hack/aks restart-vmss AZCLI=az CLUSTER=${clusterName} REGION=$(REGION_DUALSTACKOVERLAY_CLUSTER_TEST) VMSS_NAME=${val}
84+
done
85+
displayName: "Restart Nodes"
86+
87+
- task: AzureCLI@1
88+
inputs:
89+
azureSubscription: $(AZURE_TEST_AGENT_SERVICE_CONNECTION)
90+
scriptLocation: "inlineScript"
91+
scriptType: "bash"
92+
addSpnToEnvironment: true
93+
inlineScript: |
94+
cd test/integration/load
95+
clusterName=${{ parameters.clusterName }}
96+
make -C ./hack/aks set-kubeconf AZCLI=az CLUSTER=${clusterName}
97+
make -C ./hack/aks azcfg AZCLI=az REGION=$(REGION_DUALSTACKOVERLAY_CLUSTER_TEST)
98+
kubectl get pods -A
99+
echo "Validating Node Restart"
100+
sudo go test -timeout 30m -tags load -cni dualstack -run ^TestValidateState$ -restart-case=true
101+
displayName: "Validate Node Restart"
102+
retryCountOnTaskFailure: 3
103+
104+
- script: |
105+
echo "validate pod IP assignment before CNS restart"
106+
kubectl get pod -owide -A
107+
echo "validate pod state before CNS restarts"
108+
cd test/integration/load
109+
sudo go test -timeout 30m -tags load -cni dualstack -run ^TestValidateState$
110+
kubectl rollout restart ds azure-cns -n kube-system
111+
kubectl rollout status ds azure-cns -n kube-system
112+
kubectl get pod -owide -A
113+
echo "validate pods after CNS restarts"
114+
sudo go test -timeout 30m -tags load -cni dualstack -run ^TestValidateState$
115+
name: "restartCNS_ValidatePodState"
116+
displayName: "Restart CNS and Validate Pod State"
117+
retryCountOnTaskFailure: 3

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,7 @@ test-integration: ## run all integration tests.
726726
go test -mod=readonly -buildvcs=false -timeout 1h -coverpkg=./... -race -covermode atomic -coverprofile=coverage.out -tags=integration ./test/integration...
727727

728728
test-validate-state:
729-
cd test/integration/load && go test -mod=readonly -count=1 -timeout 30m -tags load -run ^TestValidateState -tags=load -restart-case=$(RESTART_CASE) -os=$(OS) -cni=$(CNI_TYPE)
729+
cd test/integration/load && go test -mod=readonly -count=1 -timeout 30m -tags load -run ^TestValidateState -restart-case=$(RESTART_CASE) -os=$(OS) -cni=$(CNI_TYPE)
730730
cd ../../..
731731

732732
test-cyclonus: ## run the cyclonus test for npm.

0 commit comments

Comments
 (0)