test/relocate.sh
author J. Ali Harlow <ali@juiblex.co.uk>
Wed Oct 22 12:09:47 2014 +0100 (2014-10-22)
changeset 460 b8638c3c7eee
parent 351 48b0adfe3059
child 475 008c75a5e08d
permissions -rwxr-xr-x
Add basic checks for rpm file format
     1 #!/bin/sh
     2 if [ $# -gt 0 ]; then
     3     razor="$1"
     4 else
     5     razor=../src/razor
     6 fi
     7 check_file()
     8 {
     9     $razor list-files | grep -x "$1" > /dev/null
    10     if [ $? -ne 0 ]; then
    11 	echo $1: Not in database >&2
    12 	exit 1
    13     fi
    14     if [ ! -e "$RAZOR_ROOT$1" ]; then 
    15 	echo $1: Not in filesystem >&2
    16 	exit 1
    17     fi
    18 }
    19 export RAZOR_ROOT=`mktemp -dt` || exit 1
    20 $razor init || exit 1
    21 export YUM_URL="file://localhost/`pwd`"
    22 $razor import-yum || exit 1
    23 $razor install zap || exit 1
    24 $razor install --relocate /usr=/opt --relocate /etc=/opt/etc zsh || exit 1
    25 check_file /etc/zsh.conf
    26 check_file /usr/bin/zap
    27 check_file /opt/bin/zip
    28 check_file /opt/bin/zsh
    29 rm -rf "$RAZOR_ROOT"