Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(80)

Side by Side Diff: client/virt/tests/nic_promisc.py

Issue 6883246: Merge autotest upstream from @5318 ~ @5336 (Closed) Base URL: ssh://gitrw.chromium.org:9222/autotest.git@master
Patch Set: patch Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « client/virt/tests/netperf.py ('k') | client/virt/tests/nicdriver_unload.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 import logging, threading 1 import logging, threading
2 from autotest_lib.client.common_lib import error 2 from autotest_lib.client.common_lib import error
3 from autotest_lib.client.bin import utils 3 from autotest_lib.client.bin import utils
4 from autotest_lib.client.tests.kvm.tests import file_transfer 4 from autotest_lib.client.tests.kvm.tests import file_transfer
5 import kvm_utils, kvm_test_utils 5 from autotest_lib.client.virt import virt_test_utils, virt_utils
6 6
7 7
8 def run_nic_promisc(test, params, env): 8 def run_nic_promisc(test, params, env):
9 """ 9 """
10 Test nic driver in promisc mode: 10 Test nic driver in promisc mode:
11 11
12 1) Boot up a VM. 12 1) Boot up a VM.
13 2) Repeatedly enable/disable promiscuous mode in guest. 13 2) Repeatedly enable/disable promiscuous mode in guest.
14 3) Transfer file from host to guest, and from guest to host in the same time 14 3) Transfer file from host to guest, and from guest to host in the same time
15 15
16 @param test: KVM test object. 16 @param test: KVM test object.
17 @param params: Dictionary with the test parameters. 17 @param params: Dictionary with the test parameters.
18 @param env: Dictionary with test environment. 18 @param env: Dictionary with test environment.
19 """ 19 """
20 vm = env.get_vm(params["main_vm"]) 20 vm = env.get_vm(params["main_vm"])
21 vm.verify_alive() 21 vm.verify_alive()
22 timeout = int(params.get("login_timeout", 360)) 22 timeout = int(params.get("login_timeout", 360))
23 session_serial = vm.wait_for_serial_login(timeout=timeout) 23 session_serial = vm.wait_for_serial_login(timeout=timeout)
24 24
25 ethname = kvm_test_utils.get_linux_ifname(session_serial, 25 ethname = virt_test_utils.get_linux_ifname(session_serial,
26 vm.get_mac_address(0)) 26 vm.get_mac_address(0))
27 27
28 try: 28 try:
29 transfer_thread = kvm_utils.Thread(file_transfer.run_file_transfer, 29 transfer_thread = virt_utils.Thread(file_transfer.run_file_transfer,
30 (test, params, env)) 30 (test, params, env))
31 transfer_thread.start() 31 transfer_thread.start()
32 while transfer_thread.isAlive(): 32 while transfer_thread.isAlive():
33 session_serial.cmd("ip link set %s promisc on" % ethname) 33 session_serial.cmd("ip link set %s promisc on" % ethname)
34 session_serial.cmd("ip link set %s promisc off" % ethname) 34 session_serial.cmd("ip link set %s promisc off" % ethname)
35 except: 35 except:
36 transfer_thread.join(suppress_exception=True) 36 transfer_thread.join(suppress_exception=True)
37 raise 37 raise
38 else: 38 else:
39 transfer_thread.join() 39 transfer_thread.join()
OLDNEW
« no previous file with comments | « client/virt/tests/netperf.py ('k') | client/virt/tests/nicdriver_unload.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698