Try to get IP address sorted out for travis

This commit is contained in:
Matt Bonneau 2020-04-10 13:15:49 -04:00
parent 1a4fa37f06
commit 5c15dd0a2f
6 changed files with 30 additions and 8 deletions

View File

@ -246,8 +246,13 @@ getTestCases()->then(function ($count) use ($loop) {
$allDeferred->resolve();
return;
}
echo "Running test $i/$count\n";
runTest($i)->then($runNextCase);
echo "Running test $i/$count...";
$startTime = microtime(true);
runTest($i)
->then(function () use ($startTime) {
echo " completed " . round((microtime(true) - $startTime) * 1000) . " ms\n";
})
->then($runNextCase);
};
$i = 0;

View File

@ -0,0 +1,12 @@
#!/bin/bash
set -x
echo "Running $0"
echo Adding "$1 host.ratchet.internal" to /etc/hosts file
echo $1 host.ratchet.internal >> /etc/hosts
echo /etc/hosts contains:
cat /etc/hosts
echo

View File

@ -5,7 +5,7 @@
, "outdir": "/reports/servers"
, "servers": [{
"agent": "RatchetRFC/0.1.0"
, "url": "ws://host.docker.internal:9001"
, "url": "ws://host.ratchet.internal:9001"
, "options": {"version": 18}
}]
, "cases": [

View File

@ -5,10 +5,10 @@
, "outdir": "/reports/servers"
, "servers": [{
"agent": "RatchetRFC/0.1.0"
, "url": "ws://host.docker.internal:9001"
, "url": "ws://host.ratchet.internal:9001"
, "options": {"version": 18}
}]
, "cases": ["*"]
, "cases": ["9"]
, "exclude-cases": ["12.*", "13.*"]
, "exclude-agent-cases": {}
}

View File

@ -36,13 +36,18 @@ sleep 2
php -d memory_limit=256M startServer.php &
sleep 3
if [ "$OSTYPE" = "linux-gnu" ]; then
IPADDR=`hostname -I | cut -f 1 -d ' '`
else
IPADDR=`ifconfig | grep "inet " | grep -Fv 127.0.0.1 | awk '{print $2}' | head -1`
fi
docker run --rm \
-it \
-v ${PWD}:/config \
-v ${PWD}/reports:/reports \
--name fuzzingclient \
crossbario/autobahn-testsuite wstest -m fuzzingclient -s /config/fuzzingclient$SKIP_DEFLATE.json
crossbario/autobahn-testsuite /bin/sh -c "sh /config/docker_bootstrap.sh $IPADDR; wstest -m fuzzingclient -s /config/fuzzingclient$SKIP_DEFLATE.json"
sleep 1
# send the shutdown command to the PHP echo server

View File

@ -11,7 +11,7 @@ require_once __DIR__ . "/../bootstrap.php";
$loop = \React\EventLoop\Factory::create();
$socket = new \React\Socket\Server('127.0.0.1:9001', $loop);
$socket = new \React\Socket\Server('0.0.0.0:9001', $loop);
$closeFrameChecker = new \Ratchet\RFC6455\Messaging\CloseFrameChecker;
$negotiator = new \Ratchet\RFC6455\Handshake\ServerNegotiator(new \Ratchet\RFC6455\Handshake\RequestVerifier, PermessageDeflateOptions::permessageDeflateSupported());
@ -41,7 +41,7 @@ $socket->on('connection', function (React\Socket\ConnectionInterface $connection
$negotiatorResponse = $negotiatorResponse->withAddedHeader("Content-Length", "0");
if ($negotiatorResponse->getStatusCode() !== 101 && $psrRequest->getUri()->getPath() === '/shutdown') {
$connection->end(\GuzzleHttp\Psr7\str(new Response(200, [], 'Shutting down echo server.')));
$connection->end(\GuzzleHttp\Psr7\str(new Response(200, [], 'Shutting down echo server.' . PHP_EOL)));
$socket->close();
return;
};