]> git.saurik.com Git - apple/security.git/blob - SecurityTests/cspxutils/testall
Security-57031.10.10.tar.gz
[apple/security.git] / SecurityTests / cspxutils / testall
1 #! /bin/csh -f
2 #
3 # Run all normal configurations of cspdvt and cltpdvt.
4 #
5 # safely look for this required env var
6 #
7 setenv | grep LOCAL_BUILD_DIR > /dev/null
8 if($status != 0) then
9 echo Please set env var LOCAL_BUILD_DIR.
10 exit(1)
11 endif
12
13 # Setup HOME environment with an unlocked login.keychain
14 setenv HOME "${LOCAL_BUILD_DIR}/home"
15 # Cleanup after a possible previous test run
16 rm -rf "${LOCAL_BUILD_DIR}/home"
17 echo Creating virtual home directory in "$HOME"...
18 mkdir -p "${HOME}/Library/Preferences" || exit(1)
19 setenv PATH "${LOCAL_BUILD_DIR}:${PATH}"
20 #
21 # Avoid Sec layer overriding what we're trying to do here....
22 #
23 set USERNAME=`whoami`
24 if($USERNAME == root) then
25 set LOGIN_KEYCHAIN="${LOCAL_BUILD_DIR}/home/Library/Keychains/login.keychain"
26 else
27 set LOGIN_KEYCHAIN=login.keychain
28 endif
29 echo Creating virtual login keychain in "$LOGIN_KEYCHAIN"...
30 security create -p test "$LOGIN_KEYCHAIN"
31 security set-keychain-settings "$LOGIN_KEYCHAIN" || exit(1)
32
33 set BUILD_DIR=$LOCAL_BUILD_DIR
34
35 set FULL_SSL=
36 while ( $#argv > 0 )
37 switch ( "$argv[1]" )
38 case f:
39 set FULL_SSL=f
40 shift
41 breaksw
42 default:
43 echo Usage: testall \[f\(ull SSL tests\)\]
44 exit(1)
45 endsw
46 end
47
48 #
49 # Verify existence of a few random executables before we start.
50 #
51 if( ( ! -e $BUILD_DIR/wrapTest ) || \
52 ( ! -e $BUILD_DIR/hashTest ) || \
53 ( ! -e $BUILD_DIR/sslViewer ) || \
54 ( ! -e $BUILD_DIR/threadTest) ) then
55 echo === You do not seem to have all of the required executables.
56 echo === Please run \"make all\".
57 exit(1)
58 endif
59
60
61 echo ===== Running raw CSP regression test =====
62 ./cspdvt q || exit(1)
63 echo ===== Running CSPDL regression test =====
64 ./cspdvt q D || exit(1)
65 echo ===== Running CL/TP regression test =====
66 cd ../clxutils; ./cltpdvt q $FULL_SSL || exit(1)
67 echo ===== Full CSP/CL/TP regression test SUCCEEDED =====