From 4d06ad21f284cd2687573ff9960fb87aa44be19a Mon Sep 17 00:00:00 2001 From: bnewbold Date: Tue, 25 Dec 2012 23:35:29 +0100 Subject: comment socket code; enforce only one client connection --- test_exmachina.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'test_exmachina.py') 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) -- cgit v1.2.3