Skip to content
This repository was archived by the owner on Oct 19, 2022. It is now read-only.

Commit 94afd32

Browse files
committed
refacto tests
Signed-off-by: Victor Vieux <[email protected]>
1 parent 83cf646 commit 94afd32

File tree

7 files changed

+17
-7
lines changed

7 files changed

+17
-7
lines changed

.travis.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
include:
77
- language: go
88
go: 1.8.x
9-
env: TESTFILE=unit.sh
9+
env: RULE=test-unit
1010
- language: go
1111
go: 1.9.x
12-
env: TESTFILE=unit.sh
12+
env: RULE=test-unit
1313
- language: go
1414
go: master
15-
env: TESTFILE=unit.sh
15+
env: RULE=test-unit
1616
- language: generic
1717
sudo: required
1818
services:
@@ -22,7 +22,7 @@
2222
- sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
2323
- sudo apt-get update
2424
- sudo apt-get -y install docker-ce
25-
env: TESTFILE=integration.sh
25+
env: RULE=test-integration
2626

2727
script:
28-
- ./.travis/$TESTFILE
28+
- make $RULE

Makefile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,13 @@ enable:
3131
push: clean rootfs create enable
3232
@echo "### push plugin ${PLUGIN_NAME}:${PLUGIN_TAG}"
3333
@docker plugin push ${PLUGIN_NAME}:${PLUGIN_TAG}
34+
35+
test: test-unit test-integration
36+
37+
test-unit:
38+
@echo "### unit tests"
39+
./tests/unit.sh
40+
41+
test-integration:
42+
@echo "### integration tests"
43+
./tests/integration.sh

.travis/integration.sh renamed to tests/integration.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ TAG=test
1515
sudo docker pull rastasheep/ubuntu-sshd
1616
sudo docker pull busybox
1717

18-
docker build -t sshd .travis/ssh
18+
docker build -t sshd tests/testdata
1919
#script
2020

2121
# make the plugin
@@ -60,7 +60,7 @@ sudo docker volume rm sshvolume
6060

6161
# test5: ssh key
6262
sudo docker plugin disable vieux/sshfs:$TAG
63-
sudo docker plugin set vieux/sshfs:$TAG sshkey.source=`pwd`/.travis/ssh/
63+
sudo docker plugin set vieux/sshfs:$TAG sshkey.source=`pwd`/test/testdata/
6464
sudo docker plugin enable vieux/sshfs:$TAG
6565
sudo docker volume create -d vieux/sshfs:$TAG -o sshcmd=root@localhost:/ -o port=2222 sshvolume
6666
sudo docker run --rm -v sshvolume:/write busybox sh -c "echo hello > /write/world"
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)