diff -r 000000000000 -r cf88b5df2884 test/relocate.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/relocate.sh Fri May 01 16:43:37 2009 +0100 @@ -0,0 +1,24 @@ +#!/bin/sh +check_file() +{ + ../src/razor list-files | grep -x "$1" > /dev/null + if [ $? -ne 0 ]; then + echo $1: Not in database >&2 + exit 1 + fi + if [ ! -e "$RAZOR_ROOT$1" ]; then + echo $1: Not in filesystem >&2 + exit 1 + fi +} +export RAZOR_ROOT=`mktemp -dt` || exit 1 +../src/razor init || exit 1 +export YUM_URL="file://localhost/`pwd`" +../src/razor import-yum || exit 1 +../src/razor install zap || exit 1 +../src/razor install --relocate /usr=/opt --relocate /etc=/opt/etc zsh || exit 1 +check_file /etc/zsh.conf +check_file /usr/bin/zap +check_file /opt/bin/zip +check_file /opt/bin/zsh +rm -rf "$RAZOR_ROOT"