提交 f8fd1720 编写于 作者: C Cleber Rosa

tests/sleeptenmin.py: implement a test specific progress check

Which doesn't hold any logic, but serves as an example.

To watch the intended behavior in action, I recommend running the
"one_hundred_cycles" variant of this tests.

The test runner will show that the test is running (yellow throbber
spinning), and once each six seconds (+1% into the test run) a green
throbber will be shown.
Signed-off-by: NCleber Rosa <crosa@redhat.com>
上级 96560a6a
......@@ -31,6 +31,12 @@ class sleeptenmin(test.Test):
'sleep_cycles': 1,
'sleep_method': 'builtin'}
def check_progress(self):
"""
We do nothing besides sleeping, so anything can be considered progress
"""
return True
def action(self):
"""
Sleep for length seconds.
......@@ -44,6 +50,7 @@ class sleeptenmin(test.Test):
time.sleep(length)
elif self.params.sleep_method == 'shell':
os.system("sleep %s" % length)
self.communicate_state()
if __name__ == "__main__":
job.main()
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册