Commit 415ee616 by Patrick Steinhardt

azure-pipelines: make gitdaemon tests work on Win32

On Win32 builds, the PID file created by git-daemon contained in invalid
PID that we were not able to kill afterwards. Somehow, it seems like the
contained PID was wrapped in braces. Consequentially, kill(1) failed and
thus caused the build to error.

Fix this by directly grabbing the PID of the spawned git-daemon process.
parent f867bfa8
...@@ -16,9 +16,9 @@ SUCCESS=1 ...@@ -16,9 +16,9 @@ SUCCESS=1
cleanup() { cleanup() {
echo "Cleaning up..." echo "Cleaning up..."
if [ ! -z "$GITDAEMON_DIR" -a -f "${GITDAEMON_DIR}/pid" ]; then if [ ! -z "$GITDAEMON_PID" ]; then
echo "Stopping git daemon..." echo "Stopping git daemon..."
kill $(cat "${GITDAEMON_DIR}/pid") kill $GITDAEMON_PID
fi fi
if [ ! -z "$SSHD_DIR" -a -f "${SSHD_DIR}/pid" ]; then if [ ! -z "$SSHD_DIR" -a -f "${SSHD_DIR}/pid" ]; then
...@@ -73,7 +73,8 @@ if [ -z "$SKIP_GITDAEMON_TESTS" ]; then ...@@ -73,7 +73,8 @@ if [ -z "$SKIP_GITDAEMON_TESTS" ]; then
echo "Starting git daemon..." echo "Starting git daemon..."
GITDAEMON_DIR=`mktemp -d ${TMPDIR}/gitdaemon.XXXXXXXX` GITDAEMON_DIR=`mktemp -d ${TMPDIR}/gitdaemon.XXXXXXXX`
git init --bare "${GITDAEMON_DIR}/test.git" git init --bare "${GITDAEMON_DIR}/test.git"
git daemon --listen=localhost --export-all --enable=receive-pack --pid-file="${GITDAEMON_DIR}/pid" --base-path="${GITDAEMON_DIR}" "${GITDAEMON_DIR}" 2>/dev/null & git daemon --listen=localhost --export-all --enable=receive-pack --base-path="${GITDAEMON_DIR}" "${GITDAEMON_DIR}" 2>/dev/null &
GITDAEMON_PID=$!
fi fi
if [ -z "$SKIP_PROXY_TESTS" ]; then if [ -z "$SKIP_PROXY_TESTS" ]; then
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment