summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* tests: Cleanup test-daemon.py style.Ethan Jackson2011-09-161-1/+4
| | | | | By convention, unused arguments should be named "_" and top level definitions should be separated by two spaces.
* Implement new "learn" action.Ben Pfaff2011-09-133-0/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | There are a few loose ends here. First, learning actions cause too much flow revalidation. Upcoming commits will fix that problem. The following additional issues have not yet been addressed: * Resource limits: nothing yet limits the maximum number of flows that can be learned. It is possible to exhaust all system memory. * Age reporting: there is no way to find out how soon a learned table entry is due to be evicted. To try this action out, here's a recipe for a very simple-minded MAC learning switch. It uses a 10-second MAC expiration time to make it easier to see what's going on: ovs-vsctl del-controller br0 ovs-ofctl del-flows br0 ovs-ofctl add-flow br0 "table=0 actions=learn(table=1, hard_timeout=10, \ NXM_OF_VLAN_TCI[0..11], NXM_OF_ETH_DST[]=NXM_OF_ETH_SRC[], \ output:NXM_OF_IN_PORT[]), resubmit(,1)" ovs-ofctl add-flow br0 "table=1 priority=0 actions=flood" You can then dump the MAC learning table with: ovs-ofctl dump-flows br0 table=1
* test-openflowd: Allow specifying port type on --ports option.Ben Pfaff2011-09-131-1/+5
| | | | | | | | This allows a command like "test-openflowd --enable-dummy dummy@br0 --ports=dummy@eth0,dummy@eth1,dummy@eth2" to create a dummy datapath with a number of dummy ports. This is more useful for testing than a dummy datapath with just an internal port, since output to "flood" and "normal" has less pathological results.
* packets: Add more utility functions for IPv4 and IPv6 addresses.Ben Pfaff2011-09-131-6/+25
| | | | | | | We had these functions scattered around the source tree anyway. packets.h is a good place to centralize them. I do plan to introduce some additional callers.
* tests: Test ofproto-dpif set_tunnel translation.Ethan Jackson2011-09-121-0/+18
| | | | | This patch adds a unit test which would have caught the issue fixed in Commit 2446268e "ofproto-dpif: set_tunnel when required to."
* datapath: Use "OVS_*" as opposed to "ODP_*" for user<->kernel interactions.Justin Pettit2011-08-192-2/+2
| | | | | | | | | | | | | The prefix "ODP_*" is not overly descriptive in the context of the larger Linux tree. This commit changes the prefix to "OVS_*" for the userpace to kernel interactions. The userspace libraries still use "ODP_" in many of their interfaces since it is more descriptive in the OVS oeuvre. Feature #6904 Signed-off-by: Justin Pettit <jpettit@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
* nicra-ext: New action NXAST_OUTPUT_REG.Ethan Jackson2011-08-122-0/+21
| | | | | The NXAST_OUTPUT_REG action outputs to the OpenFlow port contained in a supplied NXM field.
* tests: test "load" and "move" actions.Ethan Jackson2011-08-121-0/+25
|
* tests: Update gitignore.Ethan Jackson2011-08-121-0/+1
|
* New action NXAST_RESUBMIT_TABLE.Ben Pfaff2011-08-094-0/+24
| | | | | This makes multiple table support in ofproto-dpif useful, by allowing resubmits into tables other than 0.
* ofproto-dpif: Add multiple table support.Ben Pfaff2011-08-091-12/+8
| | | | | Tables other than 0 can be modified and dumped, but they are not yet useful because actions and flow table lookups never use them.
* odp-util: New function odp_flow_key_from_string().Ben Pfaff2011-08-084-0/+133
| | | | This will be used in upcoming commits.
* netdev: Get rid of struct netdev_options and netdev_open_default().Ben Pfaff2011-08-081-1/+1
| | | | | Now that netdev_options only has two members, we might as well pass them directly as parameters.
* util: Introduce get_program_version function.Justin Pettit2011-08-041-1/+1
| | | | Useful in an upcoming commit.
* vlog: Add a new log level "off".Ben Pfaff2011-08-012-4/+4
| | | | | | | Until now, "emer" has effectively been "off" because no messages were ever logged at "emer" level. Justin points out that it is useful to use "emer" for messages that indicate a fatal error. This commit makes that change and adds a new "off" level to really turn off all logging to a facility.
* ovs-ofctl: Print human readable nx_pull_match() errors.Ethan Jackson2011-07-281-40/+40
| | | | I've found this makes debugging a bit easier.
* git: Update gitignore in tests and utilities.Ethan Jackson2011-07-281-0/+1
|
* ovs-ofctl: Fix dump-ports and queue-stats commands.Ben Pfaff2011-07-271-0/+24
| | | | | | | | | These ovs-ofctl commands have been sending malformed stats requests since commit 63f2140a553 "openflow: Make stats replies more like other OpenFlow messages." This commit fixes the problem and adds basic unit tests that should prevent similar regressions. Reported-by: Hao Zheng <hzheng@nicira.com>
* ofp-print: Make port "config" and "state" output easier to read.Ben Pfaff2011-07-262-23/+37
| | | | | | | | | | | | | | This changes the output of "ovs-ofctl show" from printing ports like this: 1(eth1): addr:50:54:00:00:00:02, config: 0x11, state:0x1 to this: 1(eth1): addr:50:54:00:00:00:02 config: PORT_DOWN NO_FLOOD state: LINK_DOWN which seems much easier to read. It also eliminates trailing white space from the output. Reported-by: Ethan Jackson <ethan@nicira.com>
* ovsdb: Implement a "lock" feature in the database protocol.Ben Pfaff2011-07-261-1/+1
| | | | | | | | | | | This provides clients a way to coordinate their access to the database. This is a voluntary, not mandatory, locking protocols, that is, clients are not prevented from modifying the database unless they cooperate with the locking protocol. It is also not related to any of the ACID properties of database transactions. It is strictly a way for clients to coordinate among themselves. The following commit will introduce one user.
* ovsdb: Refactor jsonrpc-server to make the concept of a session public.Ben Pfaff2011-07-261-5/+7
| | | | | | | An upcoming commit will need to expose the concept of a database session to the execution engine, to allow the execution engine to query the locks held by the session. This commit prepares for that by making sessions a publicly visible data structure.
* 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.
* bundle: New action "bundle_load".Ethan Jackson2011-07-223-8/+21
| | | | | The bundle_load action behaves the same as the bundle action, except instead of outputting, it writes its result to a register.
* bundle: Implement NX_BD_ALG_ACTIVE_BACKUP.Ethan Jackson2011-07-222-7/+100
| | | | | | | I don't expect this bundling algorithm to be particularly useful in software switches. However, hardware switches will probably only support this bundling algorithm, so it's implemented here as an example and a reference.
* nx-match: New helpers.Ethan Jackson2011-07-222-12/+0
| | | | | | | | | | | This patch creates two new helper functions, nxm_reg_load() and nxm_dst_check(). The new nxm_dst_check() function may be used to check the validity of destination fields used by actions. The new nxm_reg_load() function may be used by actions which need to write to NXM fields. This patch also allows multipath and autopath to write their result to non-register NXM fields.
* util: New function log_2_floor().Ben Pfaff2011-07-223-0/+60
| | | | | Calculates the position of the most significant bit in a 32 bit word.
* bundle: Run bundle_check() in unit tests.Ethan Jackson2011-07-221-0/+4
| | | | | This has been helpful finding bugs in my development environment. It's good to exercise this code.
* vswitch: Implement bundle action.Ethan Jackson2011-07-196-0/+377
| | | | | | This patch creates a new action called "bundle". Bundles are a way to implement a simple form of multipath in OpenFlow by grouping several ports in a single output-like action.
* tests: Fix deprecated use of qw.Ethan Jackson2011-07-121-5/+5
| | | | | | | This causes tests to fail on my system with the following error. Use of qw(...) as parentheses is deprecated at /home/root/ovs/tests/flowgen.pl line 35.
* classifier: Print ARP opcode as "arp_op" instead of "opcode".Ben Pfaff2011-06-301-10/+10
| | | | | "opcode" is not very specific. All the other ARP fields have an "arp_" prefix, so this commit adds one for the opcode too.
* ovsdb-idl: Plug hole in state machine.Ben Pfaff2011-06-212-0/+35
| | | | | | | | | | | | The state machine didn't have a proper state for "not yet committed or aborted", which meant that destroying an ovsdb_idl_txn without committing or aborting it caused a segfault. This fixes the problem by adding a new state TXN_UNCOMMITTED to the state machine. This is related to commit 79554078d "ovsdb-idl: Fix bad logic in ovsdb_idl_txn_commit() state transitions", which fixed a related bug. Bug #2438.
* xenserver: allow dom0 traffic in secure pool host when controller unavailable.David Tsai2011-06-171-6/+41
| | | | | | | | | | | | | | | A pool configured for secure fail-mode can block dom0 traffic on hosts joining the pool or if the host reboots while the controller is unavailable. This commit sets default flows on a host under these conditions to allow management traffic. Once the connection with the controller is re-established, these default flows are replaced by the controller. tests/interface-reconfigure.at updated by Ben Pfaff. NIC-376. Signed-off-by: David Tsai <dtsai@nicira.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* ofp-util: Send table_id correctly in OpenFlow 1.0 flow_mods.Ben Pfaff2011-06-151-0/+8
| | | | | | | This fixes "ovs-ofctl add-flow <bridge> table=<number>,..." and similar commands. Reported-by: Hao Zheng <hzheng@nicira.com>
* ofp-print: Change "table_id" to "table" in flow_mod and flow_stats.Ben Pfaff2011-06-143-27/+27
| | | | | | | Flow dumps printed the OpenFlow table ID under the name "table_id", but the flow parser only accepted "table". This makes them consistent by changing the output. (Another alternative would be to change the accepted input name.)
* ofp-parse: Add support for vlan_tci field.Ben Pfaff2011-06-141-0/+2
| | | | | Until now, the flow parser has supported dl_vlan and dl_vlan_pcp but not the fully maskable vlan_tci that NXM allows. This adds that support.
* ofproto: Add simple tests for dumping aggregates and for OpenFlow 1.0.Ben Pfaff2011-06-141-1/+24
| | | | | | | | | | We had no tests that exercised OFPST_AGGREGATE or NXST_AGGREGATE. At one point in development I screwed up aggregate stats badly enough that they caused an immediate and reproducible segfault, which this simple test would have caught. Also, it's best to test everything in both NXM and OpenFlow 1.0 flow formats, since they have slightly different code.
* tests: Add test for printing NXT_FLOW_MOD_TABLE_ID.Ben Pfaff2011-06-101-0/+10
|
* Remove NXAST_DROP_SPOOFED_ARP action.Justin Pettit2011-06-091-6/+0
| | | | | | | | | The NXAST_DROP_SPOOFED_ARP action has been deprecated in favor of defining flows using the NXM_NX_ARP_SHA flow match for a while. This commit removes it. Signed-off-by: Justin Pettit <jpettit@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
* tests: Unit test autopath action parsing.Ethan Jackson2011-06-091-0/+2
|
* ofp-parse: Add support for dl_dst masks in flow match parsing.Ben Pfaff2011-06-071-0/+8
| | | | | | | | This makes it possible to add flows that match on the Ethernet multicast bit with ovs-ofctl. CC: Paul Ingram <paul@nicira.com> CC: Amar Padmanabhan <amar@nicira.com>
* ovs-openflowd: Rename test-openflowd and move to "tests" directory.Ben Pfaff2011-06-075-5/+905
| | | | | Too many users thought that they needed to run ovs-openflowd at the same time as ovs-vswitchd. I hope that this change discourages them.
* ovsdb: Implement table uniqueness constraints ("indexes").Ben Pfaff2011-06-064-3/+111
|
* ovsdb: Move ovsdb_table_put_row() into test program.Ben Pfaff2011-06-061-2/+12
| | | | | | This function is not useful inside ovsdb itself but only in the "test-ovsdb" test program. To avoid the temptation to use it incorrectly inside ovsdb, this commit moves it into the test program.
* ovsdb: Make ovsdb_column_set_from_json() take table schema instead of table.Ben Pfaff2011-06-061-1/+2
| | | | | | | This function took a struct ovsdb_table but only used the 'schema' member. An upcoming patch needs to parse a column set when only the schema is available, so to prepare for that this patch changes ovsdb_column_set_from_json() to only take the schema that it really needs.
* ovsdb: Check ovsdb_mutation_set_execute() return value in transactions.Ben Pfaff2011-05-311-1/+9
| | | | | | | | | Errors from this function were being ignored, which meant that transactions could use "mutate" to bypass number-of-elements constraints on sets and maps. This fixes the problem and adds a test to prevent the problem from recurring. Bug #5781.
* ovsdb: Add test for number-of-elements constraints.Ben Pfaff2011-05-311-0/+39
| | | | | This test already passes, but I did not see any existing test that checked for this problem.
* ovs-ofctl: Report attempts to add (remove, etc.) non-normalized flows.Ben Pfaff2011-05-272-0/+13
| | | | | | | | | | | | | Commit 0b3f27253 (ovs-ofctl: Warn about flows not in normal form) made ovs-ofctl warn about non-normalized flows, that is, flows some of whose specified fields will be ignored by the switch. This was convenient for users, who are understandably confused by flow normalization. However, later commit 8050b31d6 (ofp-parse: Refactor flow parsing) accidentally deleted the warning. This commit restores it and adds a test to ensure that it doesn't get deleted again later. Reported-by: Reid Price <reid@nicira.com> Bug #5029.
* ofp-util: Export (again) a generalized function for normalizing rules.Ben Pfaff2011-05-271-4/+4
| | | | | | | | | | | Feature #5029 requests that "ovs-ofctl add-flow" report an attempt to add a flow that is not properly normalized, that is, a flow to which the switch will add extra wildcards, ignoring some fields specified by the user. This requires that ofp-util make flow normalization directly available (again). Until now, flow normalization has only been applied to OpenFlow 1.0 flows, but the concept applies equally to NXM, so this commit generalizes the implementation to NXM also.
* ofp-util: Also force nw_tos to be wildcarded for ARP flows.Ben Pfaff2011-05-271-3/+3
| | | | | OVS doesn't fill nw_tos with anything meaningful for ARP flows so we should also force nw_tos to be wildcarded for ARP.
* test-csum: Avoid "cast increases required alignment of target type" warning.Ben Pfaff2011-05-261-2/+3
| | | | | | | Casting a character pointer to uint16_t * or uint32_t * provokes this warning on sparc. There is no actual problem, because all of the accesses to data occurs through calls to the get_unaligned_*() functions, so this commit suppresses the warning by using "void *" as an intermediate type.