|
1 | 1 | SETLOCAL EnableExtensions
|
2 | 2 |
|
3 | 3 | ECHO Test return code success case
|
4 |
| -call azure success show |
| 4 | +call azure success show 2> out.error |
5 | 5 | REM We expect that the commands above succeed (return 0)
|
6 |
| -IF ERRORLEVEL 1 (EXIT /B 1) |
| 6 | +IF %ERRORLEVEL% NEQ 0 ( |
| 7 | + ECHO "Expected error level 0 for success, got " %ERRORLEVEL% |
| 8 | + EXIT /B 1 |
| 9 | +) |
7 | 10 |
|
8 | 11 | ECHO Test return codes non terminating error case
|
9 |
| -call azure success show --generatenonterminatingerror true |
10 |
| -if ERRORLEVEL 1 goto :verify_error_code_2 |
11 |
| -REM We expect the error code to be 1 - so we shouldn't be here |
12 |
| -EXIT /B 1 |
13 |
| -:verify_error_code_2 |
14 |
| -IF ERRORLEVEL 2 (EXIT /B 1) |
| 12 | +call azure success show --generatenonterminatingerror true 2> out.error |
| 13 | +IF %ERRORLEVEL% NEQ 1 ( |
| 14 | + ECHO "Expected error level 1 for non-terminating error, got " %ERRORLEVEL% |
| 15 | + EXIT /B 1 |
| 16 | +) |
15 | 17 |
|
16 | 18 | ECHO Test return codes terminating error case
|
17 |
| -call azure success show --generateterminatingerror true |
18 |
| -if ERRORLEVEL 2 goto :verify_error_code_3 |
19 |
| -REM We expect the error code to be 1 - so we shouldn't be here |
20 |
| -EXIT /B 1 |
21 |
| -:verify_error_code_3 |
22 |
| -IF ERRORLEVEL 3 (EXIT /B 1) |
| 19 | +call azure success show --generateterminatingerror true 2> out.error |
| 20 | +IF %ERRORLEVEL% NEQ 2 ( |
| 21 | + ECHO "Expected error level 2 for terminating error, got " %ERRORLEVEL% |
| 22 | + EXIT /B 1 |
| 23 | +) |
23 | 24 |
|
24 | 25 | ECHO Test pipeline aliasing
|
25 |
| -call azure test record new > testrecordnew.json |
26 |
| -call azure test record show < testrecordnew.json |
| 26 | +call azure test record new | azure test record show > out.txt |
| 27 | +IF %ERRORLEVEL% NEQ 0 ( |
| 28 | + ECHO "Expected error level 0 for success, got " %ERRORLEVEL% |
| 29 | + EXIT /B 1 |
| 30 | +) |
27 | 31 |
|
28 |
| -REM We expect that the commands above succeed |
29 |
| -IF ERRORLEVEL 1 (EXIT /B 1) |
30 | 32 |
|
| 33 | +ECHO ALL TESTS ARE HAPPY |
0 commit comments