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

Unified Diff: client/tests/kvm/tests/pxe.py

Issue 4823005: Merge remote branch 'cros/upstream' into tempbranch (Closed) Base URL: http://git.chromium.org/git/autotest.git@master
Patch Set: patch Created 10 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « client/tests/kvm/tests/ping.py ('k') | client/tests/kvm/tests/qmp_basic.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/tests/kvm/tests/pxe.py
diff --git a/client/tests/kvm/tests/pxe.py b/client/tests/kvm/tests/pxe.py
new file mode 100644
index 0000000000000000000000000000000000000000..ec9a549640e1d8aaaf4a29eb15d1a6b4c3b181cc
--- /dev/null
+++ b/client/tests/kvm/tests/pxe.py
@@ -0,0 +1,31 @@
+import logging
+from autotest_lib.client.common_lib import error
+import kvm_subprocess, kvm_test_utils
+
+
+def run_pxe(test, params, env):
+ """
+ PXE test:
+
+ 1) Snoop the tftp packet in the tap device.
+ 2) Wait for some seconds.
+ 3) Check whether we could capture TFTP packets.
+
+ @param test: KVM test object.
+ @param params: Dictionary with the test parameters.
+ @param env: Dictionary with test environment.
+ """
+ vm = kvm_test_utils.get_living_vm(env, params.get("main_vm"))
+ timeout = int(params.get("pxe_timeout", 60))
+
+ logging.info("Try to boot from PXE")
+ status, output = kvm_subprocess.run_fg("tcpdump -nli %s" % vm.get_ifname(),
+ logging.debug,
+ "(pxe capture) ",
+ timeout)
+
+ logging.info("Analyzing the tcpdump result...")
+ if not "tftp" in output:
+ raise error.TestFail("Couldn't find any TFTP packets after %s seconds" %
+ timeout)
+ logging.info("Found TFTP packet")
« no previous file with comments | « client/tests/kvm/tests/ping.py ('k') | client/tests/kvm/tests/qmp_basic.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698