@@ -12,6 +12,7 @@ parameters:
1212 iterations : 3
1313 osSKU : Ubuntu
1414 osSkuWin : Windows2022
15+ upgradeScenario : " "
1516
1617# CNIv2
1718# + Should be able to scale up/down the pods successfully certain number of times.
@@ -28,7 +29,7 @@ parameters:
2829# Previous job has reported Succeeded. Previous job is currently setup which controls variable assignment and we are dependent on its success.
2930# CONTROL_OS either contains 'linux' or 'all' and CONTROL_CNI either contains 'cniv1' or 'all'. Both must be true and are not case sensitive
3031stages :
31- - ${{ if eq(parameters.os, 'linux') }} :
32+ - ${{ if and( eq(parameters.os, 'linux'), eq(parameters.upgradeScenario, false) ) }} :
3233 - stage : create_${{ parameters.name }}
3334 condition : and( succeeded(), and( or( contains(variables.CONTROL_CNI, 'cniv2'), contains(variables.CONTROL_CNI, 'all') ), or( contains(variables.CONTROL_OS, 'linux'), contains(variables.CONTROL_OS, 'all') ) ) )
3435 variables :
@@ -61,7 +62,7 @@ stages:
6162# Condition confirms that:
6263# Previous job has reported Succeeded. Previous job is currently setup which controls variable assignment and we are dependent on its success.
6364# CONTROL_OS either contains 'windows' or 'all' and CONTROL_CNI either contains 'cniv2' or 'all'. Both must be true and are not case sensitive
64- - ${{ if eq(parameters.os, 'windows') }} :
65+ - ${{ if and( eq(parameters.os, 'windows'), eq(parameters.upgradeScenario, false) ) }} :
6566 - stage : create_${{ parameters.name }}
6667 condition : and( succeeded(), and( or( contains(variables.CONTROL_CNI, 'cniv2'), contains(variables.CONTROL_CNI, 'all') ), or( contains(variables.CONTROL_OS, 'windows'), contains(variables.CONTROL_OS, 'all') ) ) )
6768 variables :
@@ -116,7 +117,12 @@ stages:
116117 pool :
117118 name : $(BUILD_POOL_NAME_DEFAULT)
118119 dependsOn :
119- - create_${{ parameters.name }}
120+ - ${{ if and(eq(parameters.upgradeScenario, true), ne(parameters.dependsOn, '')) }} :
121+ - ${{ parameters.dependsOn }}
122+ - ${{ if and(eq(parameters.upgradeScenario, false), eq(parameters.os, 'linux')) }} :
123+ - create_${{ parameters.name }}
124+ - ${{ if and(eq(parameters.upgradeScenario, false), eq(parameters.os, 'windows')) }} :
125+ - create_${{ parameters.name }}
120126 - publish
121127 - setup
122128 displayName : " CNIv2 Test - ${{ parameters.name }}"
@@ -136,11 +142,34 @@ stages:
136142 make -C ./hack/aks set-kubeconf AZCLI=az CLUSTER=${{ parameters.clusterName }}-$(commitID)
137143 kubectl cluster-info
138144 kubectl get po -owide -A
145+ if [ ${{parameters.upgradeScenario}} == "true" ]; then
146+ if [ -z "$UPGRADE_CNS_VERSION" ]
147+ then
148+ echo "UPGRADE_CNS_VERSION is not set, using default value"
149+ CNS=$(make cns-version)
150+ else
151+ CNS=$UPGRADE_CNS_VERSION
152+ echo "UPGRADE_CNS_VERSION is set to $CNS"
153+ fi
154+ IPAM_IMAGE_REPO=$UPGRADE_IPAM_IMAGE_REPO
155+ CNS_IMAGE_REPO=$UPGRADE_CNS_IMAGE_REPO
156+ else
157+ if [ -z "$TEST_CNS_VERSION" ]
158+ then
159+ echo "TEST_CNS_VERSION is not set, using default value"
160+ CNS=$(make cns-version)
161+ else
162+ CNS=$TEST_CNS_VERSION
163+ echo "TEST_CNS_VERSION is set to $CNS"
164+ fi
165+ fi
166+
139167 if [ "${{parameters.os}}" == "windows" ]; then
140- sudo -E env "PATH=$PATH" make test-load CNS_ONLY=true CNS_VERSION=$(make cns-version) CNI_VERSION=$(make cni-version) INSTALL_CNS=true INSTALL_AZURE_CNI_OVERLAY=true CNS_IMAGE_REPO=$(CNS_IMAGE_REPO)
168+ sudo -E env "PATH=$PATH" make test-load CNS_ONLY=true CNS_VERSION=${CNS} CNI_VERSION=$(make cni-version) INSTALL_CNS=true INSTALL_AZURE_CNI_OVERLAY=true CNS_IMAGE_REPO=$(CNS_IMAGE_REPO)
141169 else
142- sudo -E env "PATH=$PATH" make test-integration CNS_VERSION=$(make cns-version) CNI_VERSION=$(make cni-version) INSTALL_CNS=true INSTALL_AZURE_CNI_OVERLAY=true CNS_IMAGE_REPO=$(CNS_IMAGE_REPO)
170+ sudo -E env "PATH=$PATH" make test-integration CNS_VERSION=${CNS} CNI_VERSION=$(make cni-version) INSTALL_CNS=true INSTALL_AZURE_CNI_OVERLAY=true CNS_IMAGE_REPO=$(CNS_IMAGE_REPO)
143171 fi
172+
144173 name : " overlaye2e"
145174 displayName : " Overlay Integration"
146175 - ${{ if contains(parameters.clusterType, 'swift') }} :
@@ -155,10 +184,31 @@ stages:
155184 make -C ./hack/aks set-kubeconf AZCLI=az CLUSTER=${{ parameters.clusterName }}-$(commitID)
156185 kubectl cluster-info
157186 kubectl get po -owide -A
187+ if [ ${{parameters.upgradeScenario}} == "true" ]; then
188+ if [ -z "$UPGRADE_CNS_VERSION" ]
189+ then
190+ echo "UPGRADE_CNS_VERSION is not set, using default value"
191+ CNS=$(make cns-version)
192+ else
193+ CNS=$UPGRADE_CNS_VERSION
194+ echo "UPGRADE_CNS_VERSION is set to $CNS"
195+ fi
196+ IPAM_IMAGE_REPO=$UPGRADE_IPAM_IMAGE_REPO
197+ CNS_IMAGE_REPO=$UPGRADE_CNS_IMAGE_REPO
198+ else
199+ if [ -z "$TEST_CNS_VERSION" ]
200+ then
201+ echo "TEST_CNS_VERSION is not set, using default value"
202+ CNS=$(make cns-version)
203+ else
204+ CNS=$TEST_CNS_VERSION
205+ echo "TEST_CNS_VERSION is set to $CNS"
206+ fi
207+ fi
158208 if [ "${{parameters.os}}" == "windows" ]; then
159- sudo -E env "PATH=$PATH" make test-load CNS_ONLY=true CNS_VERSION=$(make cns-version) CNI_VERSION=$(make cni-version) INSTALL_CNS=true INSTALL_AZURE_VNET=true CNS_IMAGE_REPO=$(CNS_IMAGE_REPO)
209+ sudo -E env "PATH=$PATH" make test-load CNS_ONLY=true CNS_VERSION=${CNS} CNI_VERSION=$(make cni-version) INSTALL_CNS=true INSTALL_AZURE_VNET=true CNS_IMAGE_REPO=$(CNS_IMAGE_REPO)
160210 else
161- sudo -E env "PATH=$PATH" make test-integration CNS_VERSION=$(make cns-version) CNI_VERSION=$(make cni-version) INSTALL_CNS=true INSTALL_AZURE_VNET=true CNS_IMAGE_REPO=$(CNS_IMAGE_REPO)
211+ sudo -E env "PATH=$PATH" make test-integration CNS_VERSION=${CNS} CNI_VERSION=$(make cni-version) INSTALL_CNS=true INSTALL_AZURE_VNET=true CNS_IMAGE_REPO=$(CNS_IMAGE_REPO)
162212 fi
163213 name : " swifte2e"
164214 displayName : " Swift Integration"
@@ -195,6 +245,8 @@ stages:
195245 tag : $(npmVersion)
196246 dependsOn : integration
197247 continueOnError : true
248+ ${{ if eq(parameters.upgradeScenario, 'true') }} :
249+ logType : upgradeNpmLogs
198250 - job : deploy_pods
199251 condition : and( and( not(canceled()), not(failed()) ), or( contains(variables.CONTROL_SCENARIO, 'scaleTest') , contains(variables.CONTROL_SCENARIO, 'all') ) )
200252 displayName : " Scale Test"
@@ -208,6 +260,8 @@ stages:
208260 iterations : ${{ parameters.iterations }}
209261 nodeCount : $(nodeCount)
210262 cni : cniv2
263+ ${{ if eq(parameters.upgradeScenario, 'true') }} :
264+ logType : upgradeScaleTest
211265 - template : ../load-test-templates/validate-state-template.yaml
212266 parameters :
213267 clusterName : ${{ parameters.clusterName }}-$(commitID)
@@ -225,6 +279,8 @@ stages:
225279 os : ${{ parameters.os }}
226280 cni : cniv2
227281 region : $(location)
282+ ${{ if eq(parameters.upgradeScenario, 'true') }} :
283+ logType : upgradeRestartNode
228284 - template : ../load-test-templates/validate-state-template.yaml
229285 parameters :
230286 clusterName : ${{ parameters.clusterName }}-$(commitID)
@@ -243,6 +299,8 @@ stages:
243299 cni : cniv2
244300 scaleup : ${{ parameters.scaleup }}
245301 nodeCount : ${{ parameters.nodeCount }}
302+ ${{ if eq(parameters.upgradeScenario, 'true') }} :
303+ logType : upgradeRestartCNS
246304 - job : recover
247305 condition : and( not(canceled()), not(failed()) )
248306 displayName : " Recover Resources"
@@ -309,7 +367,10 @@ stages:
309367 dependsOn :
310368 - ${{ parameters.name }}
311369 - setup
312- displayName : " HNS Test - ${{ parameters.clusterName }}"
370+ ${{ if eq(parameters.upgradeScenario, true) }} :
371+ displayName : " HNS Test w/ Upgrade - ${{ parameters.name }}"
372+ ${{ else }} :
373+ displayName : " HNS Test - ${{ parameters.name }}"
313374 jobs :
314375 - job : restart_hns
315376 displayName : " Restart and Validate HNS"
0 commit comments