summaryrefslogtreecommitdiff
path: root/tests/ovs-vswitchd.at
Commit message (Collapse)AuthorAgeFilesLines
* tests: Get rid of timeout options for control utilities.Ilya Maximets2019-10-161-4/+4
| | | | | | | | | | | | | | | | | 'OVS_CTL_TIMEOUT' environment variable is exported in tests/atlocal.in and controls timeouts for all OVS utilities in testsuite. There should be no manual tweaks for each single command. This helps with running tests under valgrind where commands could take really long time as you only need to change 'OVS_CTL_TIMEOUT' in a single place. Few manual timeouts were left in places where they make sense. Signed-off-by: Ilya Maximets <i.maximets@ovn.org> Reviewed-by: Yifeng Sun <pkusunyifeng@gmail.com> Acked-by: Ben Pfaff <blp@ovn.org>
* ofproto-dpif: Remove tabs from output.Ben Pfaff2018-06-111-3/+3
| | | | | | | | | | | OVS uses spaces for indentation in source code and it makes sense for it to also use spaces for indentation in output. Spaces also consume less horizontal space in output, which often makes it easier to read. This commit transitions one part of output from tabs to spaces and updates appropriate parts of the tests to match. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Justin Pettit <jpettit@ovn.org>
* ovs-vswitchd: Allow more convenient 0x short form for specifying DPIDs.Ben Pfaff2017-12-211-0/+38
| | | | | | | | | | | Until now, ovs-vswitchd has insisted that other-config:datapath-id be exactly 16 hex digits. This commit allows shorter forms prefixed by 0x. This was prompted by Faucet controller examples such as this one: https://github.com/faucetsdn/faucet/blob/master/docs/README_config.rst which tend to suggest datapath IDs like 0x1. CC: Josh Bailey <joshb@google.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* ovs-vsctl: Print error when add-port fails.Daniele Di Proietto2016-12-211-3/+6
| | | | | | | | | | | | | | | | | | | When the add-port command fails, vsctl reports the failure and just suggests to check the logs for more details. ovs-vswitchd fills the error column in the Interface table with a description of the error, so it might be helpful to print that. This is useful especially for dpdk devices, because the port naming change could use a better error reporting. I'm planning another patch to make sure that ovs-vswitch writes appropriates information in the error column, after the dpdk port naming changes are merged. CC: Ben Pfaff <blp@ovn.org> Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com> Acked-by: Ben Pfaff <blp@ovn.org>
* tests: Get rid of overly specific --pidfile and --unixctl options.Ben Pfaff2016-10-121-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | At an early point in OVS development, OVS was built with fixed default directories for pidfiles and sockets. This meant that it was necessary to use lots of --pidfile and --unixctl options in the testsuite, to point the daemons to where they should put these files (since the testsuite cannot and generally should not touch the real system /var/run). Later on, the environment variables OVS_RUNDIR, OVS_LOGDIR, etc. were introduced to override these defaults, and even later the testsuite was changed to always set these variables correctly in every test. Thus, these days it isn't usually necessary to specify a filename on --pidfile or to specify --unixctl at all. However, many of the tests are built by cut-and-paste, so they tended to keep appearing anyhow. This commit drops most of them, making the testsuite easier to read and understand. This commit also sweeps away some other historical detritus. In particular, in early days of the testsuite there was no way to automatically kill daemons when a test failed (or otherwise ended). This meant that some tests were littered with calls to "kill `cat pidfile`" on almost every line (or m4 macros that expanded to the same thing) so that if a test failed partway through the testsuite would not hang waiting for a daemon to die that was never going to die without manual intervention. However, a long time ago we introduced the "on_exit" mechanism that obsoletes this. This commit eliminates a lot of the old litter of kill invocations, which also makes those tests easier to read. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Andy Zhou <azhou@ovn.org>
* netdev-dummy: Add dummy-internal class.Daniele Di Proietto2016-08-151-3/+3
| | | | | | | | | | | | | | | | | | "internal" netdevs are treated specially in OVS (e.g. for MTU), but the dummy datapath remaps both "system" and "internal" devices to the same "dummy" netdev class, so there's no way to discern those in tests. This commit adds a new "dummy-internal" netdev type, which will be used by the dummy datapath for internal ports, so that other parts of the code can understand which ports are internal just by looking at the netdev object. The alternative solution, using the original interface type ("internal") instead of the translated netdev type ("dummy"), is harder to implement, because in so many places only the netdev object is available. Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com> Acked-by: Ben Pfaff <blp@ovn.org>
* ovsdb-client: support monitor-cond methodLiran Schour2016-07-181-4/+4
| | | | | | | | | | Add monitor_cond method to ovsdb-client. Enable testing of monitor_cond_change via unixctl command.Add unit tests for monitor_cond and monitor_cond_change. See ovsdb-client(1) man page for details. Replace monitor2 with monitor_cond. Signed-off-by: Liran Schour <lirans@il.ibm.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* tests: Fix issue in use of OVS_APP_EXIT_AND_WAIT.Lance Richardson2016-06-231-6/+9
| | | | | | | | | | | | | | | | | | | | | | | Commit f9b11f2a09b4 introduced a loop to wait for process exit in OVS_APP_EXIT_AND_WAIT after the "exit" command has been sent. Unfortunately, this does not work for cases where a unixctl socket has to be used to send the "exit" command because the process ID cannot be determined from the socket path. OVS_APP_EXIT_AND_WAIT_BY_TARGET has since been introduced to enable graceful termination of daemons via unixctl sockets. This set of changes addresses the problem described above by making OVS_APP_EXIT_AND_WAIT_BY_TARGET take the unixctl socket path and corresponding process ID as separate parameters. In order to better detect issues in this logic in the future, checks have been added to verify that the pidfile exists before using its contents. Tested on a Linux system. Signed-off-by: Lance Richardson <lrichard@redhat.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* tests: consistently use OVS_APP_EXIT_AND_WAIT() for daemon terminationLance Richardson2016-03-181-3/+5
| | | | | | | | | Tools such as gcov rely on normal termination (via exit()), ensure consistent graceful termination of daemons in tests by using the OVS_APP_EXIT_AND_WAIT() macro. Signed-off-by: Lance Richardson <lrichard@redhat.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* bridge: Do not add bridges with '/' in name.Daniele Di Proietto2016-02-031-0/+30
| | | | | | | | | | | | | | | This effectively stops vswitchd from creating bridges with '/' in the name. OVS used to print a warning but the bridge was created anyway. This restriction is implemented because the bridge name is part of a filesystem path. This check is no substitute for Mandatory Access Control, but it certainly helps to catch the error early. Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com> [blp@ovn.org added a test] Acked-by: Ben Pfaff <blp@ovn.org>
* tests: Fix unbalanced parentheses that caused build break in testcase.William Tu2016-01-261-1/+1
| | | | | | | | | | | | The current build fails at this test case: /usr/bin/m4:tests/ovs-vswitchd.at:171: recursion limit of 1024 exceeded, use -L<N> to change it autom4te: /usr/bin/m4 failed with exit status: 1 Observed on Centos 6.5 with m4 version 1.4.13. Signed-off-by: William Tu <u9012063@gmail.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* ovsdb: test ovs-vswitchd for backward compatibilityAndy Zhou2015-12-111-0/+24
| | | | | | | | | | | | | | | | | | Add test to make sure ovs-vswitchd fall back to use the "monitor" method when connecting to an older ovsdb-server that does not support "monitor2". For testing backward compatibility, add an ovs-appctl command: "ovsdb-server/disable-monitor2". This command will restart all currently open jsonrpc connections, but without support for 'monitor2' JSON-RPC method for the new connections. There is no corresponding enable command, since this feature is only useful for testing. 'monitor2' will be available when ovsdb-server restarts. Signed-off-by: Andy Zhou <azhou@nicira.com> Acked-by: Ben Pfaff <blp@ovn.org>
* tests: Replace ON_EXIT m4 macro by on_exit() shell function.Ben Pfaff2015-09-091-1/+1
| | | | | | | | A shell function doesn't need quoted and unquoted variants and it integrates naturally with other shell code. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Andy Zhou <azhou@nicira.com>
* tests: Automatically initialize OVS_*DIR vars when tests begin.Ben Pfaff2015-09-091-4/+0
| | | | | | | | | | A lot of tests need to initialize the OVS_RUNDIR, OVS_LOGDIR, etc. variables to point to the directory in which the tests run. Until now, each of them has had to do this individually, which is redundant. This commit starts to do this automatically. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Andy Zhou <azhou@nicira.com>
* bridge: Relax the whitelist format for punix path.Alex Wang2015-08-291-0/+14
| | | | | | | | | | | This commit relaxes the whitelist format for punix path of service controller. Instead of only allowing punix:<ovs_rundir>/<bridge_name>.controller, the new format allows any suffix, like punix:<ovs_rundir>/<bridge_name>.*. (except one containing '/'). Signed-off-by: Alex Wang <ee07b291@gmail.com> Acked-by: Ben Pfaff <blp@nicira.com>
* ovs-vswitchd: Fix high cpu utilization when acquire idl lock fails.Alex Wang2014-10-091-0/+24
| | | | | | | | | | | | | | | When ovs-vswitchd fails to acquire the ovsdb idl lock (either due to contention or due to invalid database path), ovs-vswitchd will spin on the global connectivity sequence number and consume 100% cpu. This is in that the local copy is different to the global sequence number and never updated when ovsdb idl is not locked. To fix this issue, this commit makes ovs-vswitchd not checking the global connectivity sequence number in that situation. Reported-by: Ben Pfaff <blp@nicira.com> Signed-off-by: Alex Wang <alexw@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* ovs-vswitchd.at: Port tests to run successfully on Windows.Gurucharan Shetty2014-10-061-16/+6
| | | | | | | | | It is a little tricky to implement "$!" with unit tests on Windows. This commit changes the tests so that it works both on Windows and Linux. Signed-off-by: Gurucharan Shetty <gshetty@nicira.com> Acked-by: Alex Wang <alexw@nicira.com>
* ovs-vswitchd.at: Add test for switch over to another ovs-vswitchd.Alex Wang2014-10-031-0/+41
| | | | | | | | Test the switch over to inactive ovs-vswitchd process when user kill the currently active ovs-vswitchd. Signed-off-by: Alex Wang <alexw@nicira.com> Acked-by: Joe Stringer <joestringer@nicira.com>
* ovs-vswitchd.at: Fix "start additional ovs-vswitchd process" testYAMAMOTO Takashi2014-10-011-7/+2
| | | | | | | | | | | | | | | | | NetBSD implementation of wc command outputs extra whitespaces like the following. Tweak the test to success on such environments. % echo hoge|wc -l|hexdump -C 00000000 20 20 20 20 20 20 20 31 0a | 1.| 00000009 % The failing test was introduced by commit 6bef3c7ca859f208239ca61ec3b25c09a3571553 ("bridge: Fix high cpu utilization.") Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp> Acked-by: Joe Stringer <joestringer@nicira.com>
* bridge: Fix high cpu utilization.Alex Wang2014-09-301-0/+37
| | | | | | | | | | | | | | | When there are more than one ovs-vswitchd processes started, only one process is enabled. The disabled processes should just sleep. However, a bug in ovs makes the disabled processes keep waking up on global connectivity sequence number which is never sync'ed. Consequently, those processes use 100% cpu. This commit fixes the bug by always sync up the connectivity sequence number for disabled processes. Reported-by: Ben Pfaff <blp@nicira.com> Signed-off-by: Alex Wang <alexw@nicira.com> Acked-by: Joe Stringer <joestringer@nicira.com>
* tests: Use the 'LARGE_MSECS' variation of time/warp at more places.Gurucharan Shetty2014-07-151-5/+5
| | | | | | | | | | | commit 8661af798(timeval: Provide a variation for time/warp command) provided a variation of time/warp command to prevent multiple invocations of time/warp. That commit changed only the users in bfd.at and cfm.at as they used it the most. Since we haven't had any negative confequences because of the change, add the remaining users. Signed-off-by: Gurucharan Shetty <gshetty@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* ovs-vswitchd.at: Avoid using GNU sed extensionsYAMAMOTO Takashi2014-05-051-1/+1
| | | | | | | | | Introduced by commit 12eb035b. ("bridge: Allow users to configure statistics update to OVSDB.") Cc: Alex Wang <alexw@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com> Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
* ovs-vswitchd.at: Fix a comment typoYAMAMOTO Takashi2014-05-051-2/+2
| | | | | Acked-by: Ben Pfaff <blp@nicira.com> Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
* bridge: Allow users to configure statistics update to OVSDB.Alex Wang2014-05-021-0/+41
| | | | | | | | | | | | | | | | This commit adds a new configuration "stats-update-interval" in "other_config" of Open_Vswitch table. So users can control the statistics update frequency. A possible use case is that, users can lower the update frequency to reduce the cpu consumption of the ovs-vswitchd thread. The configured value should always be greater than or equal to 5000 ms. And more frequent statistics update should be achieved via OpenFlow. Signed-off-by: Alex Wang <alexw@nicira.com> Acked-by: Joe Stringer <joestringer@nicira.com>
* tests: Add test for ovs-vswitchd regression with empty db.Ben Pfaff2013-04-121-0/+27
Signed-off-by: Ben Pfaff <blp@nicira.com>