summaryrefslogtreecommitdiff
path: root/python/ovstest
Commit message (Collapse)AuthorAgeFilesLines
* Remove Python 2 leftovers.Rosemarie O'Riorden2021-06-225-19/+7
| | | | | | | Fixes: 1ca0323e7c29 ("Require Python 3 and remove support for Python 2.") Reported at: https://bugzilla.redhat.com/show_bug.cgi?id=1949875 Signed-off-by: Rosemarie O'Riorden <roriorde@redhat.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
* Remove dependency on python3-sixTimothy Redaelli2019-12-202-9/+4
| | | | | | | | | | | Since Python 2 support was removed in 1ca0323e7c29 ("Require Python 3 and remove support for Python 2."), python3-six is not needed anymore. Moreover python3-six is not available on RHEL/CentOS7 without using EPEL and so this patch is needed in order to release OVS 2.13 on RHEL7. Signed-off-by: Timothy Redaelli <tredaelli@redhat.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* Replace most uses of and references to "ifconfig" by "ip".Ben Pfaff2017-06-013-17/+44
| | | | | | | | | | | | | | | | | | | | | | It's becoming more common that OSes include "ip" but not "ifconfig", so it's best to avoid using the latter. This commit removes most references to "ifconfig" and replaces them by "ip". It also adds a build-time check to make it harder to introduce new uses of "ifconfig". There are important differences between "ifconfig" and "ip": - An "ifconfig" command that sets an IP address also brings the interface up, but a similar "ip addr add" command does not, so it is often necessary (or at least precautionary) to add an "ip link set <dev> up" command. - "ifconfig" can infer a netmask from an IP adddress, but "ip" always assumes /32 if none is given. - "ifconfig" with address 0.0.0.0 removes any configured IP address, but "ip addr add" does not, so "ifconfig <dev> 0.0.0.0" must be replaced by "ip addr del" or "ip addr flush". Signed-off-by: Ben Pfaff <blp@ovn.org>
* Adapt to flake8-import-orderxurong000379972017-03-083-9/+18
| | | | | | | | | | https://review.openstack.org/#/c/432906/ flake8-import-order adds 3 new flake8 warnings: I100: Your import statements are in the wrong order. I101: The names in your from import are in the wrong order. I201: Missing newline between sections or imports. Signed-off-by: Ben Pfaff <blp@ovn.org>
* python: Drop usage of long type.Russell Bryant2016-02-022-3/+3
| | | | | | | | | | | | | | | | | | | | | Python 2 has both long and int types. Python 3 only has int, which behaves like long. In the case of needing a set of integer types, we can use six.integer_types which includes int and long for Python 2 and just int for Python 3. We can convert all cases of long(value) to int(value), because as of Python 2.4, when the result of an operation would be too big for an int, the type is automatically converted to a long. There were several places in this patch doing type comparisons. The preferred way to do this is using the isinstance() or issubclass() built-in functions, so I converted the similar checks nearby while I was at it. Signed-off-by: Russell Bryant <russell@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>
* python: Stop using xrange().Russell Bryant2016-01-201-0/+1
| | | | | | | | | | | | Python 2 had range() and xrange(). xrange() is more efficient, but behaves differently so range() was retained for compatibility. Python 3 only has range() and it behaves like Python 2's xrange(). Remove explicit use of xrange() and use six.moves.range() to make sure we're using xrange() from Python 2 or range() from Python 3. Signed-off-by: Russell Bryant <russell@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>
* python: Fix xmlrpclib imports.Russell Bryant2016-01-202-4/+7
| | | | | | | | | | | | | | Fix imports of xmlrpclib to be compatible with Python 3. Python 2 had xmlrpclib (client) and SimpleXMLRPCServer (server). In Python 3, these have been renamed to xmlrpc.client and xmlrpc.server. The solution implemented here is to use the six library. It may seem excessive for this particular issue, but the six library provides helpers for Python 2 and 3 compatibility for many different issues. This is just the first of many uses of the six library. Signed-off-by: Russell Bryant <russell@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>
* python: Fix print function compatibility.Russell Bryant2016-01-122-17/+21
| | | | | | | | | | | | | | | The print statement from Python 2 is a function in Python 3. Enable print function support for Python 2 and convert print statements to function calls. Enable the H233 flake8 warning. If the hacking plugin is installed, this will generate warnings for print statement usage not compatible with Python 3. H233 Python 3.x incompatible use of print operator Signed-off-by: Russell Bryant <russell@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>
* python: Stop use of tuple parameter unpackingRussell Bryant2016-01-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | Python 3 removed support for tuple parameter unpacking. https://www.python.org/dev/peps/pep-3113/ Instead of: def foo((a, b)): print(a) print(b) you should do: def foo(a_b): a, b = a_b print(a) print(b) but in both uses here, the values were never used so the fix is even simpler. Signed-off-by: Russell Bryant <russell@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>
* python: Resolve some indentation warnings.Russell Bryant2016-01-051-3/+3
| | | | | | | | | | | | | | This patch resolves the following warnings from flake8: E111 indentation is not a multiple of four E112 expected an indented block E113 unexpected indentation It's critical to have correct indentation in Python code, so it seemed worth enabling these warnings. Signed-off-by: Russell Bryant <russell@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>
* python: Add missing Apache License headers.Russell Bryant2016-01-051-0/+12
| | | | | Signed-off-by: Russell Bryant <russell@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>
* python: Fix several pep8 whitespace errors.Russell Bryant2016-01-052-7/+7
| | | | | | | | | | | | | | | | | | | | Fix the following pep8 errors: E201 whitespace after '(' E203 whitespace before ',' E222 multiple spaces after operator E225 missing whitespace around operator E226 missing whitespace around arithmetic operator E231 missing whitespace after ':' E241 multiple spaces after ':' E251 unexpected spaces around keyword / parameter equals E261 at least two spaces before inline comment E262 inline comment should start with '# ' E265 block comment should start with '# ' E271 multiple spaces after keyword Signed-off-by: Russell Bryant <russell@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>
* python: Resolve pep8 blank line errors.Russell Bryant2016-01-053-1/+3
| | | | | | | | | | Resolve pep8 errors E302 and E303: E302 expected 2 blank lines, found 1 E303 too many blank lines (3) Signed-off-by: Russell Bryant <russell@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>
* python: Remove unused imports and variables.Russell Bryant2016-01-051-3/+0
| | | | | | | | | | This resolves the following flake8 error types: F841 local variable 'e' is assigned to but never used F401 'exceptions' imported but unused Signed-off-by: Russell Bryant <russell@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>
* ovs-l3ping: A new test utility that allows to detect L3 tunneling issuesAnsis Atteka2012-07-024-0/+406
| | | | | | | | | | | | | | | | | | ovs-l3ping is similar to ovs-test, but the main difference is that it does not require administrator to open firewall holes for the XML/RPC control connection. This is achieved by encapsulating the Control Connection over the L3 tunnel itself. This tool is not intended as a replacement for ovs-test, because ovs-test covers much broader set of test cases. Sample usage: Node1: ovs-l3ping -s 192.168.122.236,10.1.1.1 -t gre Node2: ovs-l3ping -c 192.168.122.220,10.1.1.2,10.1.1.1 -t gre Issue#11791 Signed-off-by: Ansis Atteka <aatteka@nicira.com>
* Global replace of Nicira Networks.Raju Subramanian2012-05-026-6/+6
| | | | | | | | Replaced all instances of Nicira Networks(, Inc) to Nicira, Inc. Feature #10593 Signed-off-by: Raju Subramanian <rsubramanian@nicira.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* ovs-test: Enhancements to the ovs-test toolAnsis Atteka2012-04-186-108/+507
| | | | | | | | | | | | | | | | | | | -Implemented support for ovs-test client, so that it could automatically spawn an ovs-test server process from itself. This reduces the number of commands the user have to type to get tests running. -Automated creation of OVS bridges and ports (for VLAN and GRE tests), so that user would not need to invoke ovs-vsctl manually to switch from direct, 802.1Q and GRE tests. -Fixed some pylint reported warnings. -Fixed ethtool invocation so that we always try to query the physical interface to get the driver name and version. -and some others enhancements. The new usage: Node1:ovs-test -s 15531 Node2:ovs-test -c 127.0.0.1,1.1.1.1 192.168.122.151,1.1.1.2 -d -l 125 -t gre Signed-off-by: Ansis Atteka <aatteka@nicira.com>
* ovs-test: A new tool that allows to diagnose connectivity and performance issuesAnsis Atteka2011-11-186-0/+622
This tool will be a replacement for the current ovs-vlan-test utility. Besides from connectivity issues it will also be able to detect performance related issues in Open vSwitch setups. Currently it uses UDP and TCP protocols for stressing. Issue #6976