From deb50de0b79dfc06dac8d999e68045b9900438b0 Mon Sep 17 00:00:00 2001 From: tewk <tewk@unknown> Date: Wed, 24 Jul 2002 00:51:22 +0000 Subject: [PATCH] Fixed bug in src/common/slurm_protocol_pack.c, missing a break statement modified srun_emu.pl to follow new task launch design updated port number in testsuite/slurm_unit/slurmd/task_launch-test.c --- src/common/slurm_protocol_pack.c | 2 + testsuite/slurm_unit/slurmd/srun_emu.pl | 49 ++++++------------- .../slurm_unit/slurmd/task_launch-test.c | 2 +- 3 files changed, 19 insertions(+), 34 deletions(-) diff --git a/src/common/slurm_protocol_pack.c b/src/common/slurm_protocol_pack.c index 8d8c3573b91..dd65c97cba6 100644 --- a/src/common/slurm_protocol_pack.c +++ b/src/common/slurm_protocol_pack.c @@ -157,6 +157,7 @@ int pack_msg ( slurm_msg_t const * msg , char ** buffer , uint32_t * buf_len ) break ; case REQUEST_LAUNCH_TASKS : pack_launch_tasks_request_msg ( ( launch_tasks_request_msg_t * ) msg->data , ( void ** ) buffer , buf_len ) ; + break ; case RESPONSE_LAUNCH_TASKS : pack_launch_tasks_response_msg ( ( launch_tasks_response_msg_t * ) msg->data , ( void ** ) buffer , buf_len ) ; break ; @@ -291,6 +292,7 @@ int unpack_msg ( slurm_msg_t * msg , char ** buffer , uint32_t * buf_len ) case REQUEST_LAUNCH_TASKS : unpack_launch_tasks_request_msg ( ( launch_tasks_request_msg_t ** ) & ( msg->data ) , ( void ** ) buffer , buf_len ) ; + break ; case RESPONSE_LAUNCH_TASKS : unpack_launch_tasks_response_msg ( ( launch_tasks_response_msg_t ** ) & ( msg->data ) , ( void ** ) buffer , buf_len ) ; diff --git a/testsuite/slurm_unit/slurmd/srun_emu.pl b/testsuite/slurm_unit/slurmd/srun_emu.pl index f6d56f05c3d..c5067e42284 100755 --- a/testsuite/slurm_unit/slurmd/srun_emu.pl +++ b/testsuite/slurm_unit/slurmd/srun_emu.pl @@ -1,41 +1,24 @@ #!/usr/bin/perl use IO::Socket; - -$pid = fork(); -if ($pid) +my $sock1 = new IO::Socket::INET ( + LocalHost => 'localhost', + LocalPort => '7071', + Proto => 'tcp', + Listen => 1, + Reuse => 1, + ); +while ( true ) { -#stdout - my $sock1 = new IO::Socket::INET ( - LocalHost => 'localhost', - LocalPort => '7071', - Proto => 'tcp', - Listen => 1, - Reuse => 1, - ); my $new_sock1 = $sock1->accept(); - while(<$new_sock1>) + $pid = fork (); + if ($pid) { - print STDOUT $_; - } - close($sock1); - print "CLOSED STD OUT SOCKET" ; -} -else -{ -#stderr - my $sock2 = new IO::Socket::INET ( - LocalHost => 'localhost', - LocalPort => '7072', - Proto => 'tcp', - Listen => 1, - Reuse => 1, - ); - my $new_sock2 = $sock2->accept(); - while(<$new_sock2>) - { - print STDERR $_; + while(<$new_sock1>) + { + print STDOUT $_; + } + close($sock1); + print "CLOSED STD OUT SOCKET" ; } - close($sock2); - print "CLOSED STD ERR SOCKET" ; } diff --git a/testsuite/slurm_unit/slurmd/task_launch-test.c b/testsuite/slurm_unit/slurmd/task_launch-test.c index 67a79035c62..bf22a83300b 100644 --- a/testsuite/slurm_unit/slurmd/task_launch-test.c +++ b/testsuite/slurm_unit/slurmd/task_launch-test.c @@ -16,7 +16,7 @@ int main ( int argc , char* argv[] ) gids[1] = 9999 ; credential . node_list = "TESTING" ; - slurm_set_addr_char ( & slurmd_addr , 7002 , "localhost" ) ; + slurm_set_addr_char ( & slurmd_addr , 7003 , "localhost" ) ; request_msg . msg_type = REQUEST_LAUNCH_TASKS ; request_msg . data = & launch_tasks_msg ; -- GitLab