mirror of
https://gitlab.com/davical-project/davical.git
synced 2026-05-26 02:44:29 +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}"
|
||||
ADMINPW="${2}"
|
||||
|
||||
DBADIR="`dirname \"$0\"`"
|
||||
|
||||
@ -27,13 +28,17 @@ psql -q -f "${DBADIR}/caldav_functions.sql" "${DBNAME}"
|
||||
psql -q -f "${DBADIR}/base-data.sql" "${DBNAME}"
|
||||
|
||||
#
|
||||
# Generate a random administrative password. If pwgen is available we'll use that,
|
||||
# otherwise try and hack something up using a few standard utilities
|
||||
PWGEN="`which pwgen`"
|
||||
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 \"\\\'\" '^='`"
|
||||
# We can override the admin password generation for regression testing predictability
|
||||
if [ "${ADMINPW}" = "" ] ; then
|
||||
#
|
||||
# Generate a random administrative password. If pwgen is available we'll use that,
|
||||
# otherwise try and hack something up using a few standard utilities
|
||||
PWGEN="`which pwgen`"
|
||||
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
|
||||
psql -q -c "UPDATE usr SET password = '**${ADMINPW}' WHERE user_no = 1;" "${DBNAME}"
|
||||
|
||||
|
||||
@ -39,7 +39,7 @@ if ! dropdb ${DBNAME}; then
|
||||
fi
|
||||
|
||||
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}"
|
||||
|
||||
TEST="Load-Sample-Data"
|
||||
|
||||
@ -24,3 +24,4 @@ CREATE DATABASE
|
||||
10
|
||||
(1 row)
|
||||
|
||||
The password for the 'admin' user has been set to 'nimda'
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user