diff --git a/composer.json b/composer.json index cd789b4..054a8fb 100644 --- a/composer.json +++ b/composer.json @@ -30,7 +30,7 @@ "guzzlehttp/psr7": "^2 || ^1.7" }, "require-dev": { - "phpunit/phpunit": "5.7.*", + "phpunit/phpunit": "^5.7", "react/socket": "^1.3" }, "scripts": { diff --git a/tests/ab/clientRunner.php b/tests/ab/clientRunner.php index a4b9721..c6becbc 100644 --- a/tests/ab/clientRunner.php +++ b/tests/ab/clientRunner.php @@ -17,7 +17,7 @@ require __DIR__ . '/../bootstrap.php'; define('AGENT', 'RatchetRFC/0.3'); -$testServer = "127.0.0.1"; +$testServer = $argc > 1 ? $argv[1] : "127.0.0.1"; $loop = React\EventLoop\Factory::create(); @@ -57,9 +57,9 @@ function getTestCases() { $deferred = new Deferred(); - $connector->connect($testServer . ':9001')->then(function (ConnectionInterface $connection) use ($deferred) { + $connector->connect($testServer . ':9002')->then(function (ConnectionInterface $connection) use ($deferred, $testServer) { $cn = new ClientNegotiator(); - $cnRequest = $cn->generateRequest(new Uri('ws://127.0.0.1:9001/getCaseCount')); + $cnRequest = $cn->generateRequest(new Uri('ws://' . $testServer . ':9002/getCaseCount')); $rawResponse = ""; $response = null; @@ -122,10 +122,10 @@ function runTest($case) $deferred = new Deferred(); - $connector->connect($testServer . ':9001')->then(function (ConnectionInterface $connection) use ($deferred, $casePath, $case) { + $connector->connect($testServer . ':9002')->then(function (ConnectionInterface $connection) use ($deferred, $casePath, $case, $testServer) { $cn = new ClientNegotiator( PermessageDeflateOptions::permessageDeflateSupported() ? PermessageDeflateOptions::createEnabled() : null); - $cnRequest = $cn->generateRequest(new Uri('ws://127.0.0.1:9001' . $casePath)); + $cnRequest = $cn->generateRequest(new Uri('ws://' . $testServer . ':9002' . $casePath)); $rawResponse = ""; $response = null; @@ -181,12 +181,12 @@ function createReport() { $deferred = new Deferred(); - $connector->connect($testServer . ':9001')->then(function (ConnectionInterface $connection) use ($deferred) { + $connector->connect($testServer . ':9002')->then(function (ConnectionInterface $connection) use ($deferred, $testServer) { // $reportPath = "/updateReports?agent=" . AGENT . "&shutdownOnComplete=true"; // we will stop it using docker now instead of just shutting down $reportPath = "/updateReports?agent=" . AGENT; $cn = new ClientNegotiator(); - $cnRequest = $cn->generateRequest(new Uri('ws://127.0.0.1:9001' . $reportPath)); + $cnRequest = $cn->generateRequest(new Uri('ws://' . $testServer . ':9002' . $reportPath)); $rawResponse = ""; $response = null; diff --git a/tests/ab/fuzzingserver.json b/tests/ab/fuzzingserver.json index 3a59bab..9f10403 100644 --- a/tests/ab/fuzzingserver.json +++ b/tests/ab/fuzzingserver.json @@ -1,5 +1,5 @@ { - "url": "ws://127.0.0.1:9001" + "url": "ws://127.0.0.1:9002" , "options": { "failByDrop": false } diff --git a/tests/ab/fuzzingserver_skip_deflate.json b/tests/ab/fuzzingserver_skip_deflate.json index 3b90fc3..9323191 100644 --- a/tests/ab/fuzzingserver_skip_deflate.json +++ b/tests/ab/fuzzingserver_skip_deflate.json @@ -1,5 +1,5 @@ { - "url": "ws://127.0.0.1:9001" + "url": "ws://127.0.0.1:9002" , "options": { "failByDrop": false } diff --git a/tests/ab/run_ab_tests.sh b/tests/ab/run_ab_tests.sh index ed5ca5a..3df4a7d 100644 --- a/tests/ab/run_ab_tests.sh +++ b/tests/ab/run_ab_tests.sh @@ -6,13 +6,13 @@ if [ "$ABTEST" = "client" ]; then -d \ -v ${PWD}:/config \ -v ${PWD}/reports:/reports \ - -p 9001:9001 \ + -p 9002:9002 \ --name fuzzingserver \ crossbario/autobahn-testsuite wstest -m fuzzingserver -s /config/fuzzingserver$SKIP_DEFLATE.json sleep 5 if [ "$TRAVIS" != "true" ]; then echo "Running tests vs Autobahn test client" - ###docker run -it --rm --name abpytest crossbario/autobahn-testsuite wstest --mode testeeclient -w ws://host.docker.internal:9001 + ###docker run -it --rm --name abpytest crossbario/autobahn-testsuite wstest --mode testeeclient -w ws://host.docker.internal:9002 fi php -d memory_limit=256M clientRunner.php @@ -36,7 +36,7 @@ if [ "$ABTEST" = "server" ]; then fi docker run --rm \ - -it \ + -i \ -v ${PWD}:/config \ -v ${PWD}/reports:/reports \ --name fuzzingclient \ @@ -46,5 +46,3 @@ if [ "$ABTEST" = "server" ]; then # send the shutdown command to the PHP echo server wget -O - -q http://127.0.0.1:9001/shutdown fi - -