From 462d80d8e15386f0541186c91df9207d58f12acb Mon Sep 17 00:00:00 2001 From: Misbah Anjum N Date: Fri, 29 Mar 2024 05:50:30 -0500 Subject: [PATCH] perf:check_valid_chip - Update test to avoid fail Command: perf stat -v -e hv_24x7/PM_PHB0_0_CYC,domain=1,chip= Maximum chip value which can be assigned is 65535 Anything above that range should fail and this test is used to verify that Hence, setting invalid_chip=65536 can directly test the command In scenarious where multiple chip values are tested, this testcase can fail if the chip values passed before 65536 are in the accepted range. Signed-off-by: Misbah Anjum N --- perf/perf_24x7_hardware_counters.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/perf/perf_24x7_hardware_counters.py b/perf/perf_24x7_hardware_counters.py index a2df62bca..b5e4655bf 100755 --- a/perf/perf_24x7_hardware_counters.py +++ b/perf/perf_24x7_hardware_counters.py @@ -214,16 +214,16 @@ def test_check_valid_chip(self): def test_check_invalid_chip(self): """ Test invalid out of range chip value + chip can take maximum value of 65535 only """ - invalid_chip = [self.chips, 65536] - for chip_val in invalid_chip: - if self.rev == '004b' or self.rev == '004e': - cmd = "hv_24x7/PM_PB_CYC,domain=1,chip=%s/ /bin/true" % chip_val - if self.rev == '0080': - cmd = "hv_24x7/PM_PHB0_0_CYC,domain=1,chip=%s/ /bin/true" % chip_val - res = self.event_stat1(cmd) - if res.exit_status == 0: - self.fail("perf unable to recognise invalid chip value") + invalid_chip = 65536 + if self.rev == '004b' or self.rev == '004e': + cmd = "hv_24x7/PM_PB_CYC,domain=1,chip=%s/ /bin/true" % invalid_chip + if self.rev == '0080': + cmd = "hv_24x7/PM_PHB0_0_CYC,domain=1,chip=%s/ /bin/true" % invalid_chip + res = self.event_stat1(cmd) + if res.exit_status == 0: + self.fail("perf unable to recognise invalid chip value") def test_domain_chip_offset(self): cmd = "perf stat -r 10 -x ' ' perf stat -r 10 -x ' ' \