Skip to content

Commit 5ae4083

Browse files
committed
fixed reference to box variable.
1 parent 08bdc69 commit 5ae4083

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

tests/test_idempotence.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# - PLAYBOOK : the path to the Ansible playbook.
1313
#
1414
# from <playbook_name>.sh
15-
# - box : the name of the vagrant box
15+
# - BOX : the name of the vagrant box
1616
#
1717
# optional variables:
1818
#
@@ -31,10 +31,10 @@ RED='\033[0;31m'
3131
# SGR code to set text color (foreground) to no color.
3232
NC='\033[0m'
3333
# the logfile to hold the output of the playbook run
34-
LOGFILE="log/${box}_${VIRTUALENV_NAME}.log"
34+
LOGFILE="log/${BOX}_${VIRTUALENV_NAME}.log"
3535

36-
echo "[INFO] ${VIRTUALENV_NAME} running idempotence test..."
37-
ansible-playbook -i ${INVENTORY} --limit ${box} ${PLAYBOOK} 2>&1 | tee ${LOGFILE} | \
38-
grep "${box}" | grep -q "${PASS_CRITERIA}" && \
39-
echo -ne "[TEST] ${box} ${VIRTUALENV_NAME} idempotence : ${GREEN}PASS${NC}\n" || \
40-
(echo -ne "[TEST] ${box} ${VIRTUALENV_NAME} idempotence : ${RED}FAILED${NC} ${PASS_CRITERIA}\n" && exit 1)
36+
echo "[INFO] #{BOX} ${VIRTUALENV_NAME} running idempotence test..."
37+
ansible-playbook -i ${INVENTORY} --limit ${BOX} ${PLAYBOOK} 2>&1 | tee ${LOGFILE} | \
38+
grep "${BOX}" | grep -q "${PASS_CRITERIA}" && \
39+
echo -ne "[TEST] ${BOX} ${VIRTUALENV_NAME} idempotence : ${GREEN}PASS${NC}\n" || \
40+
(echo -ne "[TEST] ${BOX} ${VIRTUALENV_NAME} idempotence : ${RED}FAILED${NC} ${PASS_CRITERIA}\n" && exit 1)

tests/vagrant.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,18 +80,18 @@ source ${VIRTUALENV}/bin/activate
8080
# force Ansible to ask for sudo password when running tests against Vagrant
8181
export ANSIBLE_ASK_SUDO_PASS=True
8282

83-
for box in `grep vagrant.dev group_vars/all.yml | sed 's/://g'`
83+
for BOX in `grep vagrant.dev group_vars/all.yml | sed 's/://g'`
8484
do
8585

8686
echo "[INFO] preparing ${box}..."
87-
vagrant up ${box} 2> /dev/null
87+
vagrant up ${BOX} 2> /dev/null
8888
if [ $? -ne 0 ]; then
8989
# box not enabled
9090
continue
9191
fi
9292

9393
. test_idempotence.sh
9494

95-
echo "[INFO] destroying ${box}..."
96-
vagrant destroy -f $box
95+
echo "[INFO] destroying ${BOX}..."
96+
vagrant destroy -f ${BOX}
9797
done

0 commit comments

Comments
 (0)