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