提交 11a5bcfb 编写于 作者: X Xu Tian 提交者: Lucas Meneghel Rodrigues

virt.tests: update pxe test steps info

Signed-off-by: NXu Tian <xutian@redhat.com>
上级 df78e4d1
......@@ -2,27 +2,29 @@ import logging
from autotest.client.shared import error
from virttest import aexpect
@error.context_aware
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.
1) Boot up guest from NIC(from pxe/gpxe server)
2) Snoop the tftp packet in the tap device
3) Analyzing the tcpdump result
@param test: QEMU test object.
@param params: Dictionary with the test parameters.
@param env: Dictionary with test environment.
"""
error.context("Try to boot from NIC", logging.info)
vm = env.get_vm(params["main_vm"])
vm.verify_alive()
timeout = int(params.get("pxe_timeout", 60))
logging.info("Try to boot from PXE")
error.context("Snoop packet in the tap device", logging.info)
output = aexpect.run_fg("tcpdump -nli %s" % vm.get_ifname(),
logging.debug, "(pxe capture) ", timeout)[1]
logging.info("Analyzing the tcpdump result...")
error.context("Analyzing the tcpdump result", logging.info)
if not "tftp" in output:
raise error.TestFail("Couldn't find any TFTP packets after %s seconds" %
timeout)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册