Skip to content

Commit 5516a66

Browse files
committed
test: fix external test failures
1 parent acf65c7 commit 5516a66

File tree

6 files changed

+27
-20
lines changed

6 files changed

+27
-20
lines changed

hack/verify-examples.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,6 @@ EXAMPLES=(\
4242
deploy/example/deployment.yaml \
4343
deploy/example/statefulset.yaml \
4444
deploy/example/statefulset-nonroot.yaml \
45-
deploy/example/deployment-nfs.yaml \
46-
deploy/example/statefulset-nfs.yaml \
47-
deploy/example/statefulset-nonroot-nfs.yaml \
4845
)
4946

5047
for EXAMPLE in "${EXAMPLES[@]}"; do

test/e2e/suite_test.go

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,11 @@ var blobDriver *blob.Driver
5555
var projectRoot string
5656

5757
type testCmd struct {
58-
command string
59-
args []string
60-
startLog string
61-
endLog string
58+
command string
59+
args []string
60+
startLog string
61+
endLog string
62+
ignoreError bool
6263
}
6364

6465
func TestMain(m *testing.M) {
@@ -160,10 +161,11 @@ var _ = ginkgo.SynchronizedBeforeSuite(func(ctx ginkgo.SpecContext) []byte {
160161
var _ = ginkgo.SynchronizedAfterSuite(func(ctx ginkgo.SpecContext) {},
161162
func(ctx ginkgo.SpecContext) {
162163
blobLog := testCmd{
163-
command: "bash",
164-
args: []string{"test/utils/blob_log.sh"},
165-
startLog: "==============start blob log(after suite)===================",
166-
endLog: "==============end blob log(after suite)===================",
164+
command: "bash",
165+
args: []string{"test/utils/blob_log.sh"},
166+
startLog: "==============start blob log(after suite)===================",
167+
endLog: "==============end blob log(after suite)===================",
168+
ignoreError: true,
167169
}
168170
e2eTeardown := testCmd{
169171
command: "make",
@@ -206,6 +208,9 @@ func execTestCmd(cmds []testCmd) {
206208
err := cmdSh.Run()
207209
if err != nil {
208210
log.Printf("Failed to run command: %s %s, Error: %s\n", cmd.command, strings.Join(cmd.args, " "), err.Error())
211+
if !cmd.ignoreError {
212+
gomega.Expect(err).NotTo(gomega.HaveOccurred())
213+
}
209214
}
210215
gomega.Expect(err).NotTo(gomega.HaveOccurred())
211216
log.Println(cmd.endLog)

test/external-e2e/run.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
set -xe
1818

1919
PROJECT_ROOT=$(git rev-parse --show-toplevel)
20-
DRIVER="test"
20+
DRIVER="blob"
2121

2222
setup_e2e_binaries() {
2323
# download k8s external e2e binary

test/external-e2e/testdriver-blobfuse.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ ShortName: blobfuse
55
StorageClass:
66
FromFile: /tmp/csi/storageclass.yaml
77
DriverInfo:
8-
Name: test.csi.azure.com
8+
Name: blob.csi.azure.com
99
Capabilities:
1010
persistence: true
1111
exec: true

test/external-e2e/testdriver-nfs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ ShortName: blobfuse
55
StorageClass:
66
FromFile: /tmp/csi/storageclass.yaml
77
DriverInfo:
8-
Name: test.csi.azure.com
8+
Name: blob.csi.azure.com
99
Capabilities:
1010
persistence: true
1111
exec: true

test/utils/blob_log.sh

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17-
set -e
17+
# set -e
1818

1919
NS=kube-system
2020
CONTAINER=blob
@@ -49,11 +49,6 @@ kubectl get pods -n${NS} -l${LABEL} \
4949
| awk 'NR>1 {print $1}' \
5050
| xargs -I {} kubectl logs {} --prefix -c${CONTAINER} -n${NS}
5151

52-
echo "print out cloudprovider_azure metrics ..."
53-
echo "======================================================================================"
54-
ip=`kubectl get svc csi-$DRIVER-controller -n kube-system | awk '{print $4}'`
55-
curl http://$ip:29634/metrics
56-
5752
if [ -n "$ENABLE_BLOBFUSE_PROXY" ]; then
5853
echo "print out install-blobfuse-proxy logs ..."
5954
echo "======================================================================================"
@@ -64,4 +59,14 @@ if [ -n "$ENABLE_BLOBFUSE_PROXY" ]; then
6459
| xargs -I {} kubectl logs {} --prefix -c${PROXY} -n${NS}
6560
fi
6661

62+
echo "======================================================================================"
63+
ip=`kubectl get svc csi-$DRIVER-controller -n kube-system | awk '{print $4}'`
64+
if echo "$ip" | grep -q "\."; then
65+
echo "print out cloudprovider_azure metrics ..."
66+
curl http://$ip:29634/metrics
67+
else
68+
echo "csi-$DRIVER-controller service ip is empty"
69+
kubectl get svc csi-$DRIVER-controller -n kube-system
70+
fi
71+
6772

0 commit comments

Comments
 (0)