test: refactor verify example test
fix image
This commit is contained in:
parent
7271a3cc0f
commit
67218855ab
6
Makefile
6
Makefile
@ -120,9 +120,3 @@ e2e-teardown:
|
||||
.PHONY: e2e-test
|
||||
e2e-test:
|
||||
go test -v -timeout=0 ./test/e2e ${GINKGO_FLAGS}
|
||||
|
||||
.PHONY: create-example-deployment
|
||||
create-example-deployment:
|
||||
kubectl apply -f ./deploy/example/storageclass-nfs.yaml
|
||||
kubectl apply -f ./deploy/example/deployment.yaml
|
||||
kubectl apply -f ./deploy/example/statefulset.yaml
|
||||
|
||||
@ -30,7 +30,7 @@ spec:
|
||||
"kubernetes.io/os": linux
|
||||
containers:
|
||||
- name: deployment-nfs
|
||||
image: mcr.icrosoft.com/oss/nginx/nginx:1.19.5
|
||||
image: mcr.microsoft.com/oss/nginx/nginx:1.19.5
|
||||
command:
|
||||
- "/bin/bash"
|
||||
- "-c"
|
||||
|
||||
30
hack/verify-examples.sh
Executable file
30
hack/verify-examples.sh
Executable file
@ -0,0 +1,30 @@
|
||||
#!/bin/bash
|
||||
# Copyright 2020 The Kubernetes Authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
echo "begin to create deployment examples ..."
|
||||
|
||||
kubectl apply -f ./deploy/example/storageclass-nfs.yaml
|
||||
kubectl apply -f ./deploy/example/deployment.yaml
|
||||
kubectl apply -f ./deploy/example/statefulset.yaml
|
||||
|
||||
echo "sleep 60s ..."
|
||||
sleep 60
|
||||
|
||||
kubectl get pods --field-selector status.phase=Running | grep deployment-nfs
|
||||
kubectl get pods --field-selector status.phase=Running | grep statefulset-nfs-0
|
||||
|
||||
echo "deployment examples running completed."
|
||||
@ -26,8 +26,6 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"time"
|
||||
|
||||
"github.com/kubernetes-csi/csi-driver-nfs/pkg/nfs"
|
||||
"github.com/onsi/ginkgo"
|
||||
"github.com/onsi/gomega"
|
||||
@ -96,14 +94,12 @@ var _ = ginkgo.BeforeSuite(func() {
|
||||
|
||||
var _ = ginkgo.AfterSuite(func() {
|
||||
createExampleDeployment := testCmd{
|
||||
command: "make",
|
||||
args: []string{"create-example-deployment"},
|
||||
command: "bash",
|
||||
args: []string{"hack/verify-examples.sh"},
|
||||
startLog: "create example deployments",
|
||||
endLog: "example deployments created",
|
||||
}
|
||||
execTestCmd([]testCmd{createExampleDeployment})
|
||||
// sleep 120s waiting for deployment running complete
|
||||
time.Sleep(120 * time.Second)
|
||||
|
||||
nfsLog := testCmd{
|
||||
command: "bash",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user