Skip to content

Commit

Permalink
CI: Updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
shishir-a412ed committed May 27, 2020
1 parent b833d7e commit fc082a3
Showing 1 changed file with 21 additions and 6 deletions.
27 changes: 21 additions & 6 deletions tests/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,34 @@ main() {
echo "Starting setup."
setup
echo "Setup finished successfully."
sleep 10s
echo "Checking if nomad-driver-containerd is up and running, and nomad is ready to accept jobs."
while true
do
set +e
status=$(curl -s http://127.0.0.1:4646/v1/nodes|jq '.[0] ."Drivers" ."containerd-driver" ."Healthy"')
rc=$?
set -e
if [[ $rc -eq 0 && $status = "true" ]]; then
echo "nomad is up and running"
break
fi
echo "nomad is down, wait for 5 seconds."
sleep 5s
done
cd ~/go/src/github.com/Roblox/nomad-driver-containerd/example
echo "Starting nomad redis job using nomad-driver-containerd."
nomad job run example.nomad
echo "Starting nomad signal handler job using nomad-driver-containerd."
nomad job run signal.nomad
echo "Sleep for 5 seconds, to allow nomad jobs to transition into running state."
sleep 5s
echo "Inspecting redis job."
nomad job inspect example
echo "Inspecting signal handler job."
nomad job inspect signal
echo "Stopping nomad redis job."
nomad job stop example
echo "Stopping nomad signal handler job."
nomad job stop signal
echo "Sleep for 5 seconds, to allow nomad jobs to shutdown completely."
echo "Sleep for 5 seconds, to allow nomad jobs to shutdown gracefully."
sleep 5s
echo "Tests finished successfully."
}
Expand Down Expand Up @@ -74,7 +89,7 @@ setup() {
cat << EOF > nomad.service
# /lib/systemd/system/nomad.service
[Unit]
Description=nomad server + nomad-driver-containerd
Description=nomad server (dev) + nomad-driver-containerd
Documentation=https://nomadproject.io
After=network.target
Expand All @@ -97,7 +112,7 @@ EOF
while true
do
if (systemctl -q is-active "nomad.service"); then
echo "nomad is up and running"
echo "systemd nomad.service is up and running"
break
fi
done
Expand Down

0 comments on commit fc082a3

Please sign in to comment.