Add option to run same network test only
Add new command line option to allow the user to run only tests with the same L2 network: vmtp.py --same-network-only Change-Id: If7346f74c329c62d1c6b36aa80cb389258503f9a
This commit is contained in:
parent
041039359b
commit
8d091e3866
@ -15,9 +15,9 @@ VMTP Usage
|
|||||||
[--mongod-server <server ip>] [--json <file>]
|
[--mongod-server <server ip>] [--json <file>]
|
||||||
[--tp-tool <nuttcp|iperf>]
|
[--tp-tool <nuttcp|iperf>]
|
||||||
[--availability_zone <availability_zone>] [--hypervisor [<az>:]
|
[--availability_zone <availability_zone>] [--hypervisor [<az>:]
|
||||||
<hostname>] [--inter-node-only] [--protocols <T|U|I>]
|
<hostname>] [--inter-node-only] [--same-network-only]
|
||||||
[--bandwidth <bandwidth>] [--tcpbuf <tcp_pkt_size1,...>]
|
[--protocols <T|U|I>] [--bandwidth <bandwidth>]
|
||||||
[--udpbuf <udp_pkt_size1,...>]
|
[--tcpbuf <tcp_pkt_size1,...>] [--udpbuf <udp_pkt_size1,...>]
|
||||||
[--reuse_network_name <network_name>]
|
[--reuse_network_name <network_name>]
|
||||||
[--os-dataplane-network <network_name>]
|
[--os-dataplane-network <network_name>]
|
||||||
[--delete-image-after-run] [--no-env]
|
[--delete-image-after-run] [--no-env]
|
||||||
@ -56,6 +56,7 @@ VMTP Usage
|
|||||||
--hypervisor [<az>:] <hostname>
|
--hypervisor [<az>:] <hostname>
|
||||||
hypervisor to use (1 per arg, up to 2 args)
|
hypervisor to use (1 per arg, up to 2 args)
|
||||||
--inter-node-only only measure inter-node
|
--inter-node-only only measure inter-node
|
||||||
|
--same-network-only only measure same network
|
||||||
--protocols <T|U|I> protocols T(TCP), U(UDP), I(ICMP) - default=TUI (all)
|
--protocols <T|U|I> protocols T(TCP), U(UDP), I(ICMP) - default=TUI (all)
|
||||||
--bandwidth <bandwidth>
|
--bandwidth <bandwidth>
|
||||||
the bandwidth limit for TCP/UDP flows in K/M/Gbps,
|
the bandwidth limit for TCP/UDP flows in K/M/Gbps,
|
||||||
|
@ -114,6 +114,8 @@ class Network(object):
|
|||||||
config.dns_nameservers,
|
config.dns_nameservers,
|
||||||
subnet_v6, cidr_v6, config.ipv6_mode)
|
subnet_v6, cidr_v6, config.ipv6_mode)
|
||||||
self.vm_int_net.append(int_net)
|
self.vm_int_net.append(int_net)
|
||||||
|
if config.same_network_only:
|
||||||
|
break
|
||||||
else:
|
else:
|
||||||
for (net, subnet, cidr) in zip(config.internal_network_name,
|
for (net, subnet, cidr) in zip(config.internal_network_name,
|
||||||
config.internal_subnet_name,
|
config.internal_subnet_name,
|
||||||
@ -121,6 +123,8 @@ class Network(object):
|
|||||||
int_net = self.create_net(net, subnet, cidr,
|
int_net = self.create_net(net, subnet, cidr,
|
||||||
config.dns_nameservers)
|
config.dns_nameservers)
|
||||||
self.vm_int_net.append(int_net)
|
self.vm_int_net.append(int_net)
|
||||||
|
if config.same_network_only:
|
||||||
|
break
|
||||||
|
|
||||||
# Add both internal networks to router interface to enable
|
# Add both internal networks to router interface to enable
|
||||||
# network to network connectivity
|
# network to network connectivity
|
||||||
|
13
vmtp/vmtp.py
13
vmtp/vmtp.py
@ -309,8 +309,11 @@ class VmtpTest(object):
|
|||||||
client.buginf('SSH connected')
|
client.buginf('SSH connected')
|
||||||
client.create()
|
client.create()
|
||||||
FlowPrinter.print_desc('External-VM (upload/download)')
|
FlowPrinter.print_desc('External-VM (upload/download)')
|
||||||
|
target_ip = self.server.ssh_access.host
|
||||||
|
if self.config.same_network_only:
|
||||||
|
target_ip = self.server.internal_ip
|
||||||
res = client.run_client('External-VM',
|
res = client.run_client('External-VM',
|
||||||
self.server.ssh_access.host,
|
target_ip,
|
||||||
self.server,
|
self.server,
|
||||||
bandwidth=self.config.vm_bandwidth,
|
bandwidth=self.config.vm_bandwidth,
|
||||||
bidirectional=True)
|
bidirectional=True)
|
||||||
@ -370,7 +373,7 @@ class VmtpTest(object):
|
|||||||
self.server.internal_ip)
|
self.server.internal_ip)
|
||||||
self.client.dispose()
|
self.client.dispose()
|
||||||
self.client = None
|
self.client = None
|
||||||
if not self.config.reuse_network_name:
|
if not self.config.reuse_network_name and not self.config.same_network_only:
|
||||||
# Different network
|
# Different network
|
||||||
self.create_flow_client(client_az, self.net.vm_int_net[1])
|
self.create_flow_client(client_az, self.net.vm_int_net[1])
|
||||||
|
|
||||||
@ -741,6 +744,11 @@ def parse_opts_from_cli():
|
|||||||
action='store_true',
|
action='store_true',
|
||||||
help='only measure inter-node')
|
help='only measure inter-node')
|
||||||
|
|
||||||
|
parser.add_argument('--same-network-only', dest='same_network_only',
|
||||||
|
default=False,
|
||||||
|
action='store_true',
|
||||||
|
help='only measure same network')
|
||||||
|
|
||||||
parser.add_argument('--protocols', dest='protocols',
|
parser.add_argument('--protocols', dest='protocols',
|
||||||
action='store',
|
action='store',
|
||||||
default='TUI',
|
default='TUI',
|
||||||
@ -850,6 +858,7 @@ def merge_opts_to_configs(opts):
|
|||||||
config.debug = opts.debug
|
config.debug = opts.debug
|
||||||
config.stop_on_error = opts.stop_on_error
|
config.stop_on_error = opts.stop_on_error
|
||||||
config.inter_node_only = opts.inter_node_only
|
config.inter_node_only = opts.inter_node_only
|
||||||
|
config.same_network_only = opts.same_network_only
|
||||||
|
|
||||||
if config.public_key_file and not os.path.isfile(config.public_key_file):
|
if config.public_key_file and not os.path.isfile(config.public_key_file):
|
||||||
print('Warning: invalid public_key_file:' + config.public_key_file)
|
print('Warning: invalid public_key_file:' + config.public_key_file)
|
||||||
|
Loading…
Reference in New Issue
Block a user