[libgda] Added the setup-test-servers-env.sh
- From: Vivien Malerba <vivien src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgda] Added the setup-test-servers-env.sh
- Date: Sun, 27 Sep 2015 19:21:10 +0000 (UTC)
commit 1b58db7c1cabbd4eb72bea0d5f80462d76ea40d9
Author: Vivien Malerba <malerba gnome-db org>
Date: Sun Sep 27 21:20:35 2015 +0200
Added the setup-test-servers-env.sh
setup-test-servers-env.sh | 74 +++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 74 insertions(+), 0 deletions(-)
---
diff --git a/setup-test-servers-env.sh b/setup-test-servers-env.sh
new file mode 100755
index 0000000..140951e
--- /dev/null
+++ b/setup-test-servers-env.sh
@@ -0,0 +1,74 @@
+#!/bin/bash
+
+#
+# This script starts all the test servers which are present as Docker images (see
+# docker-tools/ directory for more details), sets up some environment variables, and
+# starts a sub shell.
+#
+# When the sub shell exits, all the docker containers which have been started are stopped.
+#
+
+dir=`dirname $0`
+envfile=test-servers-env
+
+function control_servers {
+ op=$1
+ case $op in
+ start)
+ ;;
+ stop)
+ ;;
+ *)
+ echo "Unknown operation."
+ exit 1
+ ;;
+ esac
+
+ for srv in Firebird Ldap MySQL Oracle PostgreSQL Web
+ do
+ echo -n "$srv..."
+ $dir/docker-tools/docker-tools.sh $op $srv > /dev/null 2>&1
+ if [ $? != 0 ]
+ then
+ echo "Failure!"
+ else
+ echo "Ok!"
+ uppername=${srv^^}
+ if [ $srv == "Oracle" ]
+ then
+ dbname="xe"
+ else
+ dbname="gda"
+ if [ $op == "start" ]
+ then
+ echo "export
${uppername}_DBCREATE_PARAMS=\"HOST=localhost;ADM_LOGIN=gdauser;ADM_PASSWORD=gdauser\"" >> $envfile
+ else
+ echo "export -n ${uppername}_DBCREATE_PARAMS=" >> $envfile
+ fi
+ fi
+
+ if [ $op == "start" ]
+ then
+ echo "export
${uppername}_CNC_PARAMS=\"HOST=localhost;USERNAME=gdauser;PASSWORD=gdauser;DB_NAME=$dbname\"" >> $envfile
+ else
+ echo "export -n ${uppername}_CNC_PARAMS=" >> $envfile
+ fi
+ fi
+ done
+}
+
+echo "Starting tests servers..."
+rm -f $envfile
+control_servers start
+. $envfile
+echo "Now entering sub shell. Closing this sub shell will stop all the test servers."
+echo "Environment variables are in the '$envfile' file"
+/bin/bash
+echo "Stopping tests servers..."
+rm -f $envfile
+control_servers stop
+. $envfile
+rm -f $envfile
+
+
+
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]