summaryrefslogtreecommitdiffstats
path: root/testing/mozbase/mozprocess/tests/scripts
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-21 11:44:51 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-21 11:44:51 +0000
commit9e3c08db40b8916968b9f30096c7be3f00ce9647 (patch)
treea68f146d7fa01f0134297619fbe7e33db084e0aa /testing/mozbase/mozprocess/tests/scripts
parentInitial commit. (diff)
downloadthunderbird-9e3c08db40b8916968b9f30096c7be3f00ce9647.tar.xz
thunderbird-9e3c08db40b8916968b9f30096c7be3f00ce9647.zip
Adding upstream version 1:115.7.0.upstream/1%115.7.0upstream
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")