diff options
author | bnewbold <bnewbold@robocracy.org> | 2012-07-11 17:36:55 -0400 |
---|---|---|
committer | bnewbold <bnewbold@robocracy.org> | 2012-07-11 17:36:55 -0400 |
commit | bb0ec725b508e339ff790eb63c0bf193c14a20c7 (patch) | |
tree | b5147a94796e13ea7a724f8e85f68fa6712d2610 /test.py | |
parent | b65c7c3182441543cc00fedda5af87612e218bde (diff) | |
download | exmachina-bb0ec725b508e339ff790eb63c0bf193c14a20c7.tar.gz exmachina-bb0ec725b508e339ff790eb63c0bf193c14a20c7.zip |
basic client library
Diffstat (limited to 'test.py')
-rwxr-xr-x | test.py | 16 |
1 files changed, 12 insertions, 4 deletions
@@ -9,6 +9,8 @@ import bjsonrpc import bjsonrpc.connection import augeas +from exmachina import ExMachinaClient + # ============================================================================= # Command line handling def main(): @@ -17,16 +19,22 @@ def main(): sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) sock.connect(socket_path) + print "========= Testing low level connection" c = bjsonrpc.connection.Connection(sock) print "time: %s" % c.call.test_whattime() - print "files: %s" % c.call.test_listfiles() - print c.call.initd_status("bluetooth") print "/*: %s" % c.call.augeas_match("/*") - print "/files/*: %s" % c.call.augeas_match("/files/*") - print "/files/etc/*: %s" % c.call.augeas_match("/files/etc/*") print "/augeas/*: %s" % c.call.augeas_match("/augeas/*") + print "/etc/* files:" + for name in c.call.augeas_match("/files/etc/*"): + print "\t%s" % name + print c.call.initd_status("bluetooth") print "hostname: %s" % c.call.augeas_get("/files/etc/hostname/*") print "localhost: %s" % c.call.augeas_get("/files/etc/hosts/1/canonical") + print "========= Testing user client library" + client = ExMachinaClient() + print client.augeas.match("/files/etc/*") + print client.initd.restart("bluetooth") + if __name__ == '__main__': main() |