linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Richter <tmricht@linux.vnet.ibm.com>
To: linux-s390@vger.kernel.org, linux-perf-users@vger.kernel.org,
	acme@kernel.org, jolsa@redhat.com
Cc: Thomas Richter <tmricht@linux.vnet.ibm.com>
Subject: [PATCH 2/3] perf: fix exit code check in test case execution
Date: Tue,  6 Jun 2017 16:31:55 +0200	[thread overview]
Message-ID: <20170606143156.10471-3-tmricht@linux.vnet.ibm.com> (raw)
In-Reply-To: <20170606143156.10471-1-tmricht@linux.vnet.ibm.com>

Jiri Olsa's
Commit c9666c26ead0 ("perf tests attr: Make compare_data global")
introduced a wrong check on the command's return code exit status test:

  -        if ret != int(self.ret):
  +        if compare_data(str(ret), str(self.ret)):
             raise Unsup(self)

This check succeeds when the expected return code matches
the actual return code and raises the Unsup exceptions.
This is not correct.

Revert to the orignal check to raise the exception on
mismatch.

Signed-off-by: Thomas Richter <tmricht@linux.vnet.ibm.com>
---
 tools/perf/tests/attr.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/tests/attr.py b/tools/perf/tests/attr.py
index 5787879..d0242d8 100644
--- a/tools/perf/tests/attr.py
+++ b/tools/perf/tests/attr.py
@@ -174,7 +174,7 @@ class Test(object):
 
         log.info("  '%s' ret %d, expected %s" % (cmd, ret, str(self.ret)))
 
-        if compare_data(str(ret), str(self.ret)):
+        if ret != int(self.ret):
             raise Unsup(self)
 
     def compare(self, expect, result):
-- 
2.9.3

  parent reply	other threads:[~2017-06-06 14:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-06 14:31 [PATCH 0/3] perf fix test case 14 Thomas Richter
2017-06-06 14:31 ` [PATCH 1/3] perf: fix incorrect sample_type value for perf stat tests Thomas Richter
2017-06-06 14:31 ` Thomas Richter [this message]
2017-06-06 14:31 ` [PATCH 3/3] perf: fix perf test case 14 Thomas Richter
2017-06-07 11:17 ` [PATCH 0/3] perf fix " Jiri Olsa
2017-06-07 14:36   ` Thomas-Mich Richter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170606143156.10471-3-tmricht@linux.vnet.ibm.com \
    --to=tmricht@linux.vnet.ibm.com \
    --cc=acme@kernel.org \
    --cc=jolsa@redhat.com \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).