+++ /dev/null
-#!/bin/bash -x
-
-RES=0
-DISTR='undefined'
-
-get_distr_name() {
-egrep -qi 'centos|redhat' /etc/*-release && DISTR='CentOS'
-grep -qi 'ubuntu' /etc/*-release && DISTR='Ubuntu'
-}
-
-case $1 in
- openstack-dashboard|openstack-dashboard-apache)
- get_distr_name
-
- if [ "$DISTR" = "Ubuntu" ] && [ "$1" = "openstack-dashboard" ]; then
- echo 'Test is not defined.'
- exit 0
- fi
-
- if [ "$DISTR" = "Ubuntu" ] || [ "$DISTR" = "Debian" ] ; then
- apache="apache2"
- elif [ "$DISTR" = "CentOS" ]; then
- apache="httpd"
- chown -R apache:apache /usr/share/openstack-dashboard
- sed -i "s/LOCAL_PATH = .*/LOCAL_PATH = '\/tmp'/g" /etc/openstack-dashboard/local_settings
- sed -i 's/ALLOWED_HOSTS.*/ALLOWED_HOSTS = ["127.0.0.1"]/' /etc/openstack-dashboard/local_settings
- else
- echo "Cant identify distr. Check me."
- exit 1
- fi
-
- service $apache restart
- if [ "$DISTR" = "Ubuntu" ] || [ "$DISTR" = "Debian" ] ; then
- # Disabled due to changes in postinstall scripts.
- #curl http://127.0.0.1/horizon/auth/login/ 2>&1 | grep '<title>Login - OpenStack Dashboard</title>'
- echo 'Enable sites manually.'
- elif [ "$DISTR" = "CentOS" ]; then
- curl http://127.0.0.1/dashboard/auth/login/ 2>&1 | grep '<title>Login - OpenStack Dashboard</title>'
- else
- echo "Cant identify distr. Check me."
- exit 1
- fi
- RES=$?
- ;;
- python-django-horizon)
- python -c "import horizon"
- RES=$?
- ;;
- *)
- echo "test not defined, skipping..."
- ;;
-esac
-
-exit $RES