X-Git-Url: https://wimlib.net/git/?p=wimlib;a=blobdiff_plain;f=tests%2Fwin32-test-imagex-capture_and_apply.bat;h=01e3f32099894b8a8ddeb90774cceecf6b37ef7a;hp=6e2bebafd995c6169ae0a34b8de365fa51f72a99;hb=e8c3ca2d1d0cac3d64985b45a9f654d2029a7518;hpb=48c05c63f94c294d4b9982a228682c27e8d41dd2 diff --git a/tests/win32-test-imagex-capture_and_apply.bat b/tests/win32-test-imagex-capture_and_apply.bat index 6e2bebaf..01e3f320 100644 --- a/tests/win32-test-imagex-capture_and_apply.bat +++ b/tests/win32-test-imagex-capture_and_apply.bat @@ -6,10 +6,12 @@ REM REM Run some tests on the Windows version of wimlib-imagex. REM REM This must be run on Windows Vista or later in a clean directory, with -REM Administrator privileges. wimlib-imagex and win32-tree-cmp must be callable -REM (on PATH or in same directory). +REM Administrator privileges. wimlib-imagex and win32-tree-cmp must be +REM executable using the paths set below. setlocal EnableDelayedExpansion +set WIN32_TREE_CMP=win32-tree-cmp +set WIMLIB_IMAGEX=wimlib-imagex if exist in.dir rd /S /Q in.dir if exist out.dir rd /S /Q out.dir @@ -20,6 +22,8 @@ REM REM BEGIN TESTS REM +REM goto :rpfix_tests + call :msg "empty directory" call :do_test if %errorlevel% neq 0 exit /b %errorlevel% @@ -291,13 +295,13 @@ cipher /e subdir\1 > nul call :do_test if %errorlevel% neq 0 exit /b %errorlevel% -REM call :msg "encrypted directory with unencrypted file in it" -REM md subdir -REM echo 1 > subdir\1 -REM cipher /e subdir > nul -REM cipher /d subdir\1 > nul -REM call :do_test -REM if %errorlevel% neq 0 exit /b %errorlevel% +call :msg "encrypted directory with unencrypted file in it" +md subdir +echo 1 > subdir\1 +cipher /e subdir > nul +cipher /d subdir\1 > nul +call :do_test +if %errorlevel% neq 0 exit /b %errorlevel% call :msg "hardlinked, encrypted file with alternate data streams" echo hello > file @@ -307,19 +311,64 @@ mklink /h link file > nul call :do_test if %errorlevel% neq 0 exit /b %errorlevel% +:rpfix_tests + +echo Testing rpfix junction +md subdir +echo 1 > subdir\file +mklink /j junction subdir > nul +cd .. +%WIMLIB_IMAGEX% capture in.dir test.wim > nul +rd /s /q in.dir +%WIMLIB_IMAGEX% apply test.wim out.dir > nul +echo 1 > tmp1 +type out.dir\junction\file > tmp2 +fc tmp1 tmp2 > nul +if %errorlevel% neq 0 exit /b %errorlevel% +rd /s /q out.dir +del tmp1 tmp2 +md in.dir +cd in.dir + +echo Testing rpfix exclude +mklink otherlink c:\some\other\directory > nul +cd .. +%WIMLIB_IMAGEX% capture in.dir test.wim > nul +%WIMLIB_IMAGEX% apply test.wim out.dir > nul +rd out.dir +if %errorlevel% neq 0 exit /b %errorlevel% +rd /s /q in.dir +md in.dir +cd in.dir + +echo Testing rpfix relative +echo 1 > file +mklink relink file > nul +cd .. +%WIMLIB_IMAGEX% capture in.dir test.wim > nul +%WIMLIB_IMAGEX% apply test.wim out.dir > nul +fc in.dir\file out.dir\relink > nul +if %errorlevel% neq 0 exit /b %errorlevel% +rd /s /q in.dir out.dir +md in.dir +cd in.dir + REM REM END OF TESTS REM +cd .. +del test.wim +rd /s /q in.dir exit /b 0 :do_test cd .. -wimlib-imagex capture in.dir test.wim --norpfix > NUL +%WIMLIB_IMAGEX% capture in.dir test.wim --norpfix > NUL if %errorlevel% neq 0 exit /b %errorlevel% -wimlib-imagex apply test.wim out.dir > NUL +%WIMLIB_IMAGEX% apply test.wim out.dir > NUL if %errorlevel% neq 0 exit /b %errorlevel% -win32-tree-cmp in.dir out.dir +%WIN32_TREE_CMP% in.dir out.dir if %errorlevel% neq 0 ( echo @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ echo TEST FAILED!!!!!!! @@ -336,7 +385,7 @@ REM imagex /capture in.dir test.wim "test" /norpfix > nul REM if %errorlevel% neq 0 exit /b %errorlevel% REM imagex /apply test.wim 1 out.dir > nul REM if %errorlevel% neq 0 exit /b %errorlevel% -REM win32-tree-cmp in.dir out.dir +REM %WIN32_TREE_CMP% in.dir out.dir REM if %errorlevel% neq 0 ( REM echo @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ REM echo TEST FAILED!!!!!!! ^(imagex^)