#!/bin/bash # $HeadURL$ $LastChangedRevision$ echo "configuring environment ..." export RDW2_ETC_PREFIX=$(pwd)/etc export RDW2_DB_FILE=$(pwd)/var/rdw2.sqlite export LABEL_TOOL_REROOT_DIR=$(pwd)/.label-tool echo "setting up support scripts ..." echo "initialising server ..." mkdir -p etc var echo 'rdw2_server_flag = True' > etc/rdw2.py rdw2 --debug=1 --list-sets > /dev/null # WP#141 is about this label checks failing *second* time, so # we need to repeat a lot of stuff here. LABEL_FILE=$(find . -name '*.rdw2-server-label') echo "with disk label and with db label (should succeed twice) ..." rdw2 --debug=1 --list-sets > /dev/null rdw2 --debug=1 --list-sets > /dev/null echo "without disk label and with db label (should fail twice) ..." mv $LABEL_FILE $LABEL_FILE.off rdw2 --debug=1 --list-sets 2>&1 > /dev/null | sed 's/expected.*/expected .../' rdw2 --debug=1 --list-sets 2>&1 > /dev/null | sed 's/expected.*/expected .../' mv $LABEL_FILE.off $LABEL_FILE echo "with disk label and without db label (should fail twice) ..." mv $RDW2_DB_FILE $RDW2_DB_FILE.off rdw2 --debug=1 --list-sets > /dev/null rdw2 --debug=1 --list-sets > /dev/null rm -f $RDW2_DB_FILE mv $RDW2_DB_FILE.off $RDW2_DB_FILE echo "without disk label and without db label (should succeed twice) ..." mv $LABEL_FILE $LABEL_FILE.off mv $RDW2_DB_FILE $RDW2_DB_FILE.off rdw2 --debug=1 --list-sets > /dev/null rdw2 --debug=1 --list-sets > /dev/null rm -f $RDW2_DB_FILE mv $RDW2_DB_FILE.off $RDW2_DB_FILE mv $LABEL_FILE.off $LABEL_FILE echo "all done"