summaryrefslogtreecommitdiffstats
path: root/testing/mozbase/mozprocess/tests/scripts
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:22:09 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:22:09 +0000
commit43a97878ce14b72f0981164f87f2e35e14151312 (patch)
tree620249daf56c0258faa40cbdcf9cfba06de2a846 /testing/mozbase/mozprocess/tests/scripts
parentInitial commit. (diff)
downloadfirefox-43a97878ce14b72f0981164f87f2e35e14151312.tar.xz
firefox-43a97878ce14b72f0981164f87f2e35e14151312.zip
Adding upstream version 110.0.1.upstream/110.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/mozbase/mozprocess/tests/scripts')
-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")