-
Notifications
You must be signed in to change notification settings - Fork 181
Add case to support heavy network traffic test after set adapterrss #6716
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
yanglei-rh
wants to merge
1
commit into
autotest:master
Choose a base branch
from
yanglei-rh:LIBVIRTAT-22206
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
libvirt/tests/cfg/virtual_network/qemu/netkvm_rss_test.cfg
This file contains hidden or 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,24 @@ | ||
| - virtual_network.qemu_test.netkvm_rss_test: image_copy | ||
| type = netkvm_rss_test | ||
| only Windows | ||
| only virtio_net | ||
| create_vm_libvirt = yes | ||
| kill_vm_libvirt = yes | ||
| ovmf: | ||
| kill_vm_libvirt_options = --nvram | ||
| master_images_clone = img1 | ||
| remove_image_image1 = yes | ||
| smp = 4 | ||
| vcpu_maxcpus = ${smp} | ||
| vcpu_dies = 1 | ||
| vcpu_cores = 1 | ||
| vcpu_sockets = ${smp} | ||
| win_max_vcpu_sockets = ${smp} | ||
| vcpu_threads = 1 | ||
| queues_nic1 = ${smp} | ||
| vectors = 10 | ||
| set_adapterrss_cmd = 'powershell -command "Set-NetAdapterRss -Name \"%s\" -NumberOfReceiveQueues ${vcpu_cores} -MaxProcessors ${vcpu_cores} -Profile Conservative"' | ||
| dst_path = "C:\Speedtest" | ||
| speedtest_path_cmd = "cd ${dst_path}\speedtest" | ||
| set_license_cmd = "speedtest --accept-license" | ||
| start_test_cmd = ".\speedtest.exe" | ||
This file contains hidden or 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,60 @@ | ||
| from virttest import data_dir | ||
| from virttest import utils_net | ||
| from virttest.libvirt_xml import vm_xml | ||
|
|
||
|
|
||
| def run(test, params, env): | ||
| """ | ||
| Test net adapter after set NetAdapterrss, this case will: | ||
|
|
||
| 1) boot up guest | ||
| 2) set NetAdapterrss | ||
| 3) use speedtest trigger some network traffic | ||
|
|
||
| :param test: QEMU test object | ||
| :param params: Dictionary with the test parameters | ||
| :param env: Dictionary with test environmen. | ||
| """ | ||
|
|
||
| def execute_command(command, timeout=60, omit=False): | ||
| """ | ||
| Execute command and return the output | ||
| """ | ||
| test.log.info("Sending command: %s", command) | ||
| status, output = session.cmd_status_output(command, timeout) | ||
| if status != 0 and omit is False: | ||
| test.error("execute command fail: %s" % output) | ||
| return output | ||
|
|
||
| vm = env.get_vm(params["main_vm"]) | ||
| vm.verify_alive() | ||
| test.log.debug("vm xml:\n%s", vm_xml.VMXML.new_from_dumpxml(vm.name)) | ||
| session = vm.wait_for_serial_login(timeout=360) | ||
|
|
||
| # Copy speedtest to guest | ||
| speedtest_host_path = data_dir.get_deps_dir("speedtest") | ||
| dst_path = params["dst_path"] | ||
| test.log.info("Copy Speedtest to guest.") | ||
| s, o = session.cmd_status_output("mkdir %s" % dst_path) | ||
| if s and "already exists" not in o: | ||
| test.error( | ||
| "Could not create Speedtest directory in " | ||
| "VM '%s', detail: '%s'" % (vm.name, o) | ||
| ) | ||
| vm.copy_files_to(speedtest_host_path, dst_path) | ||
|
|
||
| # set up adapterrss in guest | ||
| mac = vm.get_mac_address() | ||
| ifname = utils_net.get_windows_nic_attribute(session, "macaddress", mac, "netconnectionid") | ||
| set_adapterrss_cmd = params["set_adapterrss_cmd"] | ||
| execute_command(set_adapterrss_cmd % ifname) | ||
|
|
||
| # start test with speedtest | ||
| speedtest_path_cmd = params["speedtest_path_cmd"] | ||
| set_license_cmd = params["set_license_cmd"] | ||
| start_test_cmd = params["start_test_cmd"] | ||
| execute_command(speedtest_path_cmd) | ||
| execute_command(set_license_cmd, omit=True) | ||
| for _i in range(10): | ||
| output = execute_command(start_test_cmd, omit=True) | ||
| test.log.info(output) | ||
yanglei-rh marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.