Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

Commit

Permalink
s/check_cpu/test_cpu/
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardobranco777 committed May 4, 2021
1 parent ad432e3 commit ae5db22
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion hawk_test.py
Expand Up @@ -111,7 +111,7 @@ def main():
browser.test('test_remove_group', results, mygroup)
browser.test('test_click_around_edit_conf', results)
time.sleep(60)
browser.check_cpu(results)
browser.test_cpu(results)
if args.slave:
browser.addr = args.slave
browser.test('test_fencing', results)
Expand Down
6 changes: 3 additions & 3 deletions hawk_test_driver.py
Expand Up @@ -209,15 +209,15 @@ def check_and_click_by_xpath(self, errmsg, xpath_exps):
time.sleep(2 * self.timeout_scale)

# Check CPU
def check_cpu(self, results):
def test_cpu(self, results):
# Check ps
cmd = "ps axo pcpu,comm | awk '/hawk|puma/ { total += $1 } END { print total }'"
cpu_usage = int(self.ssh.ssh.exec_command(cmd)[1].read().decode().strip())
print("INFO: CPU usage is %s" % cpu_usage)
if cpu_usage > 50:
self.set_test_status(results, "check_cpu", 'passed')
self.set_test_status(results, "test_cpu", 'passed')
else:
self.set_test_status(results, "check_cpu", 'failed')
self.set_test_status(results, "test_cpu", 'failed')

# Generic function to perform the tests
def test(self, testname, results, *extra):
Expand Down

0 comments on commit ae5db22

Please sign in to comment.