Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavomcarmo committed Jul 18, 2019
1 parent ce684b3 commit 885134a
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 3 deletions.
2 changes: 0 additions & 2 deletions Vagrantfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :

load '../common/timestamp-appender.rb'

Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/bionic64"

Expand Down
39 changes: 39 additions & 0 deletions test-library.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/bash

checkPlaybookSyntax()
{
PLAYBOOK_FILE=$1
INVENTORY_FILE=$2
if [ "x$INVENTORY_FILE" == "x" ]; then
ansible-playbook $PLAYBOOK_FILE --syntax-check
else
ansible-playbook $PLAYBOOK_FILE -i $INVENTORY_FILE --syntax-check
fi
if [ $? -ne 0 ]; then
echo "Syntax error in $PLAYBOOK_FILE"
teardown
exit 1
fi
echo "$PLAYBOOK_FILE syntax is OK"
}

assertEquals()
{
EXPECTED=$1
ACTUAL=$2
if [ "$ACTUAL" != "$EXPECTED" ]; then
echo "Assertion error: $EXPECTED expected, but $ACTUAL gotten"
teardown
exit 1
fi
}

assertFileExists()
{
FILE_PATH=$1
if [ ! -f $FILE_PATH ]; then
echo "The file $FILE_PATH does not exist"
teardown
exit 1
fi
}
2 changes: 1 addition & 1 deletion test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ teardown()
rm -rf .vagrant/ *.retry "$tmpfile" ubuntu-*-cloudimg-console.log
}

. ../common/test-library.sh
. test-library.sh

# turn on the environment
vagrant up
Expand Down

0 comments on commit 885134a

Please sign in to comment.