File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change 11#! /bin/bash
22
3- set -euo pipefail
3+ set -eo pipefail
44
55export NOMAD_VERSION=0.11.2
66export CONTAINERD_VERSION=1.3.4
@@ -18,6 +18,7 @@ PASS_STATUS=0
1818# Please don't run these tests (./run_tests.sh) on your local host, as these are meant to be
1919# destructive and can modify (or destroy) software on your host system.
2020main () {
21+ warn_on_local_host
2122 setup
2223 echo " INFO: Checking if nomad-driver-containerd is up and running, and nomad is ready to accept jobs."
2324 is_containerd_driver_active
@@ -52,6 +53,20 @@ run_tests() {
5253 done
5354}
5455
56+ warn_on_local_host () {
57+ if [[ -z " $CIRCLECI " || " $CIRCLECI " != " true" ]]; then
58+ echo " WARNING: Local host detected."
59+ echo " WARNING: These tests are designed to be run as part of continous integration (CI) and not recommended to be run on local host."
60+ echo " WARNING: These tests are destructive and can modify (or destroy) software on your host system."
61+ read -p " Do you still want to run the tests (Y/N)? " -n 1 -r
62+ echo
63+ if [[ ! $REPLY =~ ^[Yy]$ ]]; then
64+ echo " Right choice! Aborting..."
65+ exit 0
66+ fi
67+ fi
68+ }
69+
5570setup () {
5671 sudo systemctl stop apt-daily-upgrade apt-daily > /dev/null 2>&1
5772
You can’t perform that action at this time.
0 commit comments