未验证 提交 8bd68bca 编写于 作者: Y YongxueHong 提交者: GitHub

Merge pull request #2340 from menli820/bz_1822908

Add serial number length check with sg_vpd.exe tool for blk device
......@@ -79,6 +79,7 @@
Windows:
cmd = WIN_UTILS:\hddsn.exe C:
pattern = %s
sg_vpd_cmd = WIN_UTILS:\sg_vpd.exe -v --hex --page=0x80 C:
check_in_qtree = yes
qtree_check_keyword = id
qtree_check_value = image1
......
......@@ -27,6 +27,7 @@ def run(test, params, env):
parameter_prefix = params.get("parameter_prefix", "")
check_cmds = params["check_cmds"]
convert_str = params.get("convert_str")
sg_vpd_cmd = params.get("sg_vpd_cmd")
if params.get("start_vm") == "no":
if parameter_value == "random":
......@@ -109,6 +110,17 @@ def run(test, params, env):
" Guest output is '%s'" % (params_name,
output))
if sg_vpd_cmd:
error_context.context("Check serial number length with command %s"
% sg_vpd_cmd, logging.info)
sg_vpd_cmd = utils_misc.set_winutils_letter(session, sg_vpd_cmd)
output = session.cmd_output(sg_vpd_cmd)
actual_len = sum(len(_.split()[-1]) for _ in output.splitlines()[1:3])
expected_len = len(params.get("drive_serial_image1")) + 4
if actual_len != expected_len:
test.fail("Incorrect serial number length return."
" Guest output serial number is %s" % actual_len)
session.close()
if failed_log:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册