mqltest.sh 755 B

1234567891011121314151617181920212223242526272829303132333435
  1. export LANG=zh_CN.utf8
  2. export LC_ALL=zh_CN.utf8 2>/dev/null
  3. #改变工作目录到当前脚本所在路径
  4. if [[ "$0" =~ / ]]; then cd "${0%/*}"; fi
  5. export CWD=`pwd`
  6. if [[ ! -e "mql.conf" ]]; then
  7. if [[ "${ODBPATH}" = "" ]]; then
  8. export ODBPATH=127.0.0.1:11001
  9. fi
  10. if [[ "${KEYSPACE}" = "" ]]; then
  11. export KEYSPACE=oktest
  12. fi
  13. fi
  14. odbpath=`./mql odbpath? log.level=error "$@"`
  15. keyspace=`./mql keyspace? log.level=error "$@"`
  16. if [[ `echo "${keyspace}" | wc -w` == "1" ]]; then
  17. logfile="${keyspace}.test.log"
  18. else
  19. logfile="test.log"
  20. fi
  21. if [[ "${odbpath}" != "" ]]; then
  22. echo ODBPATH="${odbpath}"
  23. fi
  24. if [[ "${keyspace}" != "" ]]; then
  25. echo keyspace="${keyspace}"
  26. fi
  27. sleep 2
  28. ./mql "$@" 2>&1 | tee ${logfile}