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

Commit

Permalink
scripts: add a new script for running smoke tests
Browse files Browse the repository at this point in the history
The script `test-smoke.sh` launches a Vagrant VM based on Fedora 26,
to run smoke tests inside the VM for each build.
  • Loading branch information
Dongsu Park committed Sep 24, 2017
1 parent 114392b commit 93806d8
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions scripts/test-smoke.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/bin/bash

# Script to test kube-spawn

set -eux
set -o pipefail

CDIR=$(cd "$(dirname "$0")" && pwd)
pushd "$CDIR"
trap 'popd' EXIT

if ! vagrant version > /dev/null 2>&1; then
echo "Please install vagrant first"
exit 1
fi

MSTATUS="$(vagrant status fedora |grep fedora|awk -F' ' '{print $2}')"
if [[ "${MSTATUS}" == "running" ]]; then
vagrant halt fedora
fi

vagrant up fedora --provider=virtualbox

vagrant ssh fedora -c " \
sudo setenforce 0; \
go get -u github.com/containernetworking/plugins/plugins/... && \
cd ~/go/src/github.com/kinvolk/kube-spawn && \
make dep vendor all && \
sudo -E go test -v --tags integration ./tests \
"
RESCODE=$?
if [[ "${RESCODE}" -eq 0 ]]; then
RES="SUCCESS"
else
RES="FAILURE"
fi

echo "Test result: ${RES}"

trap 'vagrant halt fedora' EXIT

0 comments on commit 93806d8

Please sign in to comment.