X-Git-Url: https://wimlib.net/git/?p=wimlib;a=blobdiff_plain;f=tests%2Ftest-imagex-capture_and_apply;h=e7b56e35c7d5e5c04560e6a8e8898837b88a1a19;hp=d281f8ec10df337872e53ff492eb8fb5bb09963d;hb=61edb3642435e6c494d7c7f3038334dd196f58fd;hpb=08a55221fc6904ceaf4bd1c0532eb03e792d5420 diff --git a/tests/test-imagex-capture_and_apply b/tests/test-imagex-capture_and_apply index d281f8ec..e7b56e35 100755 --- a/tests/test-imagex-capture_and_apply +++ b/tests/test-imagex-capture_and_apply @@ -10,40 +10,14 @@ set -e cd tests -. tests-common.sh +srcdir="${srcdir:-.}/.." +srcdir="$(cd $srcdir; pwd)" +. "$srcdir/tests/tests-common.sh" -imagex() { - echo "imagex $@" - ../imagex "$@" > /dev/null -} - -imagex_info() { - echo "imagex info $@" - ../imagex info "$@" -} - -init() { - mkdir in.dir out.dir -} - -cleanup() { - rm -rf in.dir out.dir test*.wim test*.swm -} - -error() { - echo "****************************************************************" - echo " Test failure " - echo $* - echo "****************************************************************" - exit 1 -} - -wim_ctype() { - ../imagex info $1 | grep Compression | awk '{print $2}' -} +TEST_SUBDIR=tmpdir_test-imagex-capture_and_apply do_tree_cmp() { - if ! ./tree-cmp in.dir out.dir; then + if ! ../tree-cmp in.dir out.dir; then if [ -x /usr/bin/tree ]; then echo "Dumping tree of applied image" echo "(Note: compression type was $ctype)" @@ -123,8 +97,10 @@ msg() { __msg "Testing image capture and application of directory containing $1" } -cleanup -init +default_cleanup +mkdir $TEST_SUBDIR +cd $TEST_SUBDIR +mkdir in.dir out.dir . $srcdir/tests/common_tests.sh @@ -137,10 +113,10 @@ imagex apply test.wim out.dir if [ -e out.dir/hiberfil.sys -o -e "out.dir/System Volume Information" ]; then error "Files were not excluded from capture as expected" fi -rm -rf out.dir/* in.dir/* - -cleanup echo "**********************************************************" echo " imagex capture/apply tests passed " echo "**********************************************************" + +cd .. +default_cleanup