Daemon-Control-Plugin-HotStandby

 view release on metacpan or  search on metacpan

t/10-hot_standby.t  view on Meta::CPAN

ok $out = get_command_output( "$^X -I$ilib $file start" ), "Started system daemon";
like $out, qr/\[Started\]/, "Daemon started for restarting";
ok $out = get_command_output( "$^X -I$ilib $file status" ), "Get status of system daemon.";
like $out, qr/\[Running\]/, "Daemon running for restarting.";
my $start_pid = current_pid();
ok $out = get_command_output( "$^X -I$ilib $file restart" ), "Get status of system daemon.";
like $out, qr/\[Found existing.*\[Started\]/ms, "Daemon restarted.";
my $next_pid = current_pid();
ok $out = get_command_output( "$^X -I$ilib $file status" ), "Get status of system daemon.";

# not sure how to check that $start_pid is still alive for a period of time before being killed at this stage.
isnt $start_pid, $next_pid, "pid file contents swapped";

like $out, qr/\[Running\]/, "Daemon running after restart.";
ok $out = get_command_output( "$^X -I$ilib $file stop" ), "Get status of system daemon.";
like $out, qr/\[Stopped\]/, "Daemon stopped after restart.";

done_testing;



( run in 1.529 second using v1.01-cache-2.11-cpan-39bf76dae61 )