Skip to content

Commit 8478510

Browse files
authored
Merge pull request #25 from lpabon/e2e
e2e: Add e2e test to csi-sanity
2 parents 433fb6f + faefe12 commit 8478510

File tree

4 files changed

+31
-82
lines changed

4 files changed

+31
-82
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ script:
99
- go fmt $(go list ./... | grep -v vendor) | wc -l | grep 0
1010
- go vet $(go list ./... | grep -v vendor)
1111
- go test $(go list ./... | grep -v vendor | grep -v "cmd/csi-sanity")
12+
- ./hack/e2e.sh

cmd/csi-sanity/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ all: $(APP_NAME)
2424
$(APP_NAME): Makefile sanity_test.go
2525
go test $(LDFLAGS) -c -o $(APP_NAME)
2626

27+
install: $(APP_NAME)
28+
cp $(APP_NAME) $(GOPATH)/bin
29+
2730
clean:
2831
rm -f csi-sanity
2932
rm -rf $(DIR)/dist

hack/e2e.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/bin/bash
2+
3+
CSI_ENDPOINTS="tcp://127.0.0.1:9998"
4+
#CSI_ENDPOINTS="$CSI_ENDPOINTS /tmp/csi.sock"
5+
#CSI_ENDPOINTS="$CSI_ENDPOINTS unix:///tmp/csi.sock"
6+
7+
if [ ! -x $GOPATH/bin/mock ] ; then
8+
go get -u github.com/thecodeteam/gocsi/mock
9+
fi
10+
11+
cd cmd/csi-sanity
12+
make clean install || exit 1
13+
cd ../..
14+
15+
for endpoint in $CSI_ENDPOINTS ; do
16+
CSI_ENDPOINT=$endpoint mock &
17+
pid=$!
18+
19+
csi-sanity --csi.endpoint=$endpoint ; ret=$?
20+
kill -9 $pid
21+
22+
if [ $ret -ne 0 ] ; then
23+
exit $ret
24+
fi
25+
done
26+
27+
exit 0

pkg/sanity/sanity_test.go

Lines changed: 0 additions & 82 deletions
This file was deleted.

0 commit comments

Comments
 (0)