-
Notifications
You must be signed in to change notification settings - Fork 168
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5202 from chloerh/sndbuf
Add network case of element sndbuf
- Loading branch information
Showing
3 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
libvirt/tests/cfg/virtual_network/elements_and_attributes/element_sndbuf.cfg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
- virtual_network.elements_and_attributes.sndbuf: | ||
type = element_sndbuf | ||
start_vm = no | ||
timeout = 240 | ||
outside_ip = 'www.redhat.com' | ||
vm_ping_outside = pass | ||
variants sndbuf: | ||
- 0: | ||
- 1600: | ||
- 1800: | ||
iface_attrs = {'type_name': 'network', 'source': {'network': 'default'}, 'model': 'virtio', 'tune': {'sndbuf': ${sndbuf}}} |
43 changes: 43 additions & 0 deletions
43
libvirt/tests/src/virtual_network/elements_and_attributes/element_sndbuf.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import logging | ||
|
||
from virttest import virsh | ||
from virttest.libvirt_xml import vm_xml | ||
from virttest.utils_libvirt import libvirt_vmxml | ||
from virttest.utils_test import libvirt | ||
|
||
from provider.virtual_network import network_base | ||
|
||
VIRSH_ARGS = {'ignore_status': False, 'debug': True} | ||
|
||
LOG = logging.getLogger('avocado.' + __name__) | ||
|
||
|
||
def run(test, params, env): | ||
""" | ||
Test 'sndbuf' element of interface | ||
""" | ||
vm_name = params.get('main_vm') | ||
vm = env.get_vm(vm_name) | ||
outside_ip = params.get('outside_ip') | ||
iface_attrs = eval(params.get('iface_attrs', '{}')) | ||
sndbuf = int(params.get('sndbuf')) | ||
|
||
vmxml = vm_xml.VMXML.new_from_inactive_dumpxml(vm_name) | ||
bkxml = vmxml.copy() | ||
|
||
try: | ||
vmxml.del_device('interface', by_tag=True) | ||
libvirt_vmxml.modify_vm_device(vmxml, 'interface', iface_attrs) | ||
LOG.debug(f'VMXML of {vm_name}:\n{virsh.dumpxml(vm_name).stdout_text}') | ||
|
||
vm.start() | ||
session = vm.wait_for_serial_login() | ||
|
||
libvirt.check_qemu_cmd_line(f'"sndbuf":{sndbuf}') | ||
|
||
ips = {'outside_ip': outside_ip} | ||
network_base.ping_check(params, ips, session, force_ipv4=True) | ||
session.close() | ||
|
||
finally: | ||
bkxml.sync() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -909,6 +909,7 @@ SMT | |
snaplist | ||
snapname | ||
snapshotname | ||
sndbuf | ||
socat | ||
socketscount | ||
sourse | ||
|