Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package os-autoinst for openSUSE:Factory checked in at 2026-11-27 19:43:15 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/os-autoinst (Old) and /work/SRC/openSUSE:Factory/.os-autoinst.new.1340718 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "os-autoinst" Fri Nov 27 19:43:15 2026 rev:642 rq:1401039 version:5.1795706630.8b57692 Changes: -------- --- /work/SRC/openSUSE:Factory/os-autoinst/os-autoinst.changes 2026-11-26 15:55:28.164997296 +0100 +++ /work/SRC/openSUSE:Factory/.os-autoinst.new.1340718/os-autoinst.changes 2026-11-27 19:45:54.468119052 +0100 @@ -1,0 +2,6 @@ +Thu Nov 26 15:24:00 UTC 2026 - [email protected] + +- Update to version 5.1795706630.8b57692: + * fix: report command server startup failures + +------------------------------------------------------------------- Old: ---- os-autoinst-5.1795647520.2cff646.obscpio New: ---- os-autoinst-5.1795706630.8b57692.obscpio ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ os-autoinst-devel-test.spec ++++++ --- /var/tmp/diff_new_pack.m2YxRC/_old 2026-11-27 19:45:57.358240679 +0100 +++ /var/tmp/diff_new_pack.m2YxRC/_new 2026-11-27 19:45:57.362240847 +0100 @@ -18,7 +18,7 @@ %define short_name os-autoinst-devel Name: %{short_name}-test -Version: 5.1795647520.2cff646 +Version: 5.1795706630.8b57692 Release: 0 Summary: Test package for %{short_name} License: GPL-2.0-or-later ++++++ os-autoinst-openvswitch-test.spec ++++++ --- /var/tmp/diff_new_pack.m2YxRC/_old 2026-11-27 19:45:57.402242530 +0100 +++ /var/tmp/diff_new_pack.m2YxRC/_new 2026-11-27 19:45:57.405242657 +0100 @@ -19,7 +19,7 @@ %define name_ext -test %define short_name os-autoinst-openvswitch Name: %{short_name}%{?name_ext} -Version: 5.1795647520.2cff646 +Version: 5.1795706630.8b57692 Release: 0 Summary: test package for %{short_name} License: GPL-2.0-or-later ++++++ os-autoinst-test.spec ++++++ --- /var/tmp/diff_new_pack.m2YxRC/_old 2026-11-27 19:45:57.456244803 +0100 +++ /var/tmp/diff_new_pack.m2YxRC/_new 2026-11-27 19:45:57.461245014 +0100 @@ -19,7 +19,7 @@ %define name_ext -test %define short_name os-autoinst Name: %{short_name}%{?name_ext} -Version: 5.1795647520.2cff646 +Version: 5.1795706630.8b57692 Release: 0 Summary: test package for os-autoinst License: GPL-2.0-or-later ++++++ os-autoinst.spec ++++++ --- /var/tmp/diff_new_pack.m2YxRC/_old 2026-11-27 19:45:57.521247539 +0100 +++ /var/tmp/diff_new_pack.m2YxRC/_new 2026-11-27 19:45:57.523247623 +0100 @@ -17,7 +17,7 @@ Name: os-autoinst -Version: 5.1795647520.2cff646 +Version: 5.1795706630.8b57692 Release: 0 Summary: OS-level test automation License: GPL-2.0-or-later ++++++ os-autoinst-5.1795647520.2cff646.obscpio -> os-autoinst-5.1795706630.8b57692.obscpio ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/os-autoinst-5.1795647520.2cff646/commands.pm new/os-autoinst-5.1795706630.8b57692/commands.pm --- old/os-autoinst-5.1795647520.2cff646/commands.pm 2026-11-25 23:58:40.000000000 +0100 +++ new/os-autoinst-5.1795706630.8b57692/commands.pm 2026-11-26 16:23:50.000000000 +0100 @@ -10,6 +10,7 @@ require IPC::System::Simple; use Feature::Compat::Try; use Socket; +use IO::Select; use POSIX '_exit', 'strftime'; use Mojo::JSON 'to_json'; use Mojo::File 'path'; @@ -198,7 +199,14 @@ return $self->reply->not_found; } -sub run_daemon ($port, $isotovideo) { +sub run_daemon ($port, $isotovideo, $status_fh = undef) { + my $report_status = sub ($ok, $msg = '') { + return unless $status_fh; + print {$status_fh} $ok ? "ok\n" : "error: $msg\n"; + CORE::close($status_fh); + undef $status_fh; + }; + # allow up to 20 GiB for uploads of big hdd images $ENV{MOJO_MAX_MESSAGE_SIZE} //= ($bmwqemu::vars{UPLOAD_MAX_MESSAGE_SIZE_GB} // 0) * 1024**3; $ENV{MOJO_INACTIVITY_TIMEOUT} //= ($bmwqemu::vars{UPLOAD_INACTIVITY_TIMEOUT} // 300); @@ -279,11 +287,16 @@ } })->watch($isotovideo, 1, 0); # watch only readable (and not writable) - app->log->info("cmdsrv: daemon reachable under http://*:$port/$bmwqemu::vars{JOBTOKEN}/"); - try { $daemon->run } + try { + $daemon->start; + app->log->info("cmdsrv: daemon reachable under http://*:$port/$bmwqemu::vars{JOBTOKEN}/"); + $report_status->(1); + $daemon->run; + } catch ($e) { print "cmdsrv: failed to run daemon on port $port: $e\n"; # uncoverable statement print port_details($port) if $e =~ /already in use/i; # uncoverable statement + $report_status->(0, $e); # uncoverable statement _exit(1); # uncoverable statement } } @@ -292,6 +305,7 @@ my ($child, $isotovideo); socketpair $child, $isotovideo, AF_UNIX, SOCK_STREAM, PF_UNSPEC or die "cmdsrv: socketpair: $!"; + pipe my $status_reader, my $status_writer or die "cmdsrv: pipe: $!"; $child->autoflush(1); $isotovideo->autoflush(1); @@ -303,8 +317,9 @@ $SIG{CHLD} = 'DEFAULT'; close $child; + close $status_reader; $0 = "$0: commands"; - run_daemon($port, $isotovideo); + run_daemon($port, $isotovideo, $status_writer); Devel::Cover::report() if Devel::Cover->can('report'); _exit(0); # uncoverable statement }, @@ -315,6 +330,28 @@ set_pipes => 0)->start; close $isotovideo; + close $status_writer; + + my $status = ''; + my $select = IO::Select->new($status_reader); + if ($select->can_read(30)) { + $status = <$status_reader> // ''; + } + else { + $process->stop; + $status = "error: timed out waiting for the command server to start\n"; + } + close $status_reader; + + unless ($status =~ /^ok\n?$/) { + my ($reason) = $status =~ /^error: (.*)/; + $reason //= 'command server process exited before reporting startup status'; + chomp $reason; + $process->stop if $process->is_running; + close $child; + die "cmdsrv: failed to start command server on port $port: $reason\n"; + } + $process->on(collected => sub { bmwqemu::diag('commands process exited: ' . shift->exit_status); }); return ($process, $child); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/os-autoinst-5.1795647520.2cff646/t/07-commands.t new/os-autoinst-5.1795706630.8b57692/t/07-commands.t --- old/os-autoinst-5.1795647520.2cff646/t/07-commands.t 2026-11-25 23:58:40.000000000 +0100 +++ new/os-autoinst-5.1795706630.8b57692/t/07-commands.t 2026-11-26 16:23:50.000000000 +0100 @@ -223,6 +223,25 @@ $t->get_ok("$base_url/$job/current_script")->status_is(200)->content_type_is('application/octet-stream'); }; +subtest 'startup failure is reported when port is already in use' => sub { + my $started = eval { commands::start_server($mojoport); 1 }; + my $error = $@; + ok !$started, 'start server failed'; + like $error, qr/^cmdsrv: failed to start command server on port \Q$mojoport\E/, 'startup failure reported'; + like $error, qr/already in use/i, 'actual bind error included in the reason'; +}; + +subtest 'startup timeout is reported when the daemon does not report readiness' => sub { + my $select = Test::MockModule->new('IO::Select'); + $select->redefine(can_read => 0); + my $port = Mojo::IOLoop::Server->generate_port; + my $started = eval { commands::start_server($port); 1 }; + my $error = $@; + $select->unmock_all; + ok !$started, 'start server timed out'; + like $error, qr/^cmdsrv: failed to start command server on port \Q$port\E: timed out waiting for the command server to start/, 'timeout reported'; +}; + kill TERM => $spid; waitpid $spid, 0; combined_like { $cserver->stop() } qr/commands process exited/, 'commands server stopped'; ++++++ os-autoinst.obsinfo ++++++ --- /var/tmp/diff_new_pack.m2YxRC/_old 2026-11-27 19:46:00.272363315 +0100 +++ /var/tmp/diff_new_pack.m2YxRC/_new 2026-11-27 19:46:00.279363610 +0100 @@ -1,5 +1,5 @@ name: os-autoinst -version: 5.1795647520.2cff646 -mtime: 1795647520 -commit: 2cff64600737295259811742b009f046a5bc4c82 +version: 5.1795706630.8b57692 +mtime: 1795706630 +commit: 8b57692179b29b93f8ce7a785c581edfc09561d2
