Skip to content

Commit 4b68001

Browse files
committed
test: switch to use mcr nginx image
1 parent ca5f7e2 commit 4b68001

File tree

6 files changed

+25
-3
lines changed

6 files changed

+25
-3
lines changed

Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,3 +166,10 @@ endif
166166
.PHONY: create-metrics-svc
167167
create-metrics-svc:
168168
kubectl create -f deploy/example/metrics/csi-smb-controller-svc.yaml
169+
170+
.PHONY: create-example-deployment
171+
create-example-deployment:
172+
kubectl apply -f deploy/example/storageclass-smb.yaml
173+
kubectl apply -f deploy/example/pvc-smb.yaml
174+
kubectl apply -f deploy/example/deployment.yaml
175+
kubectl apply -f deploy/example/statefulset.yaml

deploy/example/deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ spec:
2020
"kubernetes.io/os": linux
2121
containers:
2222
- name: deployment-smb
23-
image: nginx
23+
image: mcr.microsoft.com/oss/nginx/nginx:1.17.3-alpine
2424
command:
2525
- "/bin/sh"
2626
- "-c"

deploy/example/nginx-pod-smb.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ metadata:
55
name: nginx-smb
66
spec:
77
containers:
8-
- image: nginx
8+
- image: mcr.microsoft.com/oss/nginx/nginx:1.17.3-alpine
99
name: nginx-smb
1010
command:
1111
- "/bin/sh"

deploy/example/statefulset.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ spec:
1717
"kubernetes.io/os": linux
1818
containers:
1919
- name: statefulset-smb
20-
image: nginx
20+
image: mcr.microsoft.com/oss/nginx/nginx:1.17.3-alpine
2121
command:
2222
- "/bin/sh"
2323
- "-c"

test/e2e/suite_test.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import (
2626
"path/filepath"
2727
"strings"
2828
"testing"
29+
"time"
2930

3031
"github.com/kubernetes-csi/csi-driver-smb/pkg/smb"
3132
"github.com/kubernetes-csi/csi-driver-smb/test/utils/testutil"
@@ -138,6 +139,16 @@ var _ = ginkgo.BeforeSuite(func() {
138139

139140
var _ = ginkgo.AfterSuite(func() {
140141
if testutil.IsRunningInProw() {
142+
createExampleDeployment := testCmd{
143+
command: "make",
144+
args: []string{"create-example-deployment"},
145+
startLog: "create example deployments",
146+
endLog: "example deployments created",
147+
}
148+
execTestCmd([]testCmd{createExampleDeployment})
149+
// sleep 120s waiting for deployment running complete
150+
time.Sleep(120 * time.Second)
151+
141152
smbLog := testCmd{
142153
command: "bash",
143154
args: []string{"test/utils/smb_log.sh"},

test/utils/smb_log.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ echo "print out all nodes status ..."
2323
kubectl get nodes -o wide
2424
echo "======================================================================================"
2525

26+
echo "print out all default namespace pods status ..."
27+
kubectl get pods -n default -o wide
28+
echo "======================================================================================"
29+
2630
echo "print out all $NS namespace pods status ..."
2731
kubectl get pods -n${NS} -o wide
2832
echo "======================================================================================"

0 commit comments

Comments
 (0)