From 9c3d5c48694db1018d50aa85acad434f47e5ed0b Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Thu, 13 Dec 2018 00:05:49 +0100 Subject: Initial import --- external/tests/test.py | 12 ++++++++++++ external/tests/testmod.py | 11 +++++++++++ 2 files changed, 23 insertions(+) create mode 100644 external/tests/test.py create mode 100644 external/tests/testmod.py (limited to 'external/tests') diff --git a/external/tests/test.py b/external/tests/test.py new file mode 100644 index 0000000..da9ff38 --- /dev/null +++ b/external/tests/test.py @@ -0,0 +1,12 @@ +from time import sleep +from redis import Redis +from rq import Queue + +from testmod import test + +q = Queue('slices', connection=Redis(host='localhost')) +j = q.enqueue(test) +print(j.result) +while j.result == None: + sleep(1) + print(j.result) diff --git a/external/tests/testmod.py b/external/tests/testmod.py new file mode 100644 index 0000000..e833d21 --- /dev/null +++ b/external/tests/testmod.py @@ -0,0 +1,11 @@ +import subprocess + +def test(): +# proc = subprocess.Popen(['env'], stdout=subprocess.PIPE) + proc = subprocess.Popen(['nvidia-smi'], stdout=subprocess.PIPE) +# proc = subprocess.Popen(['nvidia-smi', '-q', '-i', '0'], stdout=subprocess.PIPE) +# proc = subprocess.Popen(['ls', '/usr/bin/'], stdout=subprocess.PIPE) +# proc = subprocess.Popen('ls', stdout=subprocess.PIPE) + return proc.stdout.read() + + -- cgit v1.2.3