summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* daemon: Avoid races on pidfile creation.Ben Pfaff2011-04-041-0/+2
| | | | | | | | | | | | | | | | | | Until now, if two copies of one OVS daemon started up at the same time, then due to races in pidfile creation it was possible for both of them to start successfully, instead of just one. This was made worse when a previous copy of the daemon had died abruptly, leaving a stale pidfile. This commit implements a new pidfile creation and removal protocol that I believe closes these races. Now, a pidfile is asserted with "link" instead of "rename", which prevents the race on creation, and a stale pidfile may only be deleted by a process after it has taken a lock on it. This may solve mysterious problems seen occasionally on vswitch restart. I'm still puzzled by these problems, however, because I don't see anything in our tests cases that would actually cause two copies of a daemon to start at the same time, which as far as I can see is a necessary precondition for the problem.
* daemon: Integrate checking for an existing pidfile into daemonize_start().Ben Pfaff2011-04-043-7/+2
| | | | | | | | | | | | 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.
* Log anything that could prevent a daemon from starting.Ben Pfaff2011-04-041-2/+2
| | | | | If a daemon doesn't start, we need to know why. Being able to consistently consult the log to find out is helpful.
* type-props: New macro for estimating length of a decimal integer.Ben Pfaff2011-04-041-2/+11
|
* Add a few more users for ovs_retval_to_string().Ben Pfaff2011-04-041-1/+1
|
* list: New functions list_is_singleton(), list_is_short().Ben Pfaff2011-04-011-1/+3
|
* 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: Force strong references to non-root tables to be persistent.Ben Pfaff2011-03-311-0/+32
| | | | | | | | | | | | | | | | | | | | | | When a strong reference to a non-root table is ephemeral, the database log can contain inconsistencies. In particular, if the column in question is the only reference to a row, then the row will be created in one logged transaction but the reference to it will not be logged (because it is ephemeral). Thus, any later occurrence of the row later in the log (to modify it, to delete it, or just to reference it) will yield a transaction error and reading the database will abort at that point. This commit fixes the problem by forcing any column with a strong reference to a non-root table to be persistent. The change to ovsdb_schema_from_json() looks bigger than it really is: it just swaps the order of two operations on the schema and updates their comments. Similarly for the update to ovs.db.DbSchema.__init__(). Bug #5144. Reported-by: Sujatha Sumanth <ssumanth@nicira.com> Bug #5149. Reported-by: Ram Jothikumar <rjothikumar@nicira.com>
* gitignore: Added ovs-vlan-bug-workaround and testsEthan Jackson2011-03-221-0/+5
|
* ovs-vsctl: Back out garbage collection changes.Ethan Jackson2011-03-161-0/+20
| | | | | | | | | | | | | | | | | | Garbage collection introduced in c5f341ab193b9126dffef8c77bf8ed35e91290fd changed ovs-vsctl so that it would allow the garbage collector to reclaim unused tables instead of manually deleting them itself. Since garbage collection runs at transaction completion, undeleted tables would hang around and could conflict with future actions in a given transaction. This commit backs out this change. The following command is an example of something that would have failed before this commit. ovs-vsctl -- add-br b \ -- del-br b \ -- add-br b \ -- set Interface b other_config:test=test
* ofproto: Remove controller discovery support.Ben Pfaff2011-03-163-191/+0
| | | | | | I've never heard of anyone actually using controller discovery. It adds a great deal of code to the source tree, and a little bit of complication to ofproto, so this commit removes it.
* ofproto: Get rid of archaic "switch status" OpenFlow extension.Ben Pfaff2011-03-161-23/+0
| | | | | | | | | Back in 2008 or so, I introduced this extension as a way to provide information about switch status to the new "switch UI" program. Since then, the switch UI program has been removed and the important information that was provided by the switch status extension is now available in the database, so we might as well get rid of this extension, and that is what this commit does.
* ofp-util: New function ofputil_decode_flow_stats_reply().Ben Pfaff2011-03-161-4/+4
| | | | | | This function will see more use later in this series. This commit just starts using it to make ofp-print output entirely consistent for OFPST_FLOW and NXST_FLOW replies.
* ovs-ofctl: Check min flow format support in negotiate_highest_flow_format().Ben Pfaff2011-03-161-0/+22
| | | | | | | | | | When the -F option wasn't set, or if it was set to an invalid flow format for the match, this code would happily select a flow format that did not select the user's requested match if the switch didn't support an advanced-enough flow format. This fixes the problem. It also changes behavior in the case where the user specifies a flow format that cannot represent the match, changing this from a warning to a fatal error; this is consistent with -F behavior for flow_mod commands.
* classifier: Omit all-1-bits mask for VLAN TCI in cls_rule_format().Ben Pfaff2011-03-161-17/+17
| | | | To me, this seems to be easier to read.
* ofp-print: Consistently print priority only if it is not default.Ben Pfaff2011-03-161-3/+3
| | | | | | In NXST_FLOW replies, the priority was printed only if it was not OFP_DEFAULT_PRIORITY, but it was always printed in OFPST_FLOW replies. This commit changes OFPST_FLOW replies to match NXST_FLOW replies.
* tests: Fix up interface-reconfigure test and results.Ben Pfaff2011-03-161-1/+17
| | | | I forgot to update the test when I added the VLAN bug workaround.
* ovsdb-server: Report time since last connect and disconnect for each manager.Andrew Evans2011-03-143-118/+84
| | | | | | | | | | | | Only the time connected (if connected) or disconnected (if disconnected) is currently reported for each manager. Change to reporting both in seconds since the last connect and disconnect events respectively. An empty value indicates no previous connection or disconnection. This can help diagnose certain connectivity problems, e.g. flapping. Requested-by: Peter Balland <peter@nicira.com> Bug #4833.
* ofp-print: Omit timestamp when printing packets in ofp_packet_to_string().Ben Pfaff2011-03-141-1/+1
| | | | | | | | | | | There's no value in the timestamp here, because it will always be the same. Printing it just makes results less reproducible because output then depends on the time zone. This fixes a test failure in California due to yesterday's DST change, and presumably a test failure almost everywhere else all the time. Reported-by: Andrew Evans <aevans@nicira.com>
* ovsdb: Implement garbage collection.Ben Pfaff2011-03-105-16/+258
|
* ovsdb: Improve error message for duplicate uuid-name.Ben Pfaff2011-03-101-0/+14
| | | | | | | | | | | | ovsdb_execute_insert() tried to return a helpful error message when there was a duplicate uuid-name, but ovsdb_execute() (its caller) makes any parse error override a parse error. Since ovsdb_execute_insert() would skip parsing the row when the uuid-name was a duplicate, this meant that the error actually reported would be that "row" was not allowed here, which wasn't at all helpful (since "row" is in fact mandatory). This commit clears up the problem by always retrieving the "row" member, which required a small amount of refactoring, and adds a test.
* ovsdb-data: Verify that named-uuid string is an <id>.Ben Pfaff2011-03-101-0/+19
| | | | | | | | The "uuid-name" that creates symbols must be an <id> but we weren't verifying the same constraint on the "named-uuid"s that refer to symbols, which was a bit confusing in writing transactions by hand. This commit fixes the inconsistency and updates the SPECS file to clarify that a named-uuid string has to be an <id>.
* python/ovs/ovsuuid: Fix behavior of UUID.from_json() with no symbol table.Ben Pfaff2011-03-101-0/+4
| | | | | | UUID.from_json(['named-uuid', 'x'], None) should raise an error about invalid syntax, but instead it was raising a TypeError because it would try to evaluate "'x' not in None". This fixes the problem and adds a test.
* reconnect: Rename CONNECT_IN_PROGRESS state to CONNECTING (like rconn).Andrew Evans2011-03-101-32/+32
| | | | | | reconnect uses the same connection state names as rconn with the exception of the above. This commit makes their states identical, which should reduce confusion for people debugging connection problems.
* xenserver: Delete Bridge when creating vlan.Ethan Jackson2011-03-101-0/+2
| | | | | | | | | Commit 34edeccfd8d4273844d12c85fe38ec47002c47cd removed a workaround which still applies to XenServer versions older than 5.5. This could causes creation of vlans to fail in some cases. CC: "David Tsai" <dtsai@nicira.com> Bug #4877.
* reconnect: Fix printf() format warning.Ethan Jackson2011-03-101-1/+1
| | | | | tests/test-reconnect.c:245:9: error: format '%llu' expects type 'long long unsigned int', but argument 2 has type 'unsigned int'
* reconnect: Track last-disconnected time.Andrew Evans2011-03-093-0/+67
| | | | | | Commit a4613b01ab (ovsdb: Change the way connection duration time is reported in Manager table.), pushed earlier today, requires this commit, so OVSDB has been unbuildable from then to now.
* ovs-ofctl: Make add-flows command read from stdin if file name is "-".Ben Pfaff2011-03-091-1/+1
| | | | | | | | It is conventional for Unix tools to read from standard input if "-" is specified as a file name. It's easy for "ovs-ofctl add-flows" to behave this way, too, so this commit implements it. Suggested-by: Paul Ingram <paul@nicira.com>
* ovs-ofctl: Implement documented semantics of --flow-format for flow_mods.Ben Pfaff2011-03-015-18/+41
| | | | | | | | Also adds a test and moves some code around in tests/ to make sure that OFPROTO_START and OFPROTO_STOP are available in tests/ovs-ofctl.at. Reported-by: Michael Mao <mmao@nicira.com> Bug #4566.
* xenserver: Add support for disabling in-band management via XAPI.Andrew Evans2011-02-281-1/+9
| | | | | | | | | Allow users or applications to enable or disable in-band management of individual bridges by setting the 'vswitch-disable-in-band' key in the 'other_config' attribute of the corresponding network to 'true' or 'false'. Bug #4749.
* ofp-print: Don't print priority for flow stats requests.Ben Pfaff2011-02-241-4/+4
| | | | | | | A flow stats or aggregate stats request does not have a priority, but we were printing one anyway. Reported-by: Justin Pettit <jpettit@nicira.com>
* test-ovsdb: Check uuid_from_string() return value.Ben Pfaff2011-02-231-2/+4
| | | | Coverity #10699.
* test-ovsdb: Don't leak return value from ovsdb_txn_commit().Justin Pettit2011-02-231-1/+1
| | | | Coverity #10727
* multipath: Validate multipath actions more thoroughly in multipath_parse().Ben Pfaff2011-02-231-4/+41
| | | | | | | | | | | | The stricter validation requires updates to the calls to test-multipath to supply a valid n_links value. test-multipath doesn't actually use that value (it runs over different values in an internal "for" loop), so this doesn't change any behavior. Also adds a test to exercise each possible multipath_parse() error message. Reported-by: Reid Price <reid@nicira.com> Bug #4462.
* ovsdb: Remove 'managers' column from 'Open vSwitch' table.Andrew Evans2011-02-181-1/+1
| | | | | | | | We had retained but deprecated the use of the older 'managers' column in the 'Open vSwitch' table for compatibility with applications that might still use it, but that created more problems than it solved. This commit removes the 'managers' column from the schema, and removes all references to it from the code, init scripts, documentation, and tests.
* ovsdb-tool: New command "needs-conversion".Ben Pfaff2011-02-151-0/+22
|
* ovsdb-tool: Add commands for printing the database checksum.Ben Pfaff2011-02-153-3/+22
|
* xenserver: Remove support for XenServer versions older than 5.6 FP1.Justin Pettit2011-02-111-2/+0
| | | | | | | | Commit 404c169247b1c3ac2ebad887f0421478a6cef924 breaks compatibility with XenServers older than 5.6 FP1. This commit removes the last vestiges of support for those older XenServer versions. Signed-off-by: Justin Pettit <jpettit@nicira.com>
* xenserver: Merge upstream changes and drop pre-5.6.100 support.Andrew Evans2011-02-111-0/+14
| | | | | | | | | | | | | | | Citrix have made modifications to the various interface configuration scripts that OVS replaces, so at present those modifications are lost when OVS is installed on e.g. XenServer 5.6.100. This commit applies those changes while preserving OVS-specific modifications that have been made in the interim. One major change introduced by these updates is the removal of support for XenServer releases prior to 5.6.100. This commit also updates the OVS-supplied xen-bugtool in similar fashion. We will soon remove xen-bugtool from OVS altogether and move the added OVS functionality to an XML extension as described in the Supplemental Pack DDK guide.
* ovs-vsctl: Add new "find" command.Ben Pfaff2011-02-081-1/+20
| | | | | | | | This allows listing records that match specified criteria, instead of just records that have specific names. This will be used in an upcoming patch, along with --columns, to list all of the interfaces whose type is 'internal'.
* ovs-vsctl: Add --columns options to "list" command.Ben Pfaff2011-02-081-0/+7
| | | | | | | | This allows the user to list just selected columns from a table, for example just the "name" column. This will become more useful as additional formatting options are added in upcoming commits.
* ovs-vsctl: Add commands to get/delete/set manager connections.Andrew Evans2011-02-071-0/+26
|
* 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.
* xenserver: Allow LACP configuration from xapi.Ethan Jackson2011-02-031-2/+2
| | | | | | | | | Makes required changes to interface reconfigure to allow LACP configuration from xapi. Conforms to XenServer style bonding configuration which is slightly different from OVS. Signed-off-by: Ethan Jackson <ethan@nicira.com> Bug #4213.
* nicira-ext: Support matching IPv6 Neighbor Discovery messages.Justin Pettit2011-02-021-0/+36
| | | | | | | | | | | | | | | | | IPv6 uses Neighbor Discovery messages in a similar manner to how IPv4 uses ARP. This commit adds support for matching deeper into the payloads of Neighbor Solicitation (NS) and Neighbor Advertisement (NA) messages. Currently, the matching fields include: - NS and NA Target (nd_target) - NS Source Link Layer Address (nd_sll) - NA Target Link Layer Address (nd_tll) When defining IPv6 Neighbor Discovery rules, the Nicira Extensible Match (NXM) extension to OVS must be used. Signed-off-by: Justin Pettit <jpettit@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* nicira-ext: Support matching IPv6 traffic.Justin Pettit2011-02-022-0/+164
| | | | | | | | | | | | | | | | | Provides ability to match over IPv6 traffic in the same manner as IPv4. Currently, the matching fields include: - IPv6 source and destination addresses (ipv6_src and ipv6_dst) - Traffic Class (nw_tos) - Next Header (nw_proto) - ICMPv6 Type and Code (icmp_type and icmp_code) - TCP and UDP Ports over IPv6 (tp_src and tp_dst) When defining IPv6 rules, the Nicira Extensible Match (NXM) extension to OVS must be used. Signed-off-by: Justin Pettit <jpettit@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* nicira-ext: Support matching ARP source and target hardware addresses.Justin Pettit2011-02-021-4/+28
| | | | | | | | | | | | | | OpenFlow 1.0 doesn't allow matching on the ARP source and target hardware address. This has caused us to introduce hacks such as the Drop Spoofed ARP action. Now that we have extensible match, we can match on more fields within ARP: - Source Hardware Address (arp_sha) - Target Hardware Address (arp_tha) Signed-off-by: Justin Pettit <jpettit@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* lib: Replace IP_TYPE_ references with IPPROTO_.Justin Pettit2011-02-022-4/+4
| | | | | | A few common IP protocol types were defined in "lib/packets.h". However, we already assume the existence of <netinet/in.h> which contains a more exhaustive list and should be available on POSIX systems.