aboutsummaryrefslogtreecommitdiffstats
path: root/test_exmachina.py
diff options
context:
space:
mode:
authorbnewbold <bnewbold@robocracy.org>2012-12-25 23:35:29 +0100
committerbnewbold <bnewbold@robocracy.org>2012-12-25 23:35:29 +0100
commit4d06ad21f284cd2687573ff9960fb87aa44be19a (patch)
treef8ef52a8c952f2e0b39fceaafd48991b3d54602f /test_exmachina.py
parent723107806b5a7231752e70a00aef9c5c820adc81 (diff)
downloadexmachina-4d06ad21f284cd2687573ff9960fb87aa44be19a.tar.gz
exmachina-4d06ad21f284cd2687573ff9960fb87aa44be19a.zip
comment socket code; enforce only one client connection
Diffstat (limited to 'test_exmachina.py')
-rwxr-xr-xtest_exmachina.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/test_exmachina.py b/test_exmachina.py
index 301d2d2..b9527f0 100755
--- a/test_exmachina.py
+++ b/test_exmachina.py
@@ -32,16 +32,18 @@ from exmachina import ExMachinaClient
# Command line handling
def main():
- socket_path = "/tmp/exmachina.sock"
- sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
- sock.connect(socket_path)
-
secret_key = None
if sys.argv[-1] == "-k":
print "waiting for key on stdin..."
secret_key = sys.stdin.readline()
print "got it!"
+ """
+ # both tests together won't work now that server exits after single client
+ socket_path = "/tmp/exmachina.sock"
+ sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
+ sock.connect(socket_path)
+
print "========= Testing JSON-RPC connection"
c = bjsonrpc.connection.Connection(sock)
if secret_key:
@@ -55,6 +57,7 @@ def main():
print "hostname: %s" % c.call.augeas_get("/files/etc/hostname/*")
print "localhost: %s" % c.call.augeas_get("/files/etc/hosts/1/canonical")
sock.close()
+ """
print "========= Testing user client library"
client = ExMachinaClient(secret_key=secret_key)