- group = parser.add_mutually_exclusive_group(required = True)
- group.add_argument("-s", "--server", action = "store", dest = "port",
- type = port,
- help = 'run in server mode and wait client to connect to this '
- 'port')
- group.add_argument('-c', "--client", action = "store", nargs = 2,
- dest = "servers", type = server_endpoint,
- metavar = ("SERVER1", "SERVER2"),
- help = 'run in client mode and do tests between these '
- 'two servers. Each server must be specified in following '
- 'format - ControlIP[:ControlPort][,TestIP[:TestPort]]. If '
- 'TestIP is omitted then ovs-test server will also use the '
- 'ControlIP for testing purposes. ControlPort is TCP port '
- 'where server will listen for incoming XML/RPC control '
- 'connections to schedule tests (by default 15531). TestPort '
- 'is port which will be used by server to send test traffic '
- '(by default 15532)')
+ parser.add_argument("-i", "--interval", action='store',
+ dest="testInterval", default=5, type=int,
+ help='Interval for how long to run each test in seconds.')
+
+ parser.add_argument("-t", "--tunnel-modes", action='store',
+ dest="tunnelModes", default=(), type=tunnel_types,
+ help='Do L3 tests with the given tunnel modes.')
+ parser.add_argument("-l", "--vlan-tag", action='store',
+ dest="vlanTag", default=None, type=vlan_tag,
+ help='Do VLAN tests and use the given VLAN tag.')
+ parser.add_argument("-d", "--direct", action='store_true',
+ dest="direct", default=None,
+ help='Do direct tests between both ovs-test servers.')
+
+ group = parser.add_mutually_exclusive_group(required=True)
+ group.add_argument("-s", "--server", action="store", dest="port",
+ type=port,
+ help='Run in server mode and wait for the client to '
+ 'connect to this port.')
+ group.add_argument('-c', "--client", nargs=2,
+ dest="servers", action=UniqueServerAction,
+ metavar=("SERVER1", "SERVER2"),
+ help='Run in client mode and do tests between these '
+ 'two ovs-test servers. Each server must be specified in '
+ 'following format - OuterIP:OuterPort,InnerIP[/mask] '
+ ':InnerPort. It is possible to start local instance of '
+ 'ovs-test server in the client mode by using 127.0.0.1 as '
+ 'OuterIP.')
+ return parser.parse_args()
+
+def l3_initialize_args():
+ """
+ Initialize argument parsing for ovs-l3ping utility.
+ """
+ parser = argparse.ArgumentParser(description='Test L3 tunnel '
+ 'connectivity between two Open vSwitch instances.')
+
+ parser.add_argument('-v', '--version', action='version',
+ version='ovs-l3ping (Open vSwitch) @VERSION@')
+
+ parser.add_argument("-b", "--bandwidth", action='store',
+ dest="targetBandwidth", default="1M", type=bandwidth,
+ help='Target bandwidth for UDP tests in bits/second. Use '
+ 'postfix M or K to alter unit magnitude.')
+ parser.add_argument("-i", "--interval", action='store',
+ dest="testInterval", default=5, type=int,
+ help='Interval for how long to run each test in seconds.')
+
+ parser.add_argument("-t", "--tunnel-mode", action='store',
+ dest="tunnelMode", required=True,
+ help='Do L3 tests with this tunnel type.')
+
+ group = parser.add_mutually_exclusive_group(required=True)
+ group.add_argument("-s", "--server", action="store", dest="server",
+ metavar="TUNNELIP,SERVER",
+ type=l3_endpoint_server,
+ help='Run in server mode and wait for the client to '
+ 'connect.')
+ group.add_argument('-c', "--client", action="store", dest="client",
+ metavar="TUNNELIP,CLIENT,SERVER",
+ type=l3_endpoint_client,
+ help='Run in client mode and connect to the server.')