summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* ovs-vsctl: Add tests for database commands.Ben Pfaff2010-01-283-31/+492
| | | | Bug #2396.
* ovs-vsctl: Drop redundant {port,iface}-{set,get}-external-ids commands.Ben Pfaff2010-01-271-16/+16
| | | | | | | | These commands can be implemented just as well, and in a more general-purpose way, using the "set", "remove", and "get" commands. The br-{get,set}-external-ids commands have slightly more specialized behavior and so we can't drop them (yet).
* daemon: Make --monitor process change its process title.Ben Pfaff2010-01-262-1/+4
| | | | | | | | | | 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>
* tests: Fix ovsdb tests.Ben Pfaff2010-01-261-9/+1
| | | | | | | | | This code was updated to use the new name of the schema, but I accidentally left in the old code to check for the old schema's name. This worked fine in my own tests, because I still have a copy of that file sitting around, but fails on "make distcheck" or a clean source dir. So this commit deletes the code that checks for the old schema file.
* ovsdb: Require column type "min" value be 0 or 1.Ben Pfaff2010-01-262-15/+18
| | | | | | | | | | A "min" value greater than 1 is problematic for the database. There is no reasonable way to synthesize a default value for such a column: keys in a set or map must unique, so the database cannot, say, simply set a set of 3 or more integers to [0, 0, 0]. This should have no effect on the vswitch in practice because it does not have any columns that require more than one element.
* json: Export function to parse an individual JSON string.Ben Pfaff2010-01-261-1/+4
| | | | | | | | | The JSON syntax for strings is very reasonable. An upcoming commit will have a need for a string parser, so make the JSON string parser available for that. Also, this change improves the error message for strings that end in the middle of a \u sequence, so update the tests to match.
* Cleanly separate IDL annotations from OVSDB schema information.Ben Pfaff2010-01-266-35/+35
| | | | | | | | | | | | | | | | | Until now, the OVSDB IDL annotations have been glommed together with the schema information in a single file, and then we've used ovsdb-idlc to extract the schema from that file. This commit reverses the process: the schema and the annotations are stored separately and then glommed together as necessary at build time. This new arrangement has a few advantages: - We can now easily have multiple different sets of IDL annotations for a single OVSDB schema. For example, some users may not need access to columns that other users do. - Bugs in ovsdb-idlc cannot screw up the underlying schema (as shown by a recent commit).
* tests: Prefer $(VAR) over @VAR@ in Makefiles.Ben Pfaff2010-01-261-5/+5
| | | | | The Autoconf documentation recently started recommending $(VAR) over @VAR@, so adopt this style.
* Add build checks for portable OpenFlow structure padding and alignment.Ben Pfaff2010-01-254-2/+47
| | | | | This causes the build to fail with an error message if openflow.h contains a structure whose members are not aligned in a portable way.
* daemon: Add support for process monitoring and restart.Ben Pfaff2010-01-153-0/+167
|
* tests: New macro OVS_WAIT_WHILE.Ben Pfaff2010-01-152-3/+6
| | | | For use by upcoming tests.
* tests: Factor OVSDB_INIT out of OVS_VSCTL_SETUP for other tests to use.Ben Pfaff2010-01-154-17/+26
| | | | New tests in upcoming commits will use this.
* fatal-signal: After fork, clear hooks instead of disabling them.Ben Pfaff2010-01-151-2/+2
| | | | | | | | | | | | | | | | | | | Until now, fatal_signal_fork() has simply disabled all the fatal signal callback hooks. This worked fine, because a daemon process forked only once and the parent didn't do much before it exited. But upcoming commits will introduce a --monitor option, which requires processes to fork multiple times. Sometimes the parent process will fork, then run for a while, then fork again. It's not good to disable the hooks in the child process in such a case, because that prevents e.g. pidfiles from being removed at the child's exit. So this commit changes the semantics of fatal_signal_fork() to just clearing out hooks. After hooks are cleared, new hooks can be added and will be executed on process termination in the usual way. This commit also introduces a cancellation callback function so that a canceled hook can free resources.
* tests: Improve error reporting for timeval test failures.Ben Pfaff2010-01-151-2/+9
|
* reconnect: Fix repeated RECONNECT_CONNECT that was confusing JSON-RPC.Ben Pfaff2010-01-111-40/+32
| | | | | | | | | | | | | | | | | | | | reconnect_run() returns RECONNECT_CONNECT to tell the client that it should start a new connection. The client is then supposed to call reconnect_connecting() to tell the FSM that it has begun a connection attempt. However, even after reconnect_connecting() was called, reconnect_run() continued to return RECONNECT_CONNECT on each call until the connection succeeded or failed. This confused the jsonrpc_session client, which expected that it would get a 0 return value from reconnect_run() while the connection attempt was in progress. Connections that required multiple trips through the main poll loop, e.g. for SSL negotiation, would often get cut off to start a second connection attempt. This commit change reconnect_run() to return RECONNECT_CONNECT only until the client tells it that a connection is in progress, which fixes the problem. This change entails a change to the internal details of the reconnect FSM, so this commit also updates the reconnect tests to match. Reported by Jeremy Stribling.
* ovsdb: Add tests for OVSDB protocol over SSL.Ben Pfaff2010-01-115-4/+205
|
* tests: Make test-vconn build and pass tests without OpenSSL.Ben Pfaff2010-01-081-0/+2
|
* tests: Improve vconn tests.Ben Pfaff2010-01-086-48/+74
|
* Distribute some forgotten files that are needed by "make check".Ben Pfaff2010-01-071-0/+5
|
* vconn: Test SSL vconns too.Ben Pfaff2010-01-076-108/+352
| | | | | | This test should help avoid simple bugs in the SSL vconn and SSL stream implementations in the future. It would have found the bugs fixed by recent commits.
* stream: Really enable SSL streams.Ben Pfaff2010-01-071-1/+1
| | | | SSL streams were supposed to work, but they didn't. Oops.
* Remove "fault" module.Ben Pfaff2010-01-062-3/+1
| | | | | | | | | This module, which catches segmentation faults and prints a backtrace before exiting, was useful for a while, but I believe that it has now outlived its purpose. It is altogether better to have a core dump from which one can extract much more information than a usually-poor backtrace, and core dumps are much better integrated into a typical Unix system. In addition, the "fault" module was of course not all that portable.
* Add SSL support to "stream" library and OVSDB.Ben Pfaff2010-01-062-2/+18
|
* vconn: Convert vconn code to modern OVS structure.Ben Pfaff2010-01-061-0/+8
| | | | | | | | | | | | The vconn code is a relative fossil as OVS code goes. It was written before we had really figured how code should fit together. Part of that history is that it used poll_fd_callback() to register callbacks without the assistance of other code. That isn't how the rest of OVS works now; this code is the only remaining user of that function. To make it more like the rest of the system, this code gets rid of the use of poll_fd_callback(). It also adds vconn_run() and vconn_run_wait() functions and calls to them from the places where they are now required.
* fatal-signal: Run signal hooks outside of actual signal handlers.Jesse Gross2010-01-061-2/+0
| | | | | | | Rather than running signal hooks directly from the actual signal handler, simply record the fact that the signal occured and run the hook next time around the poll loop. This allows significantly more freedom as to what can actually be done in the signal hooks.
* ovsdb-server: Make database connections configurable from database itself.Ben Pfaff2010-01-044-4/+37
| | | | | Most importantly this adds a "managers" column to the vswitch database that specifies where the ovsdb-server should connect.
* reconnect: Add connection attempt limiting feature.Ben Pfaff2010-01-042-0/+93
| | | | | | | Sometimes it is useful to limit the number of connection attempts, either from policy or because it is not possible to reconnect at all (e.g. because a connection was accepted from a listening socket instead of made with connect()). This commit adds that feature.
* testsuite: Look for .ovsschema files in source dir as well as build dir.Ben Pfaff2009-12-172-3/+20
| | | | | | | | | When a distribution is built with "make dist", the .ovsschema files are included as part of it, so that the builder does not have to have Python installed. However in that case the distributed .ovsschema files are in the source dir instead of the build dir. The testsuite always expected them in the latter directory. This commit makes it look for them in both places.
* test-json: Avoid use of /dev/stdin to fix builds in limited chroots.Ben Pfaff2009-12-171-12/+8
| | | | | | The chroots in which we often build Open vSwitch don't have /proc and thus cannot support /dev/stdin, because on Linux that is a symlink to /proc/self/fd/0. So avoid using /dev/stdin in the testsuite.
* Make ovs-vswitchd report when it is done configuring; make ovs-vsctl wait.Ben Pfaff2009-12-163-4/+27
| | | | | | | | | | | | | | | | | Until now the ovsdb-based vswitch has provided no way to know when it has finished applying the configuration from the database. This commit introduces a way: * The client who wants to wait increments the "next_cfg" column of the Open_vSwitch record. * When ovs-vswitchd finishes reconfiguring, it sets the value of the "cur_cfg" column to that of the "next_cfg" column. * The client waits until the "cur_cfg" column is at least as great as the value it set into "next_cfg". This allows us to drop the 5-second sleep in interface-reconfigure.
* ovsdb: Add "comment" feature to transactions and make ovs-vsctl use them.Ben Pfaff2009-12-161-0/+18
| | | | | | The idea here is that transaction comments get copied to the ovsdb-server's transaction log, which can then make it clear later why a particular change was made to the database, to ease debugging.
* ovsdb: Add new "mutation" operation to transactions.Ben Pfaff2009-12-165-0/+871
|
* json: Accurately parse very large real numbers.Ben Pfaff2009-12-161-0/+8
| | | | | | The test for whether a real number was outside the valid range was imprecise and failed at the edge of the real range. This commit changes the code to use the C library's strtod(), which presumably does better.
* Clean-up compiler warnings about ignoring return valuesJustin Pettit2009-12-151-1/+1
| | | | | | | Some systems complain when certain functions' return values are not checked. This commit fixes those warnings. Creating ignore() function suggested by Ben Pfaff.
* ovsdb: Fix segfault when a column set contains an invalid column name.Ben Pfaff2009-12-112-1/+9
|
* ovsdb: Cleanly abort delete operations.Ben Pfaff2009-12-111-0/+26
|
* ovs-vsctl: Add --if-exists options to del-br, del-port commands.Ben Pfaff2009-12-101-11/+26
| | | | | These options make it easier to reimplement interface-reconfigure using ovs-vsctl.
* Update .gitignore filesJustin Pettit2009-12-101-0/+16
|
* ovs-vsctl: New commands for working with external IDs.Ben Pfaff2009-12-091-0/+81
| | | | | This aids XenServer integration and should make it easier to integrate with other environments in the future as well.
* ovs-vsctl: Fix performance problem.Ben Pfaff2009-12-091-0/+1
|
* ovs-vsctl: Fix bugs.Ben Pfaff2009-12-091-51/+31
| | | | The full ovs-vsctl test suite now passes.
* vsctl: Start making it work with ovsdb.Ben Pfaff2009-12-081-75/+103
| | | | | | | | This passes at least one test (the one named "add-br a"). It probably doesn't pass any more than that. This is *way* not up to my quality standards, but we are in a super hurry so I'm pushing it anyhow.
* ovsdb-idl: Update IDL data when "set" functions are called.Ben Pfaff2009-12-081-6/+1
| | | | | | | Until now, the "set" functions generated by the IDL updated the data in the database (during commit) but not the data exposed by the IDL in its data structures. This was just an oversight, so this commit causes the data exposed by IDL to be updated also.
* ovsdb-idl: Make it possible to write data through the IDL.Ben Pfaff2009-12-072-3/+134
| | | | | Until now the IDL has been exclusively a read-only interface. This commit introduces a general-purpose interface for writing to ovsdb via the IDL.
* ovsdb: Implement new "declare" operation.Ben Pfaff2009-12-072-13/+14
|
* ovsdb-idlc: Add rules to make sure .h files get generated before .c files.Ben Pfaff2009-12-071-0/+1
| | | | | The .c files #include the .h files so the .h files need to be generated first.
* Distribute ovsdb-idlc built sources, so Python is not required for build.Ben Pfaff2009-12-031-0/+1
| | | | | | | The Xen DDK VM does not include Python, so it's best if we don't have to require it for the build. The built sources are still regenerated if necessary.
* json: Improve error reporting.Ben Pfaff2009-12-032-6/+10
|
* ovsdb: Fix race conditions in test suite.Ben Pfaff2009-12-034-8/+24
|
* ovsdb-idl: Fix resolution of references from one table to another.Ben Pfaff2009-12-033-67/+102
| | | | | | Our tests only checked references from a table to itself, so of course there were bugs in references from one table to another. This fixes the obvious one and adds a test.