summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2020-01-01 20:48:15 -0600
committerEdward Thomson <ethomson@edwardthomson.com>2020-01-24 10:39:56 -0600
commit7fd9b3f597d1910effd43149157d49127244a238 (patch)
tree542a66eb1ddc98c1b3456712636d58e926e7fb92
parent29762e4089d8619d281083f2fab1176b378668e1 (diff)
downloadlibgit2-7fd9b3f597d1910effd43149157d49127244a238.tar.gz
ci: add NTLM tests
Download poxygit, a debugging git server, and clone from it using NTLM, both IIS-style (with connection affinity) and Apache-style ("broken", requiring constant reauthentication).
-rwxr-xr-xazure-pipelines/test.sh45
-rw-r--r--tests/CMakeLists.txt15
2 files changed, 51 insertions, 9 deletions
diff --git a/azure-pipelines/test.sh b/azure-pipelines/test.sh
index cffe03657..39e0b885b 100755
--- a/azure-pipelines/test.sh
+++ b/azure-pipelines/test.sh
@@ -6,6 +6,11 @@ if [ -n "$SKIP_TESTS" ]; then
exit 0
fi
+# Windows doesn't run the NTLM tests properly (yet)
+if [[ "$(uname -s)" == MINGW* ]]; then
+ SKIP_NTLM_TESTS=1
+fi
+
SOURCE_DIR=${SOURCE_DIR:-$( cd "$( dirname "${BASH_SOURCE[0]}" )" && dirname $( pwd ) )}
BUILD_DIR=$(pwd)
TMPDIR=${TMPDIR:-/tmp}
@@ -89,6 +94,16 @@ if [ -z "$SKIP_PROXY_TESTS" ]; then
java -jar poxyproxy.jar --address 127.0.0.1 --port 8090 --credentials foo:bar --auth-type ntlm --quiet &
fi
+if [ -z "$SKIP_NTLM_TESTS" ]; then
+ curl -L https://github.com/ethomson/poxygit/releases/download/v0.4.0/poxygit-0.4.0.jar >poxygit.jar
+
+ echo ""
+ echo "Starting HTTP server..."
+ NTLM_DIR=`mktemp -d ${TMPDIR}/ntlm.XXXXXXXX`
+ git init --bare "${NTLM_DIR}/test.git"
+ java -jar poxygit.jar --address 127.0.0.1 --port 9000 --credentials foo:baz --quiet "${NTLM_DIR}" &
+fi
+
if [ -z "$SKIP_SSH_TESTS" ]; then
echo "Starting ssh daemon..."
HOME=`mktemp -d ${TMPDIR}/home.XXXXXXXX`
@@ -207,6 +222,32 @@ if [ -z "$SKIP_PROXY_TESTS" ]; then
unset GITTEST_REMOTE_PROXY_PASS
fi
+if [ -z "$SKIP_NTLM_TESTS" ]; then
+ echo ""
+ echo "Running NTLM tests (IIS emulation)"
+ echo ""
+
+ export GITTEST_REMOTE_URL="http://localhost:9000/ntlm/test.git"
+ export GITTEST_REMOTE_USER="foo"
+ export GITTEST_REMOTE_PASS="baz"
+ run_test auth_clone_and_push
+ unset GITTEST_REMOTE_URL
+ unset GITTEST_REMOTE_USER
+ unset GITTEST_REMOTE_PASS
+
+ echo ""
+ echo "Running NTLM tests (Apache emulation)"
+ echo ""
+
+ export GITTEST_REMOTE_URL="http://localhost:9000/broken-ntlm/test.git"
+ export GITTEST_REMOTE_USER="foo"
+ export GITTEST_REMOTE_PASS="baz"
+ run_test auth_clone_and_push
+ unset GITTEST_REMOTE_URL
+ unset GITTEST_REMOTE_USER
+ unset GITTEST_REMOTE_PASS
+fi
+
if [ -z "$SKIP_NEGOTIATE_TESTS" -a -n "$GITTEST_NEGOTIATE_PASSWORD" ]; then
echo ""
echo "Running SPNEGO tests"
@@ -221,7 +262,7 @@ if [ -z "$SKIP_NEGOTIATE_TESTS" -a -n "$GITTEST_NEGOTIATE_PASSWORD" ]; then
export GITTEST_REMOTE_URL="https://test.libgit2.org/kerberos/empty.git"
export GITTEST_REMOTE_DEFAULT="true"
- run_test authenticate
+ run_test auth_clone
unset GITTEST_REMOTE_URL
unset GITTEST_REMOTE_DEFAULT
@@ -232,7 +273,7 @@ if [ -z "$SKIP_NEGOTIATE_TESTS" -a -n "$GITTEST_NEGOTIATE_PASSWORD" ]; then
export GITTEST_REMOTE_URL="https://test.libgit2.org/kerberos/empty.git"
export GITTEST_REMOTE_DEFAULT="true"
export GITTEST_REMOTE_EXPECTCONTINUE="true"
- run_test authenticate
+ run_test auth_clone
unset GITTEST_REMOTE_URL
unset GITTEST_REMOTE_DEFAULT
unset GITTEST_REMOTE_EXPECTCONTINUE
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 9295f0064..6f8a18ec0 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -60,10 +60,11 @@ FUNCTION(ADD_CLAR_TEST name)
ENDIF()
ENDFUNCTION(ADD_CLAR_TEST)
-ADD_CLAR_TEST(offline -v -xonline)
-ADD_CLAR_TEST(invasive -v -score::ftruncate -sfilter::stream::bigfile -sodb::largefiles -siterator::workdir::filesystem_gunk -srepo::init -srepo::init::at_filesystem_root)
-ADD_CLAR_TEST(online -v -sonline)
-ADD_CLAR_TEST(gitdaemon -v -sonline::push)
-ADD_CLAR_TEST(ssh -v -sonline::push -sonline::clone::ssh_cert -sonline::clone::ssh_with_paths -sonline::clone::path_whitespace_ssh)
-ADD_CLAR_TEST(proxy -v -sonline::clone::proxy)
-ADD_CLAR_TEST(authenticate -v -sonline::clone::credentials)
+ADD_CLAR_TEST(offline -v -xonline)
+ADD_CLAR_TEST(invasive -v -score::ftruncate -sfilter::stream::bigfile -sodb::largefiles -siterator::workdir::filesystem_gunk -srepo::init -srepo::init::at_filesystem_root)
+ADD_CLAR_TEST(online -v -sonline)
+ADD_CLAR_TEST(gitdaemon -v -sonline::push)
+ADD_CLAR_TEST(ssh -v -sonline::push -sonline::clone::ssh_cert -sonline::clone::ssh_with_paths -sonline::clone::path_whitespace_ssh)
+ADD_CLAR_TEST(proxy -v -sonline::clone::proxy)
+ADD_CLAR_TEST(auth_clone -v -sonline::clone::cred)
+ADD_CLAR_TEST(auth_clone_and_push -v -sonline::clone::push -sonline::push)