Skip to content

Commit

Permalink
selftests/resctrl: Fix incorrect error return on test complete
Browse files Browse the repository at this point in the history
An error snuck in between two recent conflicting changes:
Until recently ->setup() used negative values to indicate
normal test termination. This was changed in
commit fa10366 ("selftests/resctrl: Allow ->setup() to return
errors") that transitioned ->setup() to use negative values
to indicate errors and a new END_OF_TESTS to indicate normal
termination.

commit 42e3b09 ("selftests/resctrl: Fix set up schemata with 100%
allocation on first run in MBM test") continued to use
negative return to indicate normal test termination.

Fix mbm_setup() to use the new END_OF_TESTS to indicate
error-free test termination.

Fixes: 42e3b09 ("selftests/resctrl: Fix set up schemata with 100% allocation on first run in MBM test")
Reported-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/lkml/bb65cce8-54d7-68c5-ef19-3364ec95392a@linux.intel.com/
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
  • Loading branch information
Reinette Chatre authored and Shuah Khan committed Apr 14, 2023
1 parent 91db4fd commit 50ad2fb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/testing/selftests/resctrl/mbm_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ static int mbm_setup(int num, ...)

/* Run NUM_OF_RUNS times */
if (p->num_of_runs >= NUM_OF_RUNS)
return -1;
return END_OF_TESTS;

/* Set up shemata with 100% allocation on the first run. */
if (p->num_of_runs == 0)
Expand Down

0 comments on commit 50ad2fb

Please sign in to comment.