提交 e7c9ce3b 编写于 作者: J Jonas Eriksson

clock drift with ntp test: Fix drift file parsing

- int("1.1") is an error in python; if the input is a string, it cannot
  contain decimals.

- The contents of the drift file can be negative, make sure to convert
  the number to the absolute value before comparing with 20.
Signed-off-by: NJonas Eriksson <jonas.eriksson@enea.com>
上级 f4a085a9
......@@ -97,6 +97,6 @@ def run(test, params, env):
error.context("Verify the drift file content on guest", logging.info)
output = session.cmd("cat /var/lib/ntp/drift")
if int(output) > 20:
if int(abs(float(output))) > 20:
raise error.TestFail("Failed to check the ntp drift."
" Output: '%s'" % output)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册