|
From: <ssc...@us...> - 2003-07-15 02:10:26
|
Update of /cvsroot/popfile/engine/tests
In directory sc8-pr-cvs1:/tmp/cvs-serv16701
Modified Files:
TestConfiguration.tst
Log Message:
update for new pidfile routines
Index: TestConfiguration.tst
===================================================================
RCS file: /cvsroot/popfile/engine/tests/TestConfiguration.tst,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** TestConfiguration.tst 13 Jul 2003 02:40:35 -0000 1.3
--- TestConfiguration.tst 15 Jul 2003 02:10:23 -0000 1.4
***************
*** 52,69 ****
test_assert_equal( $c->global_config_( 'msgdir' ), 'messages/' );
# Check that the PID file gets created and then deleted and
# contains the correct process ID
$c->config_( 'piddir', '../tests/' );
test_assert_equal( $c->start(), 1 );
! test_assert( ( -e 'popfile.pid' ) );
! open PIDFILE, '<popfile.pid';
! my $pid = <PIDFILE>;
! close PIDFILE;
! test_assert_equal( $pid, $$ );
open (STDERR, ">stdout.tmp");
! test_assert_equal( $c->start(), 0 );
close STDERR;
$c->stop();
- test_assert( !( -e 'popfile.pid' ) );
# Check that parameter upgrading works
--- 52,93 ----
test_assert_equal( $c->global_config_( 'msgdir' ), 'messages/' );
+
# Check that the PID file gets created and then deleted and
# contains the correct process ID
+
$c->config_( 'piddir', '../tests/' );
test_assert_equal( $c->start(), 1 );
! test_assert( $c->check_pid_() );
! test_assert_equal( $c->get_pid_(), $$ );
open (STDERR, ">stdout.tmp");
! test_assert_equal( $c->start(), 1 );
! $c->stop();
! test_assert( !$c->check_pid_() );
!
!
! # disable logging
!
! $c->global_config_( 'debug', 0 );
!
! # Check instance coordination via PID file
!
! $c->start();
! $c->{pid_delay__} = 1;
!
! my $process = fork;
!
! if ($process != 0) {
! #parent loop
! test_assert_equal( $c->start(), 0);
! test_assert( !defined( $c->live_check_() ) );
! } elsif ($process == 0) {
! #child loop
! select(undef, undef, undef, $c->{pid_delay__});
! $c->service();
! exit(0);
! }
!
close STDERR;
$c->stop();
# Check that parameter upgrading works
|