test/relocate.sh
changeset 413 4c0b7471e73e
child 456 bae5adee8c8c
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/test/relocate.sh	Wed Feb 01 12:49:13 2012 +0000
     1.3 @@ -0,0 +1,24 @@
     1.4 +#!/bin/sh
     1.5 +check_file()
     1.6 +{
     1.7 +    ../src/razor list-files | grep -x "$1" > /dev/null
     1.8 +    if [ $? -ne 0 ]; then
     1.9 +	echo $1: Not in database >&2
    1.10 +	exit 1
    1.11 +    fi
    1.12 +    if [ ! -e "$RAZOR_ROOT$1" ]; then 
    1.13 +	echo $1: Not in filesystem >&2
    1.14 +	exit 1
    1.15 +    fi
    1.16 +}
    1.17 +export RAZOR_ROOT=`mktemp -dt` || exit 1
    1.18 +../src/razor init || exit 1
    1.19 +export YUM_URL="file://localhost/`pwd`"
    1.20 +../src/razor import-yum || exit 1
    1.21 +../src/razor install zap || exit 1
    1.22 +../src/razor install --relocate /usr=/opt --relocate /etc=/opt/etc zsh || exit 1
    1.23 +check_file /etc/zsh.conf
    1.24 +check_file /usr/bin/zap
    1.25 +check_file /opt/bin/zip
    1.26 +check_file /opt/bin/zsh
    1.27 +rm -rf "$RAZOR_ROOT"