summaryrefslogtreecommitdiffstats
path: root/testing/mozbase/mozprocess/tests/scripts
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--testing/mozbase/mozprocess/tests/scripts/ignore_sigterm.py13
-rw-r--r--testing/mozbase/mozprocess/tests/scripts/infinite_loop.py18
-rw-r--r--testing/mozbase/mozprocess/tests/scripts/proccountfive.py2
-rw-r--r--testing/mozbase/mozprocess/tests/scripts/procnonewline.py4
4 files changed, 37 insertions, 0 deletions
diff --git a/testing/mozbase/mozprocess/tests/scripts/ignore_sigterm.py b/testing/mozbase/mozprocess/tests/scripts/ignore_sigterm.py
new file mode 100644
index 0000000000..15870d6267
--- /dev/null
+++ b/testing/mozbase/mozprocess/tests/scripts/ignore_sigterm.py
@@ -0,0 +1,13 @@
+import signal
+import time
+
+signal.pthread_sigmask(signal.SIG_SETMASK, {signal.SIGTERM})
+
+
+def main():
+ while True:
+ time.sleep(1)
+
+
+if __name__ == "__main__":
+ main()
diff --git a/testing/mozbase/mozprocess/tests/scripts/infinite_loop.py b/testing/mozbase/mozprocess/tests/scripts/infinite_loop.py
new file mode 100644
index 0000000000..9af60b3811
--- /dev/null
+++ b/testing/mozbase/mozprocess/tests/scripts/infinite_loop.py
@@ -0,0 +1,18 @@
+import signal
+import sys
+import threading
+import time
+
+if "deadlock" in sys.argv:
+ lock = threading.Lock()
+
+ def trap(sig, frame):
+ lock.acquire()
+
+ # get the lock once
+ lock.acquire()
+ # and take it again on SIGTERM signal: deadlock.
+ signal.signal(signal.SIGTERM, trap)
+
+while 1:
+ time.sleep(1)
diff --git a/testing/mozbase/mozprocess/tests/scripts/proccountfive.py b/testing/mozbase/mozprocess/tests/scripts/proccountfive.py
new file mode 100644
index 0000000000..39fabee508
--- /dev/null
+++ b/testing/mozbase/mozprocess/tests/scripts/proccountfive.py
@@ -0,0 +1,2 @@
+for i in range(0, 5):
+ print(i)
diff --git a/testing/mozbase/mozprocess/tests/scripts/procnonewline.py b/testing/mozbase/mozprocess/tests/scripts/procnonewline.py
new file mode 100644
index 0000000000..341a94be0a
--- /dev/null
+++ b/testing/mozbase/mozprocess/tests/scripts/procnonewline.py
@@ -0,0 +1,4 @@
+import sys
+
+print("this is a newline")
+sys.stdout.write("this has NO newline")