]> git.proxmox.com Git - mirror_ovs.git/blobdiff - tests/test-unixctl.py
db-ctl-base: Add {in} and {not-in} set relational operators.
[mirror_ovs.git] / tests / test-unixctl.py
index 3d86db17daa763f1bf4d68afb8be2e5217689895..4fa27b09f82dae4506d8518eddc90f88b495c36b 100644 (file)
@@ -13,7 +13,6 @@
 # limitations under the License.
 
 import argparse
-import sys
 
 import ovs.daemon
 import ovs.unixctl
@@ -22,6 +21,7 @@ import ovs.unixctl.server
 vlog = ovs.vlog.Vlog("test-unixctl")
 exiting = False
 
+
 def unixctl_exit(conn, unused_argv, aux):
     assert aux == "aux_exit"
     global exiting
@@ -36,10 +36,15 @@ def unixctl_echo(conn, argv, aux):
 
 
 def unixctl_echo_error(conn, argv, aux):
-    assert aux ==  "aux_echo_error"
+    assert aux == "aux_echo_error"
     conn.reply_error(str(argv))
 
 
+def unixctl_log(conn, argv, unused_aux):
+    vlog.info(str(argv[0]))
+    conn.reply(None)
+
+
 def unixctl_block(conn, unused_argv, unused_aux):
     pass
 
@@ -64,6 +69,7 @@ def main():
     ovs.unixctl.command_register("exit", "", 0, 0, unixctl_exit, "aux_exit")
     ovs.unixctl.command_register("echo", "[arg ...]", 1, 2, unixctl_echo,
                                  "aux_echo")
+    ovs.unixctl.command_register("log", "[arg ...]", 1, 2, unixctl_log, None)
     ovs.unixctl.command_register("echo_error", "[arg ...]", 1, 2,
                                  unixctl_echo_error, "aux_echo_error")
     ovs.unixctl.command_register("block", "", 0, 0, unixctl_block, None)
@@ -81,11 +87,4 @@ def main():
 
 
 if __name__ == '__main__':
-    try:
-        main()
-    except SystemExit:
-        # Let system.exit() calls complete normally
-        raise
-    except:
-        vlog.exception("traceback")
-        sys.exit(ovs.daemon.RESTART_EXIT_CODE)
+    main()