Skip to content

Commit 885134a

Browse files
committed
fixes
1 parent ce684b3 commit 885134a

File tree

3 files changed

+40
-3
lines changed

3 files changed

+40
-3
lines changed

Vagrantfile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# -*- mode: ruby -*-
22
# vi: set ft=ruby :
33

4-
load '../common/timestamp-appender.rb'
5-
64
Vagrant.configure("2") do |config|
75
config.vm.box = "ubuntu/bionic64"
86

test-library.sh

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/bin/bash
2+
3+
checkPlaybookSyntax()
4+
{
5+
PLAYBOOK_FILE=$1
6+
INVENTORY_FILE=$2
7+
if [ "x$INVENTORY_FILE" == "x" ]; then
8+
ansible-playbook $PLAYBOOK_FILE --syntax-check
9+
else
10+
ansible-playbook $PLAYBOOK_FILE -i $INVENTORY_FILE --syntax-check
11+
fi
12+
if [ $? -ne 0 ]; then
13+
echo "Syntax error in $PLAYBOOK_FILE"
14+
teardown
15+
exit 1
16+
fi
17+
echo "$PLAYBOOK_FILE syntax is OK"
18+
}
19+
20+
assertEquals()
21+
{
22+
EXPECTED=$1
23+
ACTUAL=$2
24+
if [ "$ACTUAL" != "$EXPECTED" ]; then
25+
echo "Assertion error: $EXPECTED expected, but $ACTUAL gotten"
26+
teardown
27+
exit 1
28+
fi
29+
}
30+
31+
assertFileExists()
32+
{
33+
FILE_PATH=$1
34+
if [ ! -f $FILE_PATH ]; then
35+
echo "The file $FILE_PATH does not exist"
36+
teardown
37+
exit 1
38+
fi
39+
}

test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ teardown()
77
rm -rf .vagrant/ *.retry "$tmpfile" ubuntu-*-cloudimg-console.log
88
}
99

10-
. ../common/test-library.sh
10+
. test-library.sh
1111

1212
# turn on the environment
1313
vagrant up

0 commit comments

Comments
 (0)