]> Sergey Matveev's repositories - public-inbox.git/blobdiff - t/httpd-corner.psgi
qspawn: handle ENOENT (and other errors on exec)
[public-inbox.git] / t / httpd-corner.psgi
index f2427234c05afa8803868c25168af0c01a0d7a90..44629620051eb52424675545f506d1691306ef2a 100644 (file)
@@ -94,6 +94,13 @@ my $app = sub {
                return $qsp->psgi_return($env, undef, sub {
                        [ 200, [ qw(Content-Type application/octet-stream)]]
                });
+       } elsif ($path eq '/psgi-return-enoent') {
+               require PublicInbox::Qspawn;
+               my $cmd = [ 'this-better-not-exist-in-PATH'.rand ];
+               my $qsp = PublicInbox::Qspawn->new($cmd);
+               return $qsp->psgi_return($env, undef, sub {
+                       [ 200, [ qw(Content-Type application/octet-stream)]]
+               });
        } elsif ($path eq '/pid') {
                $code = 200;
                push @$body, "$$\n";