1@echo off
2
3rem   Batch file to copy OpenSSL stuff to a NetWare server for testing
4
5rem   This batch file will create an "opensssl" directory at the root of the
6rem   specified NetWare drive and copy the required files to run the tests.
7rem   It should be run from inside the "openssl\netware" subdirectory.
8
9rem   Usage:
10rem      cpy_tests.bat <test subdirectory> <NetWare drive>
11rem          <test subdirectory> - out_nw.dbg | out_nw
12rem          <NetWare drive> - any mapped drive letter
13rem
14rem      example ( copy from debug build to m: dirve ):
15rem              cpy_tests.bat out_nw.dbg m:
16rem
17rem      CAUTION:  If a directory named OpenSSL exists on the target drive
18rem                it will be deleted first.
19
20
21if "%1" == "" goto usage
22if "%2" == "" goto usage
23
24rem   Assume running in \openssl directory unless cpy_tests.bat exists then
25rem   it must be the \openssl\netware directory
26set loc=.
27if exist cpy_tests.bat set loc=..
28
29rem   make sure the local build subdirectory specified is valid
30if not exist %loc%\%1\NUL goto invalid_dir
31
32rem   make sure target drive is valid
33if not exist %2\NUL goto invalid_drive
34
35rem   If an OpenSSL directory exists on the target drive, remove it
36if exist %2\openssl\NUL goto remove_openssl
37goto do_copy
38
39:remove_openssl
40echo .
41echo OpenSSL directory exists on %2 - it will be removed!
42pause
43rmdir %2\openssl /s /q
44
45:do_copy
46rem   make an "openssl" directory and others at the root of the NetWare drive
47mkdir %2\openssl
48mkdir %2\openssl\test_out
49mkdir %2\openssl\apps
50mkdir %2\openssl\certs
51mkdir %2\openssl\test
52
53
54rem   copy the test nlms
55copy %loc%\%1\*.nlm %2\openssl\
56
57rem   copy the test perl script
58copy %loc%\netware\do_tests.pl %2\openssl\
59
60rem   copy the certs directory stuff
61xcopy %loc%\certs\*.*         %2\openssl\certs\ /s
62
63rem   copy the test directory stuff
64copy %loc%\test\CAss.cnf      %2\openssl\test\
65copy %loc%\test\Uss.cnf       %2\openssl\test\
66copy %loc%\test\pkcs7.pem     %2\openssl\test\
67copy %loc%\test\pkcs7-1.pem   %2\openssl\test\
68copy %loc%\test\testcrl.pem   %2\openssl\test\
69copy %loc%\test\testp7.pem    %2\openssl\test\
70copy %loc%\test\testreq2.pem  %2\openssl\test\
71copy %loc%\test\testrsa.pem   %2\openssl\test\
72copy %loc%\test\testsid.pem   %2\openssl\test\
73copy %loc%\test\testx509.pem  %2\openssl\test\
74copy %loc%\test\v3-cert1.pem  %2\openssl\test\
75copy %loc%\test\v3-cert2.pem  %2\openssl\test\
76
77rem   copy the apps directory stuff
78copy %loc%\apps\client.pem    %2\openssl\apps\
79copy %loc%\apps\server.pem    %2\openssl\apps\
80copy %loc%\apps\openssl.cnf   %2\openssl\apps\
81
82echo .
83echo Tests copied
84echo Run the test script at the console by typing:
85echo     "Perl \openssl\do_tests.pl"
86echo .
87echo Make sure the Search path includes the OpenSSL subdirectory
88
89goto end
90
91:invalid_dir
92echo.
93echo Invalid build directory specified: %1
94echo.
95goto usage
96
97:invalid_drive
98echo.
99echo Invalid drive: %2
100echo.
101goto usage
102
103:usage
104echo.
105echo usage: cpy_tests.bat [test subdirectory] [NetWare drive]
106echo     [test subdirectory] - out_nw_clib.dbg, out_nw_libc.dbg, etc. 
107echo     [NetWare drive]     - any mapped drive letter
108echo.
109echo example: cpy_test out_nw_clib.dbg M:
110echo  (copy from clib debug build area to M: drive)
111
112:end
113