# ATTENTION:
#
# Please read spnegoReadme first to setup the testing
# environment needed
# the following ENV should be adjusted to match your environment
GOOD_PASS='-Duser=olala -Dpass=1q2w#E$R'
GOOD_KPASS='-Dkuser=olala -Dkpass=1q2w#E$R'
BAD_PASS='-Duser=olala -Dpass=false'
BAD_KPASS='-Dkuser=olala -Dkpass=false'
# these ENV determines how much to show in terminal. don't edit
EXTRA_LOG="-Djava.util.logging.config.file=spnegoLog.properties -Dshowhint"
ANY_EXCEPTION='Exception'
HEADER_200='HTTP/1.1 200'
# a java run
function runonce {
echo Testing $AUTH_TYPE-$TEST_NAME ...
else
fi
}
function testsuite {
# normal runs
TEST_NAME="Authenticate with Negotiate"
# first 40X and ask for authen i author-neg and 200 and success
TEST_NAME="Authenticate with Kerberos"
# first 40X and ask for authen i author-neg and 200 and success
TEST_NAME="Authenticate with Basic"
# first 40X and ask for authen i author-basic and 200 and success
echo 'Skip bad kpass test if HAS_CACHE is true'
else
# bad kpass should fallback to basic
TEST_NAME="Authenticate fallback"
# first 40X and ask for authen i cannot author-neg but can author-basic and 200 and success
# auth.pref given, does not fallback
TEST_NAME="Authenticate no fallback"
runonce # will fail
# first 40X and ask for authen i cannot author-neg and fail with IO_EXCEPTION
# bad kpass fallback to basic, but bad pass
TEST_NAME="Authenticate fallback but still cannot go on"
runonce # will fail
# first 40X and ask for authen i cannot author-neg and author-basic again and again and fail with PROTO_EXCEPTION
fi
}
function testWWW {
# WWW Part
HEADER_40X='HTTP/1.1 401'
AUTH_RESPONSE='WWW-Authenticate:'
AUTH_NEG_REQUEST='{Authorization: Negotiate'
AUTH_BASIC_REQUEST='{Authorization: Basic'
AUTH_ANY_REQUEST='{Authorization:'
}
function testProxy {
# Proxy Part
HEADER_40X='HTTP/1.1 407'
AUTH_RESPONSE='Proxy-Authenticate:'
AUTH_NEG_REQUEST='{Proxy-Authorization: Negotiate'
AUTH_BASIC_REQUEST='{Proxy-Authorization: Basic'
AUTH_ANY_REQUEST='{Proxy-Authorization:'
}
HAS_CACHE='false'
HAS_CACHE='true'
#kinit for WWW_REALM
#kinit for PRXY_REALM
exit 0