mirror of
https://git.icinga.com/packaging/rpm-icingaweb2.git
synced 2025-09-25 11:08:11 +02:00
Update test scripts
This commit is contained in:
parent
64dfb36ec0
commit
ee7a9c669f
@ -1,28 +1,42 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
# this script runs in the rpm_test environment
|
||||||
|
|
||||||
sudo yum install -y createrepo
|
install_package icingaweb2
|
||||||
|
|
||||||
createrepo $WORKSPACE/archive
|
if [ -x /usr/sbin/apachectl ]; then
|
||||||
|
apache_command="apachectl start"
|
||||||
|
else
|
||||||
|
echo "Can not detect how to start Apache!" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
sudo -E su -c "cat << EOF > /etc/yum.repos.d/local.repo
|
echo "Starting Apache httpd..."
|
||||||
[local]
|
if ! sudo $apache_command; then
|
||||||
name=Nyarlathotep
|
echo "Failed to start httpd..." >&2
|
||||||
baseurl=file://$WORKSPACE/archive
|
exit 1
|
||||||
enabled=1
|
fi
|
||||||
gpgcheck=0
|
|
||||||
EOF"
|
|
||||||
|
|
||||||
sudo yum update -y
|
|
||||||
sudo yum install -y icingaweb2
|
|
||||||
|
|
||||||
sudo apache2ctl start || sudo apachectl start || sudo /sbin/service httpd start || echo "Failed to start apache" && false
|
|
||||||
sleep 5
|
sleep 5
|
||||||
|
|
||||||
RSTATUS=$(curl -s -w %{http_code} http://localhost/icingaweb2/authentication/login -o /dev/null)
|
output=`mktemp`
|
||||||
if [ "200" != "$RSTATUS" ]; then
|
|
||||||
echo "Http exit code was not ok!"
|
if curl -v http://localhost/icingaweb2/authentication/login -o "$output"; then
|
||||||
exit 1
|
if grep -q '<div id="login"' "$output"; then
|
||||||
else
|
echo "Login page available"
|
||||||
echo "All's well!"
|
|
||||||
exit 0
|
exit 0
|
||||||
|
else
|
||||||
|
echo "Didn't get a logon page from the webserver!"
|
||||||
|
echo
|
||||||
|
echo "Output of the page is:"
|
||||||
|
echo "====================================="
|
||||||
|
cat "$output"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "Request for login page failed!"
|
||||||
|
echo
|
||||||
|
echo "Output of the page is:"
|
||||||
|
echo "====================================="
|
||||||
|
cat "$output"
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user