]> git.saurik.com Git - apple/security.git/blame - SecurityTests/cspxutils/testall
Security-57337.40.85.tar.gz
[apple/security.git] / SecurityTests / cspxutils / testall
CommitLineData
d8f41ccd
A
1#! /bin/csh -f
2#
3# Run all normal configurations of cspdvt and cltpdvt.
4#
5# safely look for this required env var
6#
7setenv | grep LOCAL_BUILD_DIR > /dev/null
8if($status != 0) then
9 echo Please set env var LOCAL_BUILD_DIR.
10 exit(1)
11endif
12
13# Setup HOME environment with an unlocked login.keychain
14setenv HOME "${LOCAL_BUILD_DIR}/home"
15# Cleanup after a possible previous test run
16rm -rf "${LOCAL_BUILD_DIR}/home"
17echo Creating virtual home directory in "$HOME"...
18mkdir -p "${HOME}/Library/Preferences" || exit(1)
19setenv PATH "${LOCAL_BUILD_DIR}:${PATH}"
20#
21# Avoid Sec layer overriding what we're trying to do here....
22#
23set USERNAME=`whoami`
24if($USERNAME == root) then
25 set LOGIN_KEYCHAIN="${LOCAL_BUILD_DIR}/home/Library/Keychains/login.keychain"
26else
27 set LOGIN_KEYCHAIN=login.keychain
28endif
29echo Creating virtual login keychain in "$LOGIN_KEYCHAIN"...
30security create -p test "$LOGIN_KEYCHAIN"
31security set-keychain-settings "$LOGIN_KEYCHAIN" || exit(1)
32
33set BUILD_DIR=$LOCAL_BUILD_DIR
34
35set FULL_SSL=
36while ( $#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
46end
47
48#
49# Verify existence of a few random executables before we start.
50#
51if( ( ! -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)
58endif
59
60
61echo ===== Running raw CSP regression test =====
62./cspdvt q || exit(1)
63echo ===== Running CSPDL regression test =====
64./cspdvt q D || exit(1)
65echo ===== Running CL/TP regression test =====
66cd ../clxutils; ./cltpdvt q $FULL_SSL || exit(1)
67echo ===== Full CSP/CL/TP regression test SUCCEEDED =====