Skip to content

Commit

Permalink
Verify parameters passed to core-agent match our expectations
Browse files Browse the repository at this point in the history
  • Loading branch information
asgrim committed Feb 18, 2020
1 parent aa37448 commit 291c06e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/Unit/CoreAgent/LauncherTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ public function testCoreAgentCanBeLaunched() : void

$launcher = new Launcher(
$logger,
'socket-path.sock',
null,
null,
null
'/tmp/socket-path.sock',
'TRACE',
'/tmp/core-agent.log',
'/tmp/core-agent-config.ini'
);

self::assertTrue($launcher->launch(__DIR__ . '/emulated-happy-path.sh'));
Expand Down
8 changes: 8 additions & 0 deletions tests/Unit/CoreAgent/emulated-happy-path.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,12 @@

set -euo pipefail

EXPECTED_PARAMS="start --daemonize true --log-file /tmp/core-agent.log --log-level TRACE --config-file /tmp/core-agent-config.ini --socket /tmp/socket-path.sock"
ACTUAL_PARAMS=$*

if [ "$ACTUAL_PARAMS" != "$EXPECTED_PARAMS" ]; then
>&2 printf "Script params did not match expectations.\n\nExpected: %s\nActual : %s\n" "$EXPECTED_PARAMS" "$ACTUAL_PARAMS"
exit 1
fi

exit 0

0 comments on commit 291c06e

Please sign in to comment.