diff --git a/dba/create-database.sh b/dba/create-database.sh index e61d953d..879903fd 100755 --- a/dba/create-database.sh +++ b/dba/create-database.sh @@ -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}" diff --git a/testing/run_regressions.sh b/testing/run_regressions.sh index 1514c779..f8ceb49c 100755 --- a/testing/run_regressions.sh +++ b/testing/run_regressions.sh @@ -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" diff --git a/testing/tests/regression-suite/Create-Database.result b/testing/tests/regression-suite/Create-Database.result index a7a2ed76..1c342838 100644 --- a/testing/tests/regression-suite/Create-Database.result +++ b/testing/tests/regression-suite/Create-Database.result @@ -24,3 +24,4 @@ CREATE DATABASE 10 (1 row) +The password for the 'admin' user has been set to 'nimda'