summaryrefslogtreecommitdiff
path: root/tests/ovsdb-server.at
Commit message (Collapse)AuthorAgeFilesLines
* tests: Add missing banner.Ben Pfaff2014-02-111-0/+2
| | | | | Reported-by: Arun Sharma <arun.sharma@calsoftinc.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* Add IPv6 support for OpenFlow, OVSDB, NetFlow, and sFlow.Arun Sharma2014-02-061-2/+77
| | | | | | | | | | Does not add IPv6 support for in-band control. Co-authored-by: Ben Pfaff <blp@nicira.com> Signed-off-by: Nandan Nivgune <nandan.nivgune@calsoftinc.com> Signed-off-by: Abhijit Bhopatkar <abhijit.bhopatkar@calsoftinc.com> Signed-off-by: Arun Sharma <arun.sharma@calsoftinc.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* tests: Remove \r from source tree.Ben Pfaff2013-12-301-1/+1
| | | | | | | | | | An ovsdb-server test had a literal carriage return in a check that validates a directory name. It isn't really necessary (who puts a carriage return in a directory name?) and it does cause problems for passing around patches via email, so just delete it. CC: Arun Sharma <arun.sharma@calsoftinc.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* jsonrpc-server: Add test for disconnecting connections with too long queues.Ben Pfaff2013-12-131-0/+85
| | | | Signed-off-by: Ben Pfaff <blp@nicira.com>
* tests: fix failure when $PKIDIR contains uuid-like stringYAMAMOTO Takashi2013-10-151-1/+1
| | | | | | | | | | this fixes a test failure with my working directory: /disks/ea6a5743-ad5f-11e2-9410-08606e7f74e7/git/openvswitch stop filtering uuid as it's unnecessary for this specific test case. Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp> Signed-off-by: Ben Pfaff <blp@nicira.com>
* tests: Make ovsdb-server add/remove remote test faster and more reliable.Alex Wang2013-10-141-1/+20
| | | | | | | | | | | | | | | | | | Until now, the "ovsdb-server/add-remote and remove-remote with --monitor" test killed ovsdb-server with SIGSEGV twice. Each time, the "--monitor" option caused the supervisor process to restart the child, but the second time it incurred a 10-second delay intended to prevent the daemon from wasting CPU time by restarting itself and dying again very quickly in a loop. This made the test take over 10 seconds to execute. It also made it occasionally fail because the OVS_WAIT_UNTIL check waits at most approximately 10 seconds before it decides that the condition that it is testing for will never occur. This commit fixes the problem by breaking the test into two tests, each of which kills ovsdb-server with SIGSEGV only once. Signed-off-by: Alex Wang <alexw@nicira.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* tests: Make ovsdb-server add-db/remove-db test faster and more reliable.Ben Pfaff2013-09-161-2/+15
| | | | | | | | | | | | | | | | | | Until now, the "ovsdb-server/add-db and remove-db with --monitor" test killed ovsdb-server with SIGSEGV twice. Each time, the "--monitor" option caused the supervisor process to restart the child, but the second time it incurred a 10-second delay intended to prevent the daemon from wasting CPU time by restarting itself and dying again very quickly in a loop. This made the test take over 10 seconds to execute. It also made it occasionally fail because the OVS_WAIT_UNTIL check waits at most approximately 10 seconds before it decides that the condition that it is testing for will never occur. This commit fixes the problem by breaking the test into two tests, each of which kills ovsdb-server with SIGSEGV only once. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Ethan Jackson <ethan@nicira.com>
* tests: Additional test for run time addition of a database.Gurucharan Shetty2013-07-081-0/+7
| | | | | | Adding a removed database covers a common use case. Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
* ovsdb-server: Add and remove databases during run time.Ben Pfaff2013-06-281-0/+121
| | | | | | | | | | | The commit allows a user to add a database file to a ovsdb-server during run time. One can also remove a database file from ovsdb-server's control. Feature #14595. Signed-off-by: Gurucharan Shetty <gshetty@nicira.com> Co-authored-by: Ben Pfaff <blp@nicira.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* ovsdb-server: Make database name mandatory when specifying db paths.Gurucharan Shetty2013-06-261-4/+4
| | | | | | | | | | | | | | | Currently, if we have just one database, we can optionally skip the database name when providing the DB path for certain options (ex: --remote=db:[db,]table,column). But in case we have multiple databases, it is mandatory. With this commit, we make the database name mandatory. This provides increased flexibility for an upcoming commit that provides the ability to add and remove databases during run time. Feature #14595. Acked-by: Ben Pfaff <blp@nicira.com> Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
* ovsdb-server: Preserve remotes across crash and restart.Ben Pfaff2013-06-131-0/+45
| | | | | | | | | | | | | | Commit b421d2af0ab (ovsdb-server: Add commands for adding and removing remotes) made it possible to make ovsdb-server connect to OVS managers only after ovs-vswitchd has completed its initial configuration. But this results in an undesirable effect: whenever ovsdb-server crashes, the monitor restarts its, but ovsdb-server can no longer connect to the manager because the remotes were added during runtime and that information is lost during the crash. This commit fixes the problem. Signed-off-by: Ben Pfaff <blp@nicira.com>
* invoke perl as ${PERL}YAMAMOTO Takashi2013-04-221-12/+12
| | | | | | | as suggested by Ben Pfaff. Signed-off-by: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp> Signed-off-by: Ben Pfaff <blp@nicira.com>
* tests: Avoid race conditions, by letting the kernel choose ports to bind.Ben Pfaff2013-04-181-13/+13
| | | | | | | | | | | | | | | | | | An occasionally occurring problem with "make check", especially when parallel tests are enabled, is that multiple tests try to bind the same TCP port and, of course, fail. This happens because the code to select a TCP port to bind just generates random numbers until it finds a port that is not currently in use and uses the first one, which is of course prone to races. This commit changes the tests to let the kernel directly choose an available port, which should avoid this type of failure. Also, some of the tests that generated a random free TCP port actually used the port number to bind a UDP socket, which of course doesn't work well. This commit fixes that problem too as a side effect. Signed-off-by: Ben Pfaff <blp@nicira.com>
* ovsdb-server: Add commands for adding and removing remotes at runtime.Ben Pfaff2013-04-101-0/+42
| | | | | | | | | This will make it possible, in later commits, to make ovsdb-server connect to OVS managers only after ovs-vswitchd has completed its initial configuration. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Ansis Atteka <aatteka@nicira.com>
* stream-unix: Use rundir as root for relative paths.Pavithra Ramesh2013-02-111-0/+9
| | | | | | | | | | | | | | Until now, "unix:" and "punix:" paths that are not absolute have been considered relative to the current working directory. It is more useful to consider them relative to the rundir, so this commit makes that change to the C and Python implementations of the stream code. This commit also relaxes the whitelist check in the bridge code so that any name that does not contain a "/" is considered OK. Signed-off-by: Pavithra Ramesh <paramesh@vmware.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* ovsdb/jsonrpc-server: ovsdb-server closes accepted connections immediately.Mehak Mahajan2012-10-041-0/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2012-09-14T05:38:26Z|00001|jsonrpc|WARN|tcp:127.0.0.1:6634: receive error: Con ovsdb-client: transaction failed (Connection reset by peer) NOTE: This occurs intermittently depending on how ovsdb-server runs. Running ovsdb-client on a remote machine increases the possibility. This is because ovsdb-server closes newly accepted tcp connection. The following changesets caused it. struct jsonrpc_session::dscp isn't set based on listening socket's dscp value. - ovsdb-server creates passive connection and listens on it. - ovsdb-server accepts connection by ovsdb_jsonrpc_server_run(). The accepted socket inherits from the listening sockets. ovsdb_jsonrpc_server_run() creates json session, but leaves dscp of struct jsonrpc_session zero. - On calling reconfigure_from_db(), it resets dscp value to all jsonrpc sessions. Eventually jsonrpc_session_set_dscp() is called. Then jsonrpc_session_force_reconnect() closes the connection. With this patch, - struct jsonrpc_session::dscp is correctly set based on listening sockets dscp value. - dscp of listening socket is changed dynamically by setsockopt. This leaves a window where accepted socket may have old dscp. But it is ignored for now because it would complicates codes too much. The related change sets: - 0442efd9b1a88d923b56eab6b72b6be8231a49f7 Reapplying the dscp changes: No need to restart DB/OVS on changing dscp value. - 59efa47adf3234ec51541405726d033173851285 Revert DSCP update changes. - b2e18db292cd4962af3248f11e9f17e6eaf9c033 No need to restart DB / OVS on changing dscp value. - f125905cdd3dc0339ad968c0a70128807884b400 Allow configuring DSCP on controller and manager connections. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Mehak Mahajan <mmahajan@nicira.com>
* ovsdb-server: Add support for multiple databases.Ben Pfaff2012-09-241-14/+47
| | | | | | | | | | The OVSDB protocol has supported multiple databases for a long time, but the ovsdb-server implementation only supported one database at a time. This commit adds support for multiple databases. Feature #12353. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Ethan Jackson <ethan@nicira.com>
* tests: Invoke daemons with --no-chdir so core files appear in test dir.Ben Pfaff2012-08-161-7/+7
| | | | | | | | | | | | | | | | | The OVS daemons "cd" to / as a normal part of their startup, since this is traditional for daemons under Unix. But this also means that, if the daemons happen to terminate with a core in the unit tests, then the core file won't be written because / has too-restrictive permissions. (Unless you run the unit tests as root, or you've got cores configured to go to a non-standard location.) This commit fixes the problem by invoking most daemons with --no-chdir so that the core files go to a test-specific directory. I didn't change invocations of the Python daemons, since Python doesn't normally terminate with a core. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Kyle Mestery <kmestery@cisco.com>
* ovsdb: Do not replace symlinks by regular files during compaction.Ben Pfaff2012-08-011-1/+14
| | | | Signed-off-by: Ben Pfaff <blp@nicira.com>
* tests: Handle different output formats for 'wc -l'.Ed Maste2012-07-301-4/+4
| | | | | | | | FreeBSD's wc outputs leading whitespace before the count, so use test(1) for numeric equality instead of AC_CHECK string match. Signed-off-by: Ed Maste <emaste@freebsd.org> Signed-off-by: Ben Pfaff <blp@nicira.com>
* Use `pwd` in place of $PWD, treewide.Ben Pfaff2012-03-131-17/+17
| | | | | | | | | | | | | | | | | The Autoconf manual says: Posix 1003.1-2001 requires that `cd' and `pwd' must update the `PWD' environment variable to point to the logical name of the current directory, but traditional shells do not support this. This can cause confusion if one shell instance maintains `PWD' but a subsidiary and different shell does not know about `PWD' and executes `cd'; in this case `PWD' points to the wrong directory. Use ``pwd`' rather than `$PWD'. so this commit replaces all uses of $PWD by `pwd`. Reported-by: Justin Pettit <jpettit@nicira.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* tests: Convert *_SCHEMA macros to shell functions.Ben Pfaff2012-03-071-16/+8
| | | | | | | This reduces tests/testsuite by about 70 kB, by collapsing a number of macro expansions into just one copy in a shell function. Signed-off-by: Ben Pfaff <blp@nicira.com>
* tests: Reduce risk of port collision and remove bash dependency.Ben Pfaff2012-02-021-4/+4
| | | | | | | | | | | | A few tests need a random TCP port on which to listen for connections. Until now, the tests have used the $RANDOM bash extension to do this, but this runs the risk of occasionally colliding with an in-use port. This commit removes the bash dependency by switching to using a small Perl program to pick random ports and reduces the risk of collision by attempting to bind the port that it chooses. Reported-by: Timothy Chen <tchen@nicira.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* ovsdb-client: Make "server" and "database" arguments optional.Ben Pfaff2011-07-261-3/+3
| | | | | In practice these arguments are almost always the defaults, so this change makes ovsdb-client much more usable interactively.
* ovsdb: Implement table uniqueness constraints ("indexes").Ben Pfaff2011-06-061-1/+1
|
* lockfile: Don't warn if successful lock takes a little time.Ben Pfaff2011-05-131-6/+6
| | | | | | | | | | | | | This code issues a warning if obtaining a lock takes even 1 millisecond. That's far too aggressive. There's no need to warn if we have to wait a few milliseconds. This function already warns elsewhere if locking takes more than 1 second, which is much more reasonable. This change allows us to test ovsdb-server stderr output more carefully. Before now, the tests had to ignore what ovsdb-server writes to stderr because sometimes it would log a warning that locking took 1 ms (or so). Reviewed-by: Simon Horman <horms@verge.net.au>
* ovsdb-server: Avoid intermittent test failures due to lockfile log message.Ben Pfaff2011-04-011-3/+3
| | | | | | | | | Sometimes lockfile will emit a message saying that it took a little while to get the lock, which caused spurious test failures. This commit suppresses the message. With this change, I was able to run these tests continuously for some time without failures. This was a bug in the testsuite, not in the code under test.
* ovsdb: Truncate bad transactions from database log.Ben Pfaff2011-03-311-0/+48
| | | | | | | | | | | | | | | | | When ovsdb-server reads a database file that is corrupted at the transaction level (that is, the transaction is valid JSON and has the correct SHA-1 hash, but it does not describe a valid database transaction), then ovsdb-server should truncate it and overwrite it by valid transactions. However, until now, it didn't. Instead, it would keep the invalid transaction and possibly every transaction in the database file (depending on in what way the transaction was invalid), which would just cause the same trouble again the next time the database was read. This fixes the problem. An invalid transaction will be deleted from the database file at the first write to the database. Bug #5144. Bug #5149.
* ovsdb: Check that ovsdb-server truncates corrupted database logs.Ben Pfaff2011-03-311-0/+47
| | | | | | | | | | When ovsdb-server reads a database that is corrupted at the log level (that is, when ovsdb_log detects the corruption by checking the SHA-1 hash of the record or JSON parser error reporting), then writing to the database should discard the corrupted data and thereby fix the problem for future ovsdb-server runs. This already worked OK. This just adds an extra test.
* ovsdb-tool: Add commands for printing the database checksum.Ben Pfaff2011-02-151-1/+1
|
* tests: Fix Y2011 bug in testsuite.Ben Pfaff2011-01-101-2/+2
| | | | | | | | | | The tests have been failing for a few days now, because the PKI expired a few days into 2011. This commit instead generates the PKI at "make check" time, which has the additional benefit of getting some test exposure for the ovs-pki program. Reported-by: Aaron M. Ucko <ucko@debian.org> CC: 609506@bugs.debian.org
* Implement database schema versioning.Ben Pfaff2010-12-271-1/+12
| | | | | As the database schema evolves, it might be useful to have an identifier for the particular version in use. This commit adds that feature.
* tests: Update expected test result to match "ovsdb-client dump" changes.Ben Pfaff2010-10-211-6/+9
| | | | | | | Commit 06036898849 "ovsdb-client: Make "dump" print table names in default output format too" changed the output format of "ovsdb-client dump" without updating the tests that depended on that output format. This commit updates the expected test results to match.
* tests: Fix bug in ovsdb-server test suite.Ben Pfaff2010-05-071-20/+20
| | | | | | | The formatting of OVSDB syntax errors differed between big-endian and little-endian systems, which caused the "database multiplexing implementation" test to fail on SPARC. This commit fixes the problem by always outputting JSON in syntax errors in deterministic (sorted) order.
* ovsdb-server: Obtain SSL configuration from database.Ben Pfaff2010-03-191-0/+54
| | | | | | ovsdb-server should be able to obtain its SSL configuration from the database that it is serving out, instead of having to specify it on the command line. This commit makes it so.
* ovsdb: Compact databases online automatically and on-demand.Ben Pfaff2010-03-181-0/+117
| | | | | | | | | | | | If the database grows fairly large, and we've written a fair number of transactions to it, and it's been a while since the database was compacted, then (after the next commit) compact the database. Also, compact the database online if the "ovsdb-server/compact" command is issued via unixctl. I suspect that this feature will rarely if ever be used in practice, but it's easier to test than compacting automatically. Bug #2391.
* ovsdb: Add tests for transient ovsdb-server.Ben Pfaff2010-03-171-1/+37
| | | | | | | | This variant of the ovsdb execution tests runs each transaction against a separately started ovsdb-server. The idea is that this should help to ferret out any differences between what ovsdb-server has in memory and what actually gets committed to disk. There should not be any such differences, but we need to test for that.
* ovsdb: Add support for multiple databases to the protocol.Ben Pfaff2010-02-091-2/+21
| | | | | | This also adds protocol compatibility to the database itself and to ovsdb-client. It doesn't actually add multiple database support to ovsdb-server, since we don't really need that yet.
* tests: Always make ovsdb-server exit cleanly, to better find memory leaks.Ben Pfaff2010-02-021-3/+8
| | | | | | "ovs-appctl exit" causes a cleaner shutdown than "kill" and in particular lets ovsdb-server clean up better, which makes it easier to find real memory leaks.
* Rework and simplify the "lcov" support for the testsuite.Ben Pfaff2010-02-021-7/+7
|
* ovsdb: Add tests for OVSDB protocol over SSL.Ben Pfaff2010-01-111-2/+41
|
* ovsdb-server: Make database connections configurable from database itself.Ben Pfaff2010-01-041-1/+34
| | | | | Most importantly this adds a "managers" column to the vswitch database that specifies where the ovsdb-server should connect.
* ovsdb: Fix race conditions in test suite.Ben Pfaff2009-12-031-2/+2
|
* ovsdb: Make ovsdb-server tests pass even when @RUNDIR@ is not writable.Ben Pfaff2009-11-181-1/+1
|
* ovsdb: Monitor support.Ben Pfaff2009-11-171-1/+1
|
* ovsdb: Add tests for file storage and for ovsdb-server.Ben Pfaff2009-11-161-0/+34