3
# Put some content there to check
4
juju ssh apache2/0 "sudo mkdir -p /var/www/html && echo 'Sample content' > index.html && sudo mv index.html /var/www/html"
6
APACHE=$(juju status --format=yaml apache2 2>&1 | sed -nr '/^ {8}public-address/s/.*://p')
8
if [ -z "${APACHE}" ]; then
9
echo "No apache2 instances"
13
for UNIT in ${APACHE}; do
15
echo "Calling unit to ensure it returns: Sample content"
16
echo 'curl -f -k -s -S -v https://'${UNIT}'/|grep Sample content'
17
curl -f -k -s -S -v https://${UNIT}/|grep "Sample content"
19
echo "####################"
20
echo "# E2E Check Failed #"
21
echo "####################"
26
# If we are here it means no checks failed
27
echo "####################"
28
echo "# E2E Check Passed #"
29
echo "####################"