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

Side by Side Diff: client/virt/tests/pxe.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/ping.py ('k') | client/virt/tests/shutdown.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 1 import logging
2 from autotest_lib.client.common_lib import error 2 from autotest_lib.client.common_lib import error
3 import kvm_subprocess 3 from autotest_lib.client.virt import aexpect
4
5 4
6 def run_pxe(test, params, env): 5 def run_pxe(test, params, env):
7 """ 6 """
8 PXE test: 7 PXE test:
9 8
10 1) Snoop the tftp packet in the tap device. 9 1) Snoop the tftp packet in the tap device.
11 2) Wait for some seconds. 10 2) Wait for some seconds.
12 3) Check whether we could capture TFTP packets. 11 3) Check whether we could capture TFTP packets.
13 12
14 @param test: KVM test object. 13 @param test: KVM test object.
15 @param params: Dictionary with the test parameters. 14 @param params: Dictionary with the test parameters.
16 @param env: Dictionary with test environment. 15 @param env: Dictionary with test environment.
17 """ 16 """
18 vm = env.get_vm(params["main_vm"]) 17 vm = env.get_vm(params["main_vm"])
19 vm.verify_alive() 18 vm.verify_alive()
20 timeout = int(params.get("pxe_timeout", 60)) 19 timeout = int(params.get("pxe_timeout", 60))
21 20
22 logging.info("Try to boot from PXE") 21 logging.info("Try to boot from PXE")
23 output = kvm_subprocess.run_fg("tcpdump -nli %s" % vm.get_ifname(), 22 output = aexpect.run_fg("tcpdump -nli %s" % vm.get_ifname(),
24 logging.debug, "(pxe capture) ", timeout)[1] 23 logging.debug, "(pxe capture) ", timeout)[1]
25 24
26 logging.info("Analyzing the tcpdump result...") 25 logging.info("Analyzing the tcpdump result...")
27 if not "tftp" in output: 26 if not "tftp" in output:
28 raise error.TestFail("Couldn't find any TFTP packets after %s seconds" % 27 raise error.TestFail("Couldn't find any TFTP packets after %s seconds" %
29 timeout) 28 timeout)
30 logging.info("Found TFTP packet") 29 logging.info("Found TFTP packet")
OLDNEW
« no previous file with comments | « client/virt/tests/ping.py ('k') | client/virt/tests/shutdown.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698