summaryrefslogtreecommitdiff
path: root/tests/ovsdb-log.at
Commit message (Collapse)AuthorAgeFilesLines
* treewide: Convert leading tabs to spaces.Ben Pfaff2018-06-111-16/+16
| | | | | | | | | It's always been OVS coding style to use spaces rather than tabs for indentation, but some tabs have snuck in over time. This commit converts them to spaces. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Justin Pettit <jpettit@ovn.org>
* log: Support multiple magic.Ben Pfaff2017-12-241-1/+1
| | | | | | | | | Some OVSDB tools will want to open files that might be standalone or clustered databases, and so it's better if ovsdb_log_open() can accept more than one valid "magic". This commit makes that possible. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Justin Pettit <jpettit@ovn.org>
* log: New functions for replacing a log's contents.Ben Pfaff2017-12-241-0/+74
| | | | | | | | | | | | | | These functions will acquire users in future commits. This new functionality made the internal state machine of the log hard enough to understand that I thought that it was best to make it explicit with a 'state' variable, so this commit introduces one. This commit duplicates code and logic from ovsdb_rename() and ovsdb_compact() in ovsdb/file.c. A future commit removes this duplication. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Justin Pettit <jpettit@ovn.org>
* log: Add new open mode OVSDB_LOG_CREATE_EXCL.Ben Pfaff2017-12-241-1/+6
| | | | | | | | Until now, OVSDB_LOG_CREATE implied EXCL, but this commit breaks them apart. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Justin Pettit <jpettit@ovn.org>
* log: Require log entries to be JSON objects.Ben Pfaff2017-12-241-106/+106
| | | | | | | | | | | | The current and upcoming users of the OVSDB logging module only use JSON objects as records. This commit simplifies the users slightly by allowing them to always assume that the records are JSON objects. Unfortunately this resulted in a large number of updates to tests, which didn't always use JSON objects. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Justin Pettit <jpettit@ovn.org>
* log: Allow client to specify magic.Ben Pfaff2017-12-241-0/+27
| | | | | | | | | | | Until now, the logging code in ovsdb has only supported a single file format, for OVSDB standalone database files. Upcoming commits will add support for another, incompatible format, which uses a different magic string for identification. This commit allows the logging code to support both formats. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Justin Pettit <jpettit@ovn.org>
* ovsdb: Improve error message from ovsdb_log_open() open failure.Ben Pfaff2016-03-301-1/+1
| | | | | | | | | | | Previously, error messages ended up looking like: ovsdb-tool: I/O error: create: $DBFILE failed (File exists) which is hard to understand. This commit changes them to: ovsdb-tool: I/O error: $DBFILE: create failed (File exists) which makes more sense. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Russell Bryant <russell@ovn.org>
* json: Correct position tracking in JSON parser implementations.Ben Pfaff2012-04-261-1/+1
| | | | | | | | | | | When json_lex_input() returns false, the parser does not consume the byte passed in. That byte will get processed again in the next iteration of the json_parser_feed() loop. Therefore, until now, this code has double-counted bytes that cause a false return from json_lex_input(). This fixes the problem. Every input byte is now counted only once. Signed-off-by: Ben Pfaff <blp@nicira.com>
* lockfile: Don't warn if successful lock takes a little time.Ben Pfaff2011-05-131-1/+1
| | | | | | | | | | | | | 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>
* Add a few more users for ovs_retval_to_string().Ben Pfaff2011-04-041-1/+1
|
* ovsdb: Allow ovsdb_log_open()'s caller to choose whether to lock.Ben Pfaff2010-02-151-30/+30
| | | | | | | | | | | | The current callers of ovsdb_log_open() always want to lock the file if they are accessing it for read/write access. An upcoming commit will add a new caller that does not fit this model (it wants to lock the file across a wider region) and so the caller should be able to choose whether to do locking. This commit adds that ability. Also, get rid of the use of <fcntl.h> flags to choose the open mode, which has always seemed somewhat crude and which this change would make even cruder.
* tests: Fix timing dependency in ovsdb-log test.Ben Pfaff2010-02-021-1/+1
| | | | | | | The "lockfile" module logs a message if locking takes a measurable amount of time. Running the tests under valgrind tends to make this message appear, so we need to disable it to make the output comparison come out cleanly.
* Rework and simplify the "lcov" support for the testsuite.Ben Pfaff2010-02-021-29/+29
|
* json: Improve error reporting.Ben Pfaff2009-12-031-1/+1
|
* ovsdb: Rename ovsdb_file to ovsdb_log.Ben Pfaff2009-11-161-0/+282
This prepares for introducing a new, higher-level ovsdb_file that encapsulates ovsdb storage in a file.