Skip to content

Commit

Permalink
fix: isolate fle
Browse files Browse the repository at this point in the history
  • Loading branch information
nbbeeken committed Jan 25, 2023
1 parent 3a4b11b commit d98109e
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions .evergreen/run-socks5-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,27 @@ fi

# First, test with Socks5 + authentication required
"$PYTHON_BINARY" "$SOCKS5_SERVER_SCRIPT" --port 1080 --auth username:p4ssw0rd --map "127.0.0.1:12345 to $FIRST_HOST" &
PID=$!
env SOCKS5_CONFIG='["127.0.0.1",1080,"username","p4ssw0rd"]' npm run check:socks5
[[ $TEST_SOCKS5_CSFLE == "true" ]] && [ "$SSL" == "nossl" ] && [[ "$OSTYPE" == "linux-gnu"* ]] && \
SOCKS5_PROXY_PID=$!
if [[ $TEST_SOCKS5_CSFLE == "true" ]]; then
[ "$SSL" == "nossl" ] && [[ "$OSTYPE" == "linux-gnu"* ]] && \
env MONGODB_URI='mongodb://127.0.0.1:12345/?proxyHost=127.0.0.1&proxyUsername=username&proxyPassword=p4ssw0rd' \
bash "${PROJECT_DIRECTORY}/.evergreen/run-custom-csfle-tests.sh"
kill $PID
else
env SOCKS5_CONFIG='["127.0.0.1",1080,"username","p4ssw0rd"]' npm run check:socks5
fi
kill $SOCKS5_PROXY_PID

# Second, test with Socks5 + no authentication
"$PYTHON_BINARY" "$SOCKS5_SERVER_SCRIPT" --port 1081 --map "127.0.0.1:12345 to $FIRST_HOST" &
PID=$!
env SOCKS5_CONFIG='["127.0.0.1",1081]' npm run check:socks5
[[ $TEST_SOCKS5_CSFLE == "true" ]] && [ "$SSL" == "nossl" ] && [[ "$OSTYPE" == "linux-gnu"* ]] && \
env MONGODB_URI='mongodb://127.0.0.1:12345/?proxyHost=127.0.0.1&proxyPort=1081' \
bash "${PROJECT_DIRECTORY}/.evergreen/run-custom-csfle-tests.sh"
kill $PID
SOCKS5_PROXY_PID=$!
if [[ $TEST_SOCKS5_CSFLE == "true" ]]; then
[ "$SSL" == "nossl" ] && [[ "$OSTYPE" == "linux-gnu"* ]] && \
env MONGODB_URI='mongodb://127.0.0.1:12345/?proxyHost=127.0.0.1&proxyPort=1081' \
bash "${PROJECT_DIRECTORY}/.evergreen/run-custom-csfle-tests.sh"
else
env SOCKS5_CONFIG='["127.0.0.1",1081]' npm run check:socks5
fi
kill $SOCKS5_PROXY_PID

# TODO: It might be worth using something more robust to control
# the Socks5 proxy server script's lifetime

0 comments on commit d98109e

Please sign in to comment.