Unit test improvements
* Allow local copy of unit tests to persist. * Quote file-name exapansion for Windows setup. Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
This commit is contained in:
parent
8284dec85b
commit
39b06f1073
22
op_test.sh
Executable file → Normal file
22
op_test.sh
Executable file → Normal file
@ -4,14 +4,24 @@
|
|||||||
# and executes that - allows for disconnected testing from the easy-rsa
|
# and executes that - allows for disconnected testing from the easy-rsa
|
||||||
# repo with TravisCI.
|
# repo with TravisCI.
|
||||||
|
|
||||||
curl -O 'https://raw.githubusercontent.com/OpenVPN/easyrsa-unit-tests/master/easyrsa-unit-tests.sh'
|
case "$1" in
|
||||||
|
-v) verb='-v' ;;
|
||||||
|
-vv) verb='-vv' ;;
|
||||||
|
*) verb='-v'
|
||||||
|
esac
|
||||||
|
|
||||||
if [ -e "easyrsa-unit-tests.sh" ];
|
estat=0
|
||||||
then
|
|
||||||
sh easyrsa-unit-tests.sh -v
|
if [ -e "easyrsa-unit-tests.sh" ]; then
|
||||||
|
sh easyrsa-unit-tests.sh "$verb"
|
||||||
estat=$?
|
estat=$?
|
||||||
|
else
|
||||||
|
curl -O 'https://raw.githubusercontent.com/OpenVPN/easyrsa-unit-tests/master/easyrsa-unit-tests.sh'
|
||||||
|
[ -e "easyrsa-unit-tests.sh" ] || { echo "Unit-test download failed."; exit 9; }
|
||||||
|
sh easyrsa-unit-tests.sh "$verb"
|
||||||
|
estat=$?
|
||||||
|
rm -f easyrsa-unit-tests.sh
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rm -f easyrsa-unit-tests.sh
|
echo "estat: $estat"
|
||||||
|
|
||||||
exit $estat
|
exit $estat
|
||||||
|
|||||||
21
wop_test.bat
21
wop_test.bat
@ -12,24 +12,23 @@ IF %SYS_ARCH%==test (
|
|||||||
exit /B 1 )
|
exit /B 1 )
|
||||||
|
|
||||||
set WORK_DIR=%cd%
|
set WORK_DIR=%cd%
|
||||||
mkdir %WORK_DIR%\easyrsa3\bin
|
mkdir "%WORK_DIR%\easyrsa3\bin"
|
||||||
copy %WORK_DIR%\distro\windows\bin\* %WORK_DIR%\easyrsa3\bin
|
copy "%WORK_DIR%\distro\windows\bin\*" "%WORK_DIR%\easyrsa3\bin"
|
||||||
copy %WORK_DIR%\distro\windows\%SYS_ARCH%\* %WORK_DIR%\easyrsa3\bin
|
copy "%WORK_DIR%\distro\windows\%SYS_ARCH%\*" "%WORK_DIR%\easyrsa3\bin"
|
||||||
copy %WORK_DIR%\distro\windows\EasyRSA-Start.bat %WORK_DIR%\easyrsa3\EasyRSA-Start.bat
|
copy "%WORK_DIR%\distro\windows\EasyRSA-Start.bat" "%WORK_DIR%\easyrsa3\EasyRSA-Start.bat"
|
||||||
PATH=%PATH%;%WORK_DIR%\easyrsa3\bin;C:\PROGRA~1\openssl
|
PATH=%PATH%;%WORK_DIR%\easyrsa3\bin;C:\PROGRA~1\openssl
|
||||||
|
|
||||||
cmd /C "easyrsa3\bin\sh.exe wop_test.sh"
|
cmd /C "easyrsa3\bin\sh.exe wop_test.sh"
|
||||||
IF ERRORLEVEL 0 (
|
IF ERRORLEVEL 0 (
|
||||||
IF %SAVE_LAYOUT% EQU 0 (
|
IF %SAVE_LAYOUT% EQU 0 (
|
||||||
echo rmdir /S /Q %WORK_DIR%\easyrsa3\bin
|
echo rmdir /S /Q "%WORK_DIR%\easyrsa3\bin"
|
||||||
rmdir /S /Q %WORK_DIR%\easyrsa3\bin
|
rmdir /S /Q "%WORK_DIR%\easyrsa3\bin"
|
||||||
echo del /Q %WORK_DIR%\easyrsa3\EasyRSA-Start.bat
|
echo del /Q "%WORK_DIR%\easyrsa3\EasyRSA-Start.bat"
|
||||||
del /Q %WORK_DIR%\easyrsa3\EasyRSA-Start.bat
|
del /Q "%WORK_DIR%\easyrsa3\EasyRSA-Start.bat"
|
||||||
echo rm %WORK_DIR%\easyrsa3\.rnd
|
echo rm "%WORK_DIR%\easyrsa3\.rnd"
|
||||||
rm %WORK_DIR%\easyrsa3\.rnd
|
rm "%WORK_DIR%\easyrsa3\.rnd"
|
||||||
) ELSE echo NOTICE; Saved Layout
|
) ELSE echo NOTICE; Saved Layout
|
||||||
) ELSE echo Error occurred, no clean up
|
) ELSE echo Error occurred, no clean up
|
||||||
|
|
||||||
set SAVE_LAYOUT=
|
set SAVE_LAYOUT=
|
||||||
set SYS_ARCH=
|
set SYS_ARCH=
|
||||||
pause
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user