Skip to content

Commit 68fed09

Browse files
authored
Merge pull request #822 from andyzhangx/test-win-failure
test: fix windows test failure2
2 parents d61b385 + a56152c commit 68fed09

File tree

5 files changed

+46
-4
lines changed

5 files changed

+46
-4
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ container-linux-armv7:
163163

164164
.PHONY: container-windows
165165
container-windows:
166-
docker buildx build --pull --output=type=$(OUTPUT_TYPE) --platform="windows/$(ARCH)" \
166+
docker buildx build --no-cache --pull --output=type=$(OUTPUT_TYPE) --platform="windows/$(ARCH)" \
167167
-t $(IMAGE_TAG)-windows-$(OSVERSION)-$(ARCH) --build-arg OSVERSION=$(OSVERSION) \
168168
--provenance=false --sbom=false \
169169
--build-arg ARCH=$(ARCH) -f ./cmd/smbplugin/Dockerfile.Windows .

cmd/smbplugin/Dockerfile.Windows

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@
1313
# limitations under the License.
1414

1515
# these arguments come from BUILD_PLATFORMS used in release-tools
16-
ARG ADDON_IMAGE=servercore:1809
17-
ARG BASE_IMAGE=nanoserver:1809
16+
ARG OSVERSION
17+
ARG ADDON_IMAGE=servercore:${OSVERSION}
18+
ARG BASE_IMAGE=nanoserver:${OSVERSION}
1819
ARG REGISTRY=mcr.microsoft.com/windows
1920

2021
FROM ${REGISTRY}/${ADDON_IMAGE} AS addon

test/e2e/suite_test.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,25 @@ var _ = ginkgo.BeforeSuite(func() {
161161
err := os.Chdir("test/e2e")
162162
gomega.Expect(err).NotTo(gomega.HaveOccurred())
163163
}()
164+
165+
getSMBPublicIPScript := "test/utils/get_smb_svc_public_ip.sh"
166+
log.Printf("run script: %s\n", getSMBPublicIPScript)
167+
168+
cmd := exec.Command("bash", getSMBPublicIPScript)
169+
output, err := cmd.CombinedOutput()
170+
log.Printf("got output: %v, error: %v\n", string(output), err)
171+
gomega.Expect(err).NotTo(gomega.HaveOccurred())
172+
173+
smbPublicIP := strings.TrimSuffix(string(output), "\n")
174+
source := fmt.Sprintf("//%s/share", smbPublicIP)
175+
176+
log.Printf("use source on Windows: %v\n", source)
177+
defaultStorageClassParameters["source"] = source
178+
retainStorageClassParameters["source"] = source
179+
archiveStorageClassParameters["source"] = source
180+
archiveSubDirStorageClassParameters["source"] = source
181+
subDirStorageClassParameters["source"] = source
182+
noProvisionerSecretStorageClassParameters["source"] = source
164183
}
165184
})
166185

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
3+
# Copyright 2020 The Kubernetes Authors.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
set -e
18+
kubectl get svc smb-server -n default | grep smb | awk '{print $4}'

test/utils/smb_log.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,11 @@ kubectl get pods -n${NS} -l${LABEL} \
6666
| awk 'NR>1 {print $1}' \
6767
| xargs -I {} kubectl logs {} --prefix -c${CONTAINER} -n${NS}
6868

69+
echo "print out service logs ..."
70+
echo "======================================================================================"
71+
kubectl get service -A
72+
6973
echo "print out metrics ..."
7074
echo "======================================================================================"
71-
ip=`kubectl get svc csi-$DRIVER-controller -n kube-system | awk '{print $4}'`
75+
ip=`kubectl get svc csi-$DRIVER-controller -n kube-system --no-headers | awk '{print $4}'`
7276
curl http://$ip:29644/metrics

0 commit comments

Comments
 (0)