Try to get IP address sorted out for travis
This commit is contained in:
parent
1a4fa37f06
commit
5c15dd0a2f
@ -246,8 +246,13 @@ getTestCases()->then(function ($count) use ($loop) {
|
|||||||
$allDeferred->resolve();
|
$allDeferred->resolve();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
echo "Running test $i/$count\n";
|
echo "Running test $i/$count...";
|
||||||
runTest($i)->then($runNextCase);
|
$startTime = microtime(true);
|
||||||
|
runTest($i)
|
||||||
|
->then(function () use ($startTime) {
|
||||||
|
echo " completed " . round((microtime(true) - $startTime) * 1000) . " ms\n";
|
||||||
|
})
|
||||||
|
->then($runNextCase);
|
||||||
};
|
};
|
||||||
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
12
tests/ab/docker_bootstrap.sh
Normal file
12
tests/ab/docker_bootstrap.sh
Normal 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
|
@ -5,7 +5,7 @@
|
|||||||
, "outdir": "/reports/servers"
|
, "outdir": "/reports/servers"
|
||||||
, "servers": [{
|
, "servers": [{
|
||||||
"agent": "RatchetRFC/0.1.0"
|
"agent": "RatchetRFC/0.1.0"
|
||||||
, "url": "ws://host.docker.internal:9001"
|
, "url": "ws://host.ratchet.internal:9001"
|
||||||
, "options": {"version": 18}
|
, "options": {"version": 18}
|
||||||
}]
|
}]
|
||||||
, "cases": [
|
, "cases": [
|
||||||
|
@ -5,10 +5,10 @@
|
|||||||
, "outdir": "/reports/servers"
|
, "outdir": "/reports/servers"
|
||||||
, "servers": [{
|
, "servers": [{
|
||||||
"agent": "RatchetRFC/0.1.0"
|
"agent": "RatchetRFC/0.1.0"
|
||||||
, "url": "ws://host.docker.internal:9001"
|
, "url": "ws://host.ratchet.internal:9001"
|
||||||
, "options": {"version": 18}
|
, "options": {"version": 18}
|
||||||
}]
|
}]
|
||||||
, "cases": ["*"]
|
, "cases": ["9"]
|
||||||
, "exclude-cases": ["12.*", "13.*"]
|
, "exclude-cases": ["12.*", "13.*"]
|
||||||
, "exclude-agent-cases": {}
|
, "exclude-agent-cases": {}
|
||||||
}
|
}
|
||||||
|
@ -36,13 +36,18 @@ sleep 2
|
|||||||
php -d memory_limit=256M startServer.php &
|
php -d memory_limit=256M startServer.php &
|
||||||
sleep 3
|
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 \
|
docker run --rm \
|
||||||
-it \
|
-it \
|
||||||
-v ${PWD}:/config \
|
-v ${PWD}:/config \
|
||||||
-v ${PWD}/reports:/reports \
|
-v ${PWD}/reports:/reports \
|
||||||
--name fuzzingclient \
|
--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
|
sleep 1
|
||||||
|
|
||||||
# send the shutdown command to the PHP echo server
|
# send the shutdown command to the PHP echo server
|
||||||
|
@ -11,7 +11,7 @@ require_once __DIR__ . "/../bootstrap.php";
|
|||||||
|
|
||||||
$loop = \React\EventLoop\Factory::create();
|
$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;
|
$closeFrameChecker = new \Ratchet\RFC6455\Messaging\CloseFrameChecker;
|
||||||
$negotiator = new \Ratchet\RFC6455\Handshake\ServerNegotiator(new \Ratchet\RFC6455\Handshake\RequestVerifier, PermessageDeflateOptions::permessageDeflateSupported());
|
$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");
|
$negotiatorResponse = $negotiatorResponse->withAddedHeader("Content-Length", "0");
|
||||||
|
|
||||||
if ($negotiatorResponse->getStatusCode() !== 101 && $psrRequest->getUri()->getPath() === '/shutdown') {
|
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();
|
$socket->close();
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user