1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/test/archive.sh Fri Jul 08 17:52:02 2016 +0100
1.3 @@ -0,0 +1,29 @@
1.4 +#!/bin/sh
1.5 +if [ $# -gt 0 ]; then
1.6 + razor="$1"
1.7 +else
1.8 + razor=`pwd`/../src/razor
1.9 +fi
1.10 +check_file()
1.11 +{
1.12 + (cd $scratchdir; $razor list-files) | grep -F -x "$1" > /dev/null
1.13 + if [ $? -ne 0 ]; then
1.14 + echo $1: Not in database >&2
1.15 + (cd $scratchdir; $razor list-files) >&2
1.16 + exit 1
1.17 + fi
1.18 + if [ ! -e "$tmproot$1" ]; then
1.19 + echo $1: Not in filesystem >&2
1.20 + ls -R "$tmproot" >&2
1.21 + exit 1
1.22 + fi
1.23 +}
1.24 +tmproot=`mktemp -dt` || exit 1
1.25 +export RAZOR_ROOT="file:$tmproot"
1.26 +scratchdir=`mktemp -dt` || exit 1
1.27 +(cd $scratchdir; $razor init) || exit 1
1.28 +export YUM_URL="file:`pwd`/base.zip"
1.29 +(cd $scratchdir; $razor import-yum) || exit 1
1.30 +(cd $scratchdir; $razor install zap) || exit 1
1.31 +check_file /usr/bin/zap
1.32 +rm -rf "$scratchdir" "$tmproot"