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

Commit 93806d8

Browse files
author
Dongsu Park
committed
scripts: add a new script for running smoke tests
The script `test-smoke.sh` launches a Vagrant VM based on Fedora 26, to run smoke tests inside the VM for each build.
1 parent 114392b commit 93806d8

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

scripts/test-smoke.sh

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#!/bin/bash
2+
3+
# Script to test kube-spawn
4+
5+
set -eux
6+
set -o pipefail
7+
8+
CDIR=$(cd "$(dirname "$0")" && pwd)
9+
pushd "$CDIR"
10+
trap 'popd' EXIT
11+
12+
if ! vagrant version > /dev/null 2>&1; then
13+
echo "Please install vagrant first"
14+
exit 1
15+
fi
16+
17+
MSTATUS="$(vagrant status fedora |grep fedora|awk -F' ' '{print $2}')"
18+
if [[ "${MSTATUS}" == "running" ]]; then
19+
vagrant halt fedora
20+
fi
21+
22+
vagrant up fedora --provider=virtualbox
23+
24+
vagrant ssh fedora -c " \
25+
sudo setenforce 0; \
26+
go get -u github.com/containernetworking/plugins/plugins/... && \
27+
cd ~/go/src/github.com/kinvolk/kube-spawn && \
28+
make dep vendor all && \
29+
sudo -E go test -v --tags integration ./tests \
30+
"
31+
RESCODE=$?
32+
if [[ "${RESCODE}" -eq 0 ]]; then
33+
RES="SUCCESS"
34+
else
35+
RES="FAILURE"
36+
fi
37+
38+
echo "Test result: ${RES}"
39+
40+
trap 'vagrant halt fedora' EXIT

0 commit comments

Comments
 (0)