X-Git-Url: https://wimlib.net/git/?p=wimlib;a=blobdiff_plain;f=tests%2Fwin32-test-imagex-capture_and_apply.bat;h=01e3f32099894b8a8ddeb90774cceecf6b37ef7a;hp=023beaf4a8329ee6e93f6c183dad682dcd17d7cc;hb=e8c3ca2d1d0cac3d64985b45a9f654d2029a7518;hpb=d07c69b525404a9826caf386f27623eb894db989 diff --git a/tests/win32-test-imagex-capture_and_apply.bat b/tests/win32-test-imagex-capture_and_apply.bat index 023beaf4..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% @@ -257,19 +261,114 @@ attrib +h hidden call :do_test if %errorlevel% neq 0 exit /b %errorlevel% +call :msg "hidden directory" +md subdir +attrib +h subdir +call :do_test +if %errorlevel% neq 0 exit /b %errorlevel% + +call :msg "encrypted file" +echo "hello" > encrypted +cipher /e encrypted > nul +call :do_test +if %errorlevel% neq 0 exit /b %errorlevel% + +call :msg "identical encrypted files" +echo "hello" > encrypted1 +echo "hello" > encrypted2 +cipher /e encrypted1 > nul +cipher /e encrypted2 > nul +call :do_test +if %errorlevel% neq 0 exit /b %errorlevel% + +call :msg "encrypted directory" +md subdir +cipher /e subdir > nul +call :do_test +if %errorlevel% neq 0 exit /b %errorlevel% + +call :msg "encrypted directory with encrypted file in it" +md subdir +echo 1 > subdir\1 +cipher /e subdir > nul +cipher /e subdir\1 > nul +call :do_test +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 +echo hello > file:ads +cipher /e file > nul +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!!!!!!! @@ -286,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^)