|
|
@@ -83,7 +83,7 @@ class TestClient(object): |
|
|
|
client = HTTPClient(baseurl = testurl, post_json = True) |
|
|
|
|
|
|
|
# start dummy filter |
|
|
|
pid = client.post("/filter/dummy", { "data": 30 }) |
|
|
|
pid = client.post("/run/dummy", { "data": 30 }) |
|
|
|
eq_(client.get("/process/list"), [pid]) |
|
|
|
time.sleep(1) |
|
|
|
|
|
|
@@ -117,7 +117,7 @@ class TestClient(object): |
|
|
|
client = HTTPClient(baseurl = testurl, post_json = True) |
|
|
|
|
|
|
|
# Trigger exception in filter |
|
|
|
pid = client.post("/filter/dummy", { "data": -1 }) |
|
|
|
pid = client.post("/run/dummy", { "data": -1 }) |
|
|
|
time.sleep(0.5) |
|
|
|
status = client.get("/process/status", { "pid": pid }) |
|
|
|
eq_(status["alive"], False) |
|
|
@@ -126,7 +126,7 @@ class TestClient(object): |
|
|
|
client.post("/process/remove", { "pid": pid }) |
|
|
|
|
|
|
|
# Kill a running filter by removing it early |
|
|
|
newpid = client.post("/filter/dummy", { "data": 50 }) |
|
|
|
newpid = client.post("/run/dummy", { "data": 50 }) |
|
|
|
ne_(newpid, pid) |
|
|
|
time.sleep(0.5) |
|
|
|
start = time.time() |
|
|
@@ -141,7 +141,7 @@ class TestClient(object): |
|
|
|
eq_(client.get("/process/list"), []) |
|
|
|
|
|
|
|
# Try to remove a running filter that ignored SIGTERM |
|
|
|
pid = client.post("/filter/dummy", { "data": 0 }) |
|
|
|
pid = client.post("/run/dummy", { "data": 0 }) |
|
|
|
start = time.time() |
|
|
|
status = client.post("/process/remove", { "pid": pid }) |
|
|
|
elapsed = time.time() - start |
|
|
@@ -152,7 +152,7 @@ class TestClient(object): |
|
|
|
|
|
|
|
def test_client_05_trainola_simple(self): |
|
|
|
client = HTTPClient(baseurl = testurl, post_json = True) |
|
|
|
pid = client.post("/filter/trainola", { "data": {} }) |
|
|
|
pid = client.post("/run/trainola", { "data": {} }) |
|
|
|
status = self.wait_end(client, pid) |
|
|
|
ne_(status["exitcode"], 0) |
|
|
|
status = client.post("/process/remove", { "pid": pid }) |
|
|
@@ -191,7 +191,7 @@ class TestClient(object): |
|
|
|
} |
|
|
|
|
|
|
|
# start trainola |
|
|
|
pid = client.post("/filter/trainola", { "data": data }) |
|
|
|
pid = client.post("/run/trainola", { "data": data }) |
|
|
|
|
|
|
|
# wait for it to finish |
|
|
|
for i in range(60): |
|
|
@@ -218,7 +218,7 @@ class TestClient(object): |
|
|
|
eq_(client.get("/process/list"), []) |
|
|
|
|
|
|
|
def do(args, kill): |
|
|
|
pid = client.post("/process/command", { "args": args } ) |
|
|
|
pid = client.post("/run/command", { "args": args } ) |
|
|
|
eq_(client.get("/process/list"), [pid]) |
|
|
|
if kill: |
|
|
|
time.sleep(1) |
|
|
|