Просмотр исходного кода

- openserdbctl test for dbtext
- openserctl test for mysql


git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@3090 689a6050-402a-0410-94f2-e92a70836424

Henning Westerholt 18 лет назад
Родитель
Сommit
b44252058e
3 измененных файлов с 62 добавлено и 1 удалено
  1. 1 1
      test/unit/3.sh
  2. 33 0
      test/unit/8.sh
  3. 28 0
      test/unit/9.sh

+ 1 - 1
test/unit/3.sh

@@ -1,5 +1,5 @@
 #!/bin/bash
-# creates a database with openserdbctl and deletes it again
+# creates a mysql database with openserdbctl and deletes it again
 
 # Needs a mysql database, the root user password must be given
 # in the file 'dbrootpw'

+ 33 - 0
test/unit/8.sh

@@ -0,0 +1,33 @@
+#!/bin/bash
+# creates a dbtext database with openserdbctl and deletes it again
+
+tmp_name=""$RANDOM"_openserdb_tmp"
+
+cd ../scripts
+
+# setup config file
+cp openserctlrc openserctlrc.bak
+sed -i "s/# SIP_DOMAIN=openser.org/SIP_DOMAIN=sip.localhost/g" openserctlrc
+sed -i "s/# DBENGINE=MYSQL/DBENGINE=DBTEXT/g" openserctlrc
+sed -i "s/# INSTALL_EXTRA_TABLES=ask/INSTALL_EXTRA_TABLES=yes/g" openserctlrc
+sed -i "s/# INSTALL_PRESENCE_TABLES=ask/INSTALL_PRESENCE_TABLES=yes/g" openserctlrc
+sed -i "s/# INSTALL_SERWEB_TABLES=ask/INSTALL_SERWEB_TABLES=yes/g" openserctlrc
+
+# set the mysql root password
+cp openserdbctl.mysql openserdbctl.mysql.bak
+sed -i "s/#PW=""/PW="$PW"/g" openserdbctl.mysql
+
+./openserdbctl create $tmp_name #> /dev/null
+ret=$?
+
+if [ "$ret" -eq 0 ] ; then
+	./openserdbctl drop $tmp_name #> /dev/null
+	ret=$?
+fi ;
+
+# cleanup
+mv openserctlrc.bak openserctlrc
+cp openserdbctl.mysql.bak openserdbctl.mysql
+
+cd ../test
+exit $ret

+ 28 - 0
test/unit/9.sh

@@ -0,0 +1,28 @@
+#!/bin/bash
+# test basic db related openserctl functionality for mysql
+
+cd ../scripts
+
+# setup config file
+cp openserctlrc openserctlrc.bak
+sed -i "s/# DBENGINE=MYSQL/DBENGINE=MYSQL/g" openserctlrc
+
+./openserctl avp list > /dev/null
+
+ret=$?
+
+if [ "$ret" -eq 0 ] ; then
+	./openserctl domain showdb > /dev/null
+	ret=$?
+fi ;
+
+if [ "$ret" -eq 0 ] ; then
+	./openserctl lcr show > /dev/null
+	ret=$?
+fi ;
+
+# cleanup
+mv openserctlrc.bak openserctlrc
+
+cd ../test
+exit $ret