summaryrefslogtreecommitdiff
path: root/tests/test-jsonrpc.c
Commit message (Collapse)AuthorAgeFilesLines
* lib: Move lib/poll-loop.h to include/openvswitchXiao Liang2017-11-031-1/+1
| | | | | | | | Poll-loop is the core to implement main loop. It should be available in libopenvswitch. Signed-off-by: Xiao Liang <shaw.leon@gmail.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* Add support for specifying SSL connection parameters to ovsdbEthan Rahn2016-11-101-1/+2
| | | | | Signed-off-by: Ethan Rahn <erahn@arista.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* Add read-only option to ovs-dpctl and ovs-ofctl commands.Ryan Moats2016-08-151-5/+5
| | | | | | | | | ovs-dpctl and ovs-ofctl lack a read-only option to prevent running of commands that perform read-write operations. Add it and the necessary scaffolding to each. Signed-off-by: Ryan Moats <rmoats@us.ibm.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* json: Move from lib to include/openvswitch.Terry Wilson2016-07-221-1/+1
| | | | | | | | | | | | | | | To easily allow both in- and out-of-tree building of the Python wrapper for the OVS JSON parser (e.g. w/ pip), move json.h to include/openvswitch. This also requires moving lib/{hmap,shash}.h. Both hmap.h and shash.h were #include-ing "util.h" even though the headers themselves did not use anything from there, but rather from include/openvswitch/util.h. Fixing that required including util.h in several C files mostly due to OVS_NOT_REACHED and things like xmalloc. Signed-off-by: Terry Wilson <twilson@redhat.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* lib/daemon: support --user option for all OVS daemonAndy Zhou2015-09-301-1/+1
| | | | | | | | | | OVS daemons can now support --user option to run as a non-root user with less privileges. See the manpage patch for more descriptions. Signed-off-by: Andy Zhou <azhou@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* command-line: add ovs_cmdl_contextRussell Bryant2015-03-171-15/+18
| | | | | | | | | | | | | | | | | | | | | | | I started working on a new command line utility that used this shared code. I wanted the ability to pass some data from common initialization code to all of the commands. You can find a similar pattern in ovs-vsctl. This patch updates the command handler to take a new struct, ovs_cmdl_context, instead of argc and argv directly. It includes argc and argv, but also includes an opaque type (void *), where the user of this API can attach its custom data it wants passed along to command handlers. This patch affected the ovstest sub-programs, as well. The patch includes a bit of an odd hack to OVSTEST_REGISTER() to avoid making the main() function of the sub-programs take a ovs_cmdl_context. The test main() functions still receive argc and argv directly, as that seems more natural. The test-subprograms themselves are able to make use of a context internally, though. Signed-off-by: Russell Bryant <rbryant@redhat.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* command-line: add ovs_cmdl_ prefixRussell Bryant2015-03-161-6/+6
| | | | | | | | | | | | | | | | | The coding style guidelines include the following: - Pick a unique name prefix (ending with an underscore) for each module, and apply that prefix to all of that module's externally visible names. Names of macro parameters, struct and union members, and parameters in function prototypes are not considered externally visible for this purpose. This patch adds the new prefix to the externally visible names. This makes it a bit more obvious what code is coming from common command line handling code. Signed-off-by: Russell Bryant <rbryant@redhat.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* lib: Move vlog.h to <openvswitch/vlog.h>Thomas Graf2014-12-151-1/+1
| | | | | | | | A new function vlog_insert_module() is introduced to avoid using list_insert() from the vlog.h header. Signed-off-by: Thomas Graf <tgraf@noironetworks.com> Acked-by: Ben Pfaff <blp@nicira.com>
* lib: Move compiler.h to <openvswitch/compiler.h>Thomas Graf2014-12-151-1/+1
| | | | | | | | | | The following macros are renamed to avoid conflicts with other headers: * WARN_UNUSED_RESULT to OVS_WARN_UNUSED_RESULT * PRINTF_FORMAT to OVS_PRINTF_FORMAT * NO_RETURN to OVS_NO_RETURN Signed-off-by: Thomas Graf <tgraf@noironetworks.com> Acked-by: Ben Pfaff <blp@nicira.com>
* ovs_assert, tests: Support NDEBUG.Jarno Rajahalme2014-10-301-4/+2
| | | | | | | | | | | | | | | | | ./configure accepts --enable-ndebug option. Make ovs_assert() honor it, and make sure all test programs disable it. The order of include files in test programs is also made uniform: 1. #include <config.h> 2. #undef NDEBUG 3. Include file of the test subject (to make sure it itself has sufficient include directives). 4. System includes in alphapetical order. 5. OVS includes in aplhapetical order. Suggested-by: Ben Pfaff <blp@nicira.com> Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* command-line: Add function to print command usage.Alex Wang2014-10-281-5/+5
| | | | | | | | | | | | | This commit adds a new variable in 'struct command' for recording the command usage. Also, a new function is added to print the usage given the array of defined commands. Later patch will use the output in bash command-line completion script. Signed-off-by: Alex Wang <alexw@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* compiler: Define NO_RETURN for MSVC.Gurucharan Shetty2014-09-151-1/+1
| | | | | | | | | | | | | To prevent warnings such as "Not all control paths return a value", we should define NO_RETURN for MSVC. Currently for gcc, we add NO_RETURN at the end of function declaration. But for MSVC, "__declspec(noreturn)" is needed at the beginning of function declaration. So this commit moves NO_RETURN to the beginning of the function declaration as it works with gcc and clang too. Signed-off-by: Gurucharan Shetty <gshetty@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* test-jsonrpc: Add the ability to detach on Windows.Gurucharan Shetty2014-06-121-0/+1
| | | | | Signed-off-by: Gurucharan Shetty <gshetty@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* Avoid static declarations of arrays with unknown size.Gurucharan Shetty2014-04-041-3/+8
| | | | | | | | | | | Visual studio does not like it. This commit is similar to commit 3815d6c2c (Avoid designated initializers and static decls of arrays of unknown size.) but touches more files. Signed-off-by: Gurucharan Shetty <gshetty@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* unit-test: Link 29 test programs into ovstestAndy Zhou2014-04-031-4/+6
| | | | | | | | | | | | | | Improve link speed by linking 29 test programs into ovstest. On my machine, running the following command against a fully built tree: $ touch lib/random.c; time make Improve the overall build time from 7 seconds to 3.5 seconds. Signed-off-by: Andy Zhou <azhou@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* Make most "struct option" instances "const".Ben Pfaff2013-05-031-2/+2
| | | | | | | | Reducing non-const static data makes code more obviously thread-safe. Although option parsing does not normally need to be thread-safe, I don't know of a drawback to making its data const. Signed-off-by: Ben Pfaff <blp@nicira.com>
* Global replace of Nicira Networks.Raju Subramanian2012-05-021-1/+1
| | | | | | | | Replaced all instances of Nicira Networks(, Inc) to Nicira, Inc. Feature #10593 Signed-off-by: Raju Subramanian <rsubramanian@nicira.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* Allow configuring DSCP on controller and manager connections.Mehak Mahajan2012-03-231-3/+5
| | | | | | | | | | | The changes allow the user to specify a separate dscp value for the controller connection and the manager connection. The value will take effect on resetting the connections. If no value is specified a default value of 192 is chosen for each of the connections. Feature #10074 Requested-by: Rajiv Ramanathan <rramanathan@nicira.com> Signed-off-by: Mehak Mahajan <mmahajan@nicira.com>
* jsonrpc: Make jsonrpc_error() internal.Ben Pfaff2012-02-271-12/+14
| | | | | | | | This function is an implementation detail. The JSONRPC unit test used it, but not for any good reason, so this commit changes the test to avoid using it. Signed-off-by: Ben Pfaff <blp@nicira.com>
* Consistently write null pointer constants as NULL instead of 0.Ben Pfaff2011-05-161-4/+4
| | | | Found with sparse.
* stream-ssl: Improve messages when configuring SSL if it is unsupported.Ben Pfaff2011-05-101-5/+1
| | | | | | | | | | | | | | Previously, if --private-key or another option that requires SSL support was used, but OVS was built without OpenSSL support, then OVS would fail with an error message that the specified option was not supported. This confused users because it made them think that the option had been removed: http://openvswitch.org/pipermail/discuss/2011-April/005034.html This commit improves the error message: OVS will now report that it was built without SSL support. This should be make the problem clear to users. Reported-by: Aaron Rosen <arosen@clemson.edu> Feature #5325.
* daemon: Integrate checking for an existing pidfile into daemonize_start().Ben Pfaff2011-04-041-2/+0
| | | | | | | | | | | | Until now, it has been the responsibility of an individual daemon to call die_if_already_running() at an appropriate time. A long time ago, this had to happen *before* daemonizing, because once the process daemonized itself there was no way to report failure to the process that originally started the daemon. With the introduction of daemonize_start(), this is now possible, but we haven't been taking advantage of it. Therefore, this commit integrates the die_if_already_running() call into daemonize_start() and deletes the calls to it from individual daemons.
* daemon: Define daemon options enums the same way as other option enums.Ben Pfaff2011-02-071-2/+3
| | | | | | | Other modules that accept options use this style and I don't see a reason for the daemon code to be different. The style used by the daemon code until now runs the risk of ending up with conflicting values accidentally, which would be confusing.
* Implement initial Python bindings for Open vSwitch database.Ben Pfaff2010-08-251-1/+1
| | | | | | | | | | These initial bindings pass a few hundred of the corresponding tests for C implementations of various bits of the Open vSwitch library API. The poorest part of them is actually the Python IDL interface in ovs.db.idl, which has not received enough attention yet. It appears to work, but it doesn't yet support writes (transactions) and it is difficult to use. I hope to improve it as it becomes clear what semantics Python applications actually want from an IDL.
* vlog: Remove explicit calls to vlog_init().Ben Pfaff2010-07-211-1/+0
| | | | This is no longer necessary.
* timeval: Make time_init() static and remove calls to it.Ben Pfaff2010-07-211-1/+0
| | | | | | Since the timeval module now initializes itself on-demand, there is no longer any need to initialize it explicitly, or to provide an interface to do so.
* ovsdb: Use port 6632 as a default port for database connections.Ben Pfaff2010-04-121-3/+3
| | | | | Until now we have required a port number to be specified explicitly for database connections. This commit adopts port 6632 as a default.
* stream: Generalize stream_open_block().Ben Pfaff2010-04-121-2/+2
| | | | | | This change makes it possible to separate opening a stream from blocking on connection completion. This avoids some code redundancy in an upcoming commit.
* Merge "master" into "next".Ben Pfaff2010-02-111-4/+4
| | | | | The main change here is the need to update all of the uses of UNUSED in the next branch to OVS_UNUSED as it is now spelled on "master".
* tests: Fix memory leaks in test programs.Ben Pfaff2010-02-021-1/+2
| | | | | | This makes it easier to see memory leaks in the code under test. Found with valgrind.
* daemon: Make --monitor process change its process title.Ben Pfaff2010-01-261-1/+2
| | | | | | | | | | When --monitor is used, administrators sometimes become confused about the presence of two copies of each process. This commit attempts to clarify the situation by making the monitoring process change its process name, as seen in /proc/$pid/cmdline and in "ps", to clearly indicate what is going on. CC: Dan Wendlandt <dan@nicira.com>
* Add SSL support to "stream" library and OVSDB.Ben Pfaff2010-01-061-1/+17
|
* jsonrpc: Make it easy to get a new JSON-RPC request's id.Ben Pfaff2009-12-021-1/+1
|
* Implement JSON-RPC protocol.Ben Pfaff2009-11-041-0/+323