Compare commits
1 Commits
nilmrun-1.
...
nilmrun-1.
Author | SHA1 | Date | |
---|---|---|---|
38c3e67cf9 |
@@ -352,8 +352,10 @@ class TestClient(object):
|
|||||||
# start some processes
|
# start some processes
|
||||||
a = client.post("run/command", { "argv": ["sleep","60"] } )
|
a = client.post("run/command", { "argv": ["sleep","60"] } )
|
||||||
b = client.post("run/command", { "argv": ["sh","-c","sleep 2;true"] } )
|
b = client.post("run/command", { "argv": ["sh","-c","sleep 2;true"] } )
|
||||||
c = client.post("run/command", { "argv": ["sh","-c","dd if=/dev/zero of=/dev/null;true"] } )
|
c = client.post("run/command", { "argv": [
|
||||||
d = client.post("run/command", { "argv": ["dd", "if=/dev/zero", "of=/dev/null" ] } )
|
"sh","-c","dd if=/dev/zero of=/dev/null;true"] } )
|
||||||
|
d = client.post("run/command", { "argv": [
|
||||||
|
"dd", "if=/dev/zero", "of=/dev/null" ] } )
|
||||||
|
|
||||||
info = client.get("process/info")
|
info = client.get("process/info")
|
||||||
eq_(info["pids"][a]["procs"], 1)
|
eq_(info["pids"][a]["procs"], 1)
|
||||||
@@ -381,7 +383,8 @@ class TestClient(object):
|
|||||||
client = HTTPClient(baseurl = testurl, post_json = True)
|
client = HTTPClient(baseurl = testurl, post_json = True)
|
||||||
eq_(client.get("process/list"), [])
|
eq_(client.get("process/list"), [])
|
||||||
def verify(cmd, result):
|
def verify(cmd, result):
|
||||||
pid = client.post("run/command", { "argv": [ "/bin/bash", "-c", cmd ] })
|
pid = client.post("run/command", { "argv": [
|
||||||
|
"/bin/bash", "-c", cmd ] })
|
||||||
eq_(client.get("process/list"), [pid])
|
eq_(client.get("process/list"), [pid])
|
||||||
status = self.wait_end(client, pid)
|
status = self.wait_end(client, pid)
|
||||||
eq_(result, status["log"])
|
eq_(result, status["log"])
|
||||||
|
Reference in New Issue
Block a user