Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Addes test case to capture ebizzy workload in perf top tool #2796

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion perf/perf_top.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@
import time
import platform
import pexpect
import tempfile
import os
from avocado import Test
from avocado.utils import distro, dmesg
from avocado.utils import distro, dmesg, process, genio
from avocado.utils.software_manager.manager import SoftwareManager


Expand Down Expand Up @@ -62,6 +64,9 @@ def setUp(self):
# Clear the dmesg by that we can capture delta at the end of the test
dmesg.clear_dmesg()

# Creating a temprory file
self.temp_file = tempfile.NamedTemporaryFile().name

def test_top(self):
if self.option in ["-k", "--vmlinux", "--kallsyms"]:
if self.distro_name in ['rhel', 'fedora', 'centos']:
Expand All @@ -82,3 +87,18 @@ def test_top(self):
self.fail("Unknown option %s" % self.option)
dmesg.collect_errors_dmesg(['WARNING: CPU:', 'Oops', 'Segfault',
'soft lockup', 'Unable to handle'])

def test_workload_output(self):
process.getoutput("perf top -a > %s " % self.temp_file, timeout=10)
perf_top_output = genio.read_file(self.temp_file).splitlines()
flag = False
for lines in perf_top_output:
if "ebizzy" in lines:
flag = True
break
if flag is False:
self.fail("ebizzy workload not captured in perf top")

def tearDown(self):
if os.path.isfile(self.temp_file):
process.system('rm -f %s' % self.temp_file)
Loading