summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorblsaws <bryan.sullivan@att.com>2016-05-22 21:25:38 -0700
committerblsaws <bryan.sullivan@att.com>2016-05-22 21:25:38 -0700
commit28d9889c0552554bcd60a253b144b13cecfdca3d (patch)
tree3dd07ec278735787a31fe708fe45ce7a7d4a7257
parentdb5e7aa499e6e6a353c57a2d7e5c044152f3328b (diff)
Fix mode bugs found in testing again on Centos.
JIRA: COPPER-4 Change-Id: I1629ad60e990f9909c0ca08d2d7367b5e5abb1cc Signed-off-by: blsaws <bryan.sullivan@att.com>
-rw-r--r--components/congress/test-webapp/setup/install_congress_testserver.sh12
-rw-r--r--components/congress/test-webapp/www/proxy/index.php2
-rwxr-xr-xtests/run.sh14
3 files changed, 16 insertions, 12 deletions
diff --git a/components/congress/test-webapp/setup/install_congress_testserver.sh b/components/congress/test-webapp/setup/install_congress_testserver.sh
index 9db8167..4b4cd90 100644
--- a/components/congress/test-webapp/setup/install_congress_testserver.sh
+++ b/components/congress/test-webapp/setup/install_congress_testserver.sh
@@ -35,6 +35,8 @@ if [ $# -eq 1 ]; then cubranch=$1; fi
echo "Install prerequisites"
dist=`grep DISTRIB_ID /etc/*-release | awk -F '=' '{print $2}'`
+if [ ! -d /tmp/copper ]; then mkdir /tmp/copper; fi
+
if [ "$dist" == "Ubuntu" ]; then
# Docker setup procedure from https://docs.docker.com/engine/installation/linux/ubuntulinux/
echo "Install docker and prerequisites"
@@ -49,7 +51,7 @@ EOF
apt-cache policy docker-engine
sudo apt-get install -y linux-image-extra-$(uname -r)
sudo apt-get install -y docker docker-engine
- echo "Copy copper environment files"
+ echo "Copy copper environment files"
cp ~/congress/env.sh /tmp/copper/
cp ~/congress/admin-openrc.sh /tmp/copper/
else
@@ -66,8 +68,7 @@ EOF
fi
echo "Clone copper"
-if [ ! -d /tmp/copper ]; then
- mkdir /tmp/copper
+if [ ! -d /tmp/copper/copper ]; then
cd /tmp/copper
git clone https://gerrit.opnfv.org/gerrit/copper
cd copper
@@ -82,7 +83,10 @@ echo "Setup copper environment"
source /tmp/copper/env.sh
echo "Setup webapp files"
-if [ ! -d /tmp/copper/log ]; then mkdir /tmp/copper/log; fi
+if [ ! -d /tmp/copper/log ]; then
+ mkdir /tmp/copper/log
+ chmod 777 /tmp/copper/log
+fi
source /tmp/copper/env.sh
echo "Point proxy.php to the Congress server"
sed -i -- "s/CONGRESS_HOST/$CONGRESS_HOST/g" /tmp/copper/copper/components/congress/test-webapp/www/proxy/index.php
diff --git a/components/congress/test-webapp/www/proxy/index.php b/components/congress/test-webapp/www/proxy/index.php
index 8a2833a..5beece5 100644
--- a/components/congress/test-webapp/www/proxy/index.php
+++ b/components/congress/test-webapp/www/proxy/index.php
@@ -23,7 +23,7 @@ if ($method == 'OPTIONS') {
exit();
}
-$url = "http://192.168.10.117:1789".$_GET['~url'];
+$url = "http://CONGRESS_HOST:1789".$_GET['~url'];
$curlop = curl_init();
curl_setopt($curlop, CURLOPT_URL, $url);
curl_setopt($curlop, CURLOPT_CUSTOMREQUEST, $method);
diff --git a/tests/run.sh b/tests/run.sh
index a1c31a4..45f157f 100755
--- a/tests/run.sh
+++ b/tests/run.sh
@@ -21,7 +21,7 @@
# - Congress installed through install_congress_1.sh
# - Copper test environment installed per
# How to use:
-# $ source install_congress_testserver_1.sh
+# $ bash install_congress_testserver_1.sh
#
start=`date +%s`
@@ -29,26 +29,26 @@ start=`date +%s`
echo "============"
echo "Test: dmz.sh"
echo "============"
-sh dmz.sh
+bash dmz.sh
if (($? == 0)); then dmz="Passed"
else dmz="Failed"; fi
-sh dmz-clean.sh
+bash dmz-clean.sh
echo "========================"
echo "Test: reserved_subnet.sh"
echo "========================"
-sh reserved_subnet.sh
+bash reserved_subnet.sh
if (($? == 0)); then reserved_subnet="Passed"
else reserved_subnet="Failed"; fi
-sh reserved_subnet-clean.sh
+bash reserved_subnet-clean.sh
echo "====================="
echo "Test: smtp_ingress.sh"
echo "====================="
-sh smtp_ingress.sh
+bash smtp_ingress.sh
if (($? == 0)); then smtp_ingress="Passed"
else smtp_ingress="Failed"; fi
-sh smtp_ingress-clean.sh
+bash smtp_ingress-clean.sh
end=`date +%s`
runtime=$((end-start))