[sr-dev] git:master: test/unit: 3.sh is back in working stage
Daniel-Constantin Mierla
miconda at gmail.com
Wed Oct 1 14:52:22 CEST 2014
Module: sip-router
Branch: master
Commit: 2b21542f93740508e334605551fe4332eec7db11
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=2b21542f93740508e334605551fe4332eec7db11
Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: Wed Oct 1 14:51:07 2014 +0200
test/unit: 3.sh is back in working stage
- used for testing creating database structure with latin1 charset
---
test/unit/3.sh | 17 ++++++++++-------
1 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/test/unit/3.sh b/test/unit/3.sh
index e0bcb7f..9578c01 100755
--- a/test/unit/3.sh
+++ b/test/unit/3.sh
@@ -22,6 +22,8 @@
# Needs a mysql database, the root user password must be assigned to
# the 'PW' variable in the file 'dbrootpw' in the test directory, e.g.:
# PW=sql_root_passwd
+# If MySQL root password is empty, add in the file the line:
+# PWSKIP=yes
source include/common
@@ -38,22 +40,23 @@ cd $CTL_DIR
# setup config file
cp $CTLRC $CTLRC.bak
-sed -i "s/# DBENGINE=MYSQL/DBENGINE=MYSQL/g" $CTLRC
-sed -i "s/# INSTALL_EXTRA_TABLES=ask/INSTALL_EXTRA_TABLES=yes/g" $CTLRC
-sed -i "s/# INSTALL_PRESENCE_TABLES=ask/INSTALL_PRESENCE_TABLES=yes/g" $CTLRC
+sed -i '' -e "s/# DBENGINE=MYSQL/DBENGINE=MYSQL/g" $CTLRC
+sed -i '' -e "s/# INSTALL_EXTRA_TABLES=ask/INSTALL_EXTRA_TABLES=yes/g" $CTLRC
+sed -i '' -e "s/# INSTALL_PRESENCE_TABLES=ask/INSTALL_PRESENCE_TABLES=yes/g" $CTLRC
+sed -i '' -e "s/# INSTALL_DBUID_TABLES=ask/INSTALL_DBUID_TABLES=yes/g" $CTLRC
cp $DBCTL $DBCTL.bak
-sed -i "s/TEST=\"false\"/TEST=\"true\"/g" $DBCTL
+sed -i '' -e "s/TEST=\"false\"/TEST=\"true\"/g" $DBCTL
# set the mysql root password
cp $DBCTL.mysql $DBCTL.mysql.bak
-sed -i "s/#PW=\"\"/PW=\"$PW\"/g" $DBCTL.mysql
+sed -i '' -e "s/#PW=\"\"/PW=\"$PW\"/g" $DBCTL.mysql
-./$DBCTL create $tmp_name > /dev/null
+PWSKIP="$PWSKIP" CHARSET="latin1" ./$DBCTL create $tmp_name > /dev/null
ret=$?
if [ "$ret" -eq 0 ] ; then
- ./$DBCTL drop $tmp_name > /dev/null
+ PWSKIP="$PWSKIP" ./$DBCTL drop $tmp_name > /dev/null
ret=$?
fi ;
More information about the sr-dev
mailing list