selftest/powerpc: Fix false failures for skipped tests
authorSachin Sant <sachinp@linux.vnet.ibm.com>
Sun, 26 Feb 2017 06:08:39 +0000 (11:38 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 14 Dec 2017 08:28:17 +0000 (09:28 +0100)
commitcd662c8e51a1056407f851a02c08e1a74a3f9d0c
tree2308edef4dcda8918bba373c801d2e5b4b4edb99
parent0bf8f6e7205ab20884dcf249f59ae8a9309f5c98
selftest/powerpc: Fix false failures for skipped tests

[ Upstream commit a6d8a21596df041f36f4c2ccc260c459e3e851f1 ]

Tests under alignment subdirectory are skipped when executed on previous
generation hardware, but harness still marks them as failed.

  test: test_copy_unaligned
  tags: git_version:unknown
  [SKIP] Test skipped on line 26
  skip: test_copy_unaligned
  selftests: copy_unaligned [FAIL]

The MAGIC_SKIP_RETURN_VALUE value assigned to rc variable is retained till
the program exit which causes the test to be marked as failed.

This patch resets the value before returning to the main() routine.
With this patch the test o/p is as follows:

  test: test_copy_unaligned
  tags: git_version:unknown
  [SKIP] Test skipped on line 26
  skip: test_copy_unaligned
  selftests: copy_unaligned [PASS]

Signed-off-by: Sachin Sant <sachinp@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
tools/testing/selftests/powerpc/harness.c