mirror of
https://gitlab.com/davical-project/davical.git
synced 2026-05-27 02:54:27 +00:00
Since we're now doing a random password, we have to be able to override
it when we run the regression tests.
This commit is contained in:
parent
58ac97191a
commit
f6578fcda3
@ -4,6 +4,7 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
DBNAME="${1:-rscds}"
|
DBNAME="${1:-rscds}"
|
||||||
|
ADMINPW="${2}"
|
||||||
|
|
||||||
DBADIR="`dirname \"$0\"`"
|
DBADIR="`dirname \"$0\"`"
|
||||||
|
|
||||||
@ -27,13 +28,17 @@ psql -q -f "${DBADIR}/caldav_functions.sql" "${DBNAME}"
|
|||||||
psql -q -f "${DBADIR}/base-data.sql" "${DBNAME}"
|
psql -q -f "${DBADIR}/base-data.sql" "${DBNAME}"
|
||||||
|
|
||||||
#
|
#
|
||||||
# Generate a random administrative password. If pwgen is available we'll use that,
|
# We can override the admin password generation for regression testing predictability
|
||||||
# otherwise try and hack something up using a few standard utilities
|
if [ "${ADMINPW}" = "" ] ; then
|
||||||
PWGEN="`which pwgen`"
|
#
|
||||||
if [ "$PWGEN" = "" ] ; then
|
# Generate a random administrative password. If pwgen is available we'll use that,
|
||||||
ADMINPW="`dd if=/dev/urandom bs=512 count=1 2>/dev/null | tr -c -d "[:alnum:]" | cut -c2-9`"
|
# otherwise try and hack something up using a few standard utilities
|
||||||
else
|
PWGEN="`which pwgen`"
|
||||||
ADMINPW="`pwgen -Bcny | tr \"\\\'\" '^='`"
|
if [ "$PWGEN" = "" ] ; then
|
||||||
|
ADMINPW="`dd if=/dev/urandom bs=512 count=1 2>/dev/null | tr -c -d "[:alnum:]" | cut -c2-9`"
|
||||||
|
else
|
||||||
|
ADMINPW="`pwgen -Bcny | tr \"\\\'\" '^='`"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
psql -q -c "UPDATE usr SET password = '**${ADMINPW}' WHERE user_no = 1;" "${DBNAME}"
|
psql -q -c "UPDATE usr SET password = '**${ADMINPW}' WHERE user_no = 1;" "${DBNAME}"
|
||||||
|
|
||||||
|
|||||||
@ -39,7 +39,7 @@ if ! dropdb ${DBNAME}; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
TEST="Create-Database"
|
TEST="Create-Database"
|
||||||
../dba/create-database.sh ${DBNAME} >"${RESULTS}/${TEST}" 2>&1
|
../dba/create-database.sh ${DBNAME} 'nimda' >"${RESULTS}/${TEST}" 2>&1
|
||||||
check_result "${TEST}"
|
check_result "${TEST}"
|
||||||
|
|
||||||
TEST="Load-Sample-Data"
|
TEST="Load-Sample-Data"
|
||||||
|
|||||||
@ -24,3 +24,4 @@ CREATE DATABASE
|
|||||||
10
|
10
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
|
The password for the 'admin' user has been set to 'nimda'
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user