Add server-unix-socket config option (#1303)
Add ncat workaround to test socket connection on CircleCI
This commit is contained in:
committed by
Steve Chávez
parent
e292fb5eb9
commit
78e5677fbe
@@ -181,6 +181,30 @@ ensureAppSettings(){
|
||||
pgrStop
|
||||
}
|
||||
|
||||
getSocketStatus() {
|
||||
curl -sL -w "%{http_code}\\n" -o /dev/null localhost:54321
|
||||
}
|
||||
|
||||
socketConnection(){
|
||||
# map port 54321 traffic to unix socket as workaround for curl below 7.40
|
||||
# not supporting --unix-socket flag
|
||||
ncat -vlk 54321 -c 'ncat -U /tmp/postgrest.sock' &
|
||||
pgrStart "./configs/unix-socket.config"
|
||||
while pgrStarted && test "$( getSocketStatus )" -ne 200
|
||||
do
|
||||
# wait for the server to start
|
||||
sleep 0.1 \
|
||||
|| sleep 1 # fallback: subsecond sleep is not standard and may fail
|
||||
done
|
||||
if test $( getSocketStatus ) -eq 200
|
||||
then
|
||||
ok "Succesfully connected through unix socket"
|
||||
else
|
||||
ko "Failed to connect through unix socket"
|
||||
fi
|
||||
pgrStop
|
||||
}
|
||||
|
||||
# PRE: curl must be available
|
||||
test -n "$(command -v curl)" || bailOut 'curl is not available'
|
||||
|
||||
@@ -191,6 +215,8 @@ setUp
|
||||
|
||||
echo "Running IO tests.."
|
||||
|
||||
socketConnection
|
||||
|
||||
readSecretFromFile word.noeol 'simple (no EOL)'
|
||||
readSecretFromFile word.txt 'simple'
|
||||
readSecretFromFile ascii.noeol 'ASCII (no EOL)'
|
||||
@@ -224,6 +250,7 @@ invalidRoleClaimKey 1234
|
||||
ensureIatClaimWorks
|
||||
ensureAppSettings
|
||||
|
||||
|
||||
cleanUp
|
||||
|
||||
exit $failedTests
|
||||
|
||||
Reference in New Issue
Block a user