about summary refs log tree commit homepage
path: root/t/sigchld.ru
diff options
context:
space:
mode:
Diffstat (limited to 't/sigchld.ru')
-rw-r--r--t/sigchld.ru22
1 files changed, 22 insertions, 0 deletions
diff --git a/t/sigchld.ru b/t/sigchld.ru
new file mode 100644
index 0000000..4f3b566
--- /dev/null
+++ b/t/sigchld.ru
@@ -0,0 +1,22 @@
+#\ -E none
+use Rack::ContentLength
+use Rack::ContentType, "text/plain"
+run lambda { |env|
+  rv = case env["PATH_INFO"]
+  when "/backtick"
+    `printf 'hi'`
+  when "/system"
+    rv = system("true")
+    rv.to_s
+  when "/fork_ignore"
+    pid = fork {}
+    pid.class.to_s
+  when "/fork_wait"
+    _, status = Process.waitpid2(fork {})
+    status.success?.to_s
+  when "/popen"
+    io = IO.popen('echo popen')
+    io.read
+  end
+  [ 200, {}, [ rv ] ]
+}