]> wimlib.net Git - wimlib/blobdiff - tests/win32-test-imagex-capture_and_apply.bat
Update Windows test script
[wimlib] / tests / win32-test-imagex-capture_and_apply.bat
index f18939de7c4cc1d66030dc2d54272699f95bb6c0..cc19dd9803f2353bea10ad27f65c2e7ebd7019f9 100644 (file)
@@ -61,6 +61,12 @@ type nul > emptyfile
 call :do_test\r
 if %errorlevel% neq 0 exit /b %errorlevel%\r
 \r
+call :msg "hard linked empty file"\r
+type nul > file\r
+mklink /h link file > nul\r
+call :do_test\r
+if %errorlevel% neq 0 exit /b %errorlevel%\r
+\r
 call :msg "various hard linked, identical, different, and empty files"\r
 echo 1 > file\r
 echo 5 > file\r
@@ -322,13 +328,13 @@ call :do_test
 if %errorlevel% neq 0 exit /b %errorlevel%\r
 \r
 call :msg "hidden system directory"\r
-echo 1 > subdir\r
+md subdir\r
 attrib +h +s subdir\r
 call :do_test\r
 if %errorlevel% neq 0 exit /b %errorlevel%\r
 \r
 call :msg "hidden, readonly, system directory"\r
-echo 1 > subdir\r
+md subdir\r
 attrib +h +r +s subdir\r
 call :do_test\r
 if %errorlevel% neq 0 exit /b %errorlevel%\r
@@ -380,10 +386,18 @@ if %errorlevel% neq 0 exit /b %errorlevel%
 call :msg "unencrypted file in encrypted directory in compressed directory"\r
 md 1\r
 md 1\2\r
-compact /c 1 > /nul\r
-cipher /e 1\2 > /nul\r
+compact /c 1 > nul\r
+cipher /e 1\2 > nul\r
 echo hello > 1\2\file\r
-cipher /d 1\2\file > /nul\r
+cipher /d 1\2\file > nul\r
+call :do_test\r
+if %errorlevel% neq 0 exit /b %errorlevel%\r
+\r
+call :msg "encrypted directory with alternate data streams"\r
+md subdir\r
+cipher /e subdir > nul\r
+echo ads1 > subdir:ads1\r
+echo ads2 > subdir:ads2\r
 call :do_test\r
 if %errorlevel% neq 0 exit /b %errorlevel%\r
 \r
@@ -449,22 +463,16 @@ if %errorlevel% neq 0 (
        exit /b %errorlevel%\r
 )\r
 \r
-REM Fun fact:  There are bugs in Microsoft's imagex.exe that make it fail some\r
-REM of our tests.\r
-REM\r
-REM rd /S /Q out.dir\r
-REM md out.dir\r
-REM imagex /capture in.dir test.wim "test" /norpfix > nul\r
+REM Fun fact: Microsoft's WIMGAPI has bugs that make it fail some of our tests.\r
+REM Even the Windows 8.1 version has incorrect behavior with empty files with\r
+REM multiple links, or files with named data streams and multiple links.\r
+rd /S /Q out.dir\r
+md out.dir\r
+REM dism /capture-image /capturedir:in.dir /imagefile:test.wim /name:"test" /norpfix > nul\r
 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 if %errorlevel% neq 0 (\r
-       REM echo @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\r
-       REM echo            TEST FAILED!!!!!!! ^(imagex^)\r
-       REM echo @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\r
-       REM exit /b %errorlevel%\r
-REM )\r
+dism /apply-image /imagefile:test.wim /index:1 /applydir:out.dir > nul\r
+if %errorlevel% neq 0 exit /b %errorlevel%\r
+%WIN32_TREE_CMP% in.dir out.dir\r
 \r
 rd /S /Q in.dir out.dir\r
 md in.dir\r