diff -r 000000000000 -r b18e0bf48a91 test/archive.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/archive.sh Thu Jul 14 12:49:48 2016 +0100 @@ -0,0 +1,29 @@ +#!/bin/sh +if [ $# -gt 0 ]; then + razor="$1" +else + razor=`pwd`/../src/razor +fi +check_file() +{ + (cd $scratchdir; $razor list-files) | grep -F -x "$1" > /dev/null + if [ $? -ne 0 ]; then + echo $1: Not in database >&2 + (cd $scratchdir; $razor list-files) >&2 + exit 1 + fi + if [ ! -e "$tmproot$1" ]; then + echo $1: Not in filesystem >&2 + ls -R "$tmproot" >&2 + exit 1 + fi +} +tmproot=`mktemp -dt` || exit 1 +export RAZOR_ROOT="file:$tmproot" +scratchdir=`mktemp -dt` || exit 1 +(cd $scratchdir; $razor init) || exit 1 +export YUM_URL="file:`pwd`/base.zip" +(cd $scratchdir; $razor import-yum) || exit 1 +(cd $scratchdir; $razor install zap) || exit 1 +check_file /usr/bin/zap +rm -rf "$scratchdir" "$tmproot"