lkml.org 
[lkml]   [2017]   [Nov]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH AUTOSEL for 4.9 09/52] selftest/powerpc: Fix false failures for skipped tests
    Date
    From: Sachin Sant <sachinp@linux.vnet.ibm.com>

    [ 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>
    ---
    tools/testing/selftests/powerpc/harness.c | 6 ++++--
    1 file changed, 4 insertions(+), 2 deletions(-)

    diff --git a/tools/testing/selftests/powerpc/harness.c b/tools/testing/selftests/powerpc/harness.c
    index 248a820048df..66d31de60b9a 100644
    --- a/tools/testing/selftests/powerpc/harness.c
    +++ b/tools/testing/selftests/powerpc/harness.c
    @@ -114,9 +114,11 @@ int test_harness(int (test_function)(void), char *name)

    rc = run_test(test_function, name);

    - if (rc == MAGIC_SKIP_RETURN_VALUE)
    + if (rc == MAGIC_SKIP_RETURN_VALUE) {
    test_skip(name);
    - else
    + /* so that skipped test is not marked as failed */
    + rc = 0;
    + } else
    test_finish(name, rc);

    return rc;
    --
    2.11.0
    \
     
     \ /
      Last update: 2017-11-29 19:00    [W:4.389 / U:0.056 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site