From patchwork Wed Nov 6 10:29:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Po-Hsu Lin X-Patchwork-Id: 1190260 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 477N7Y1cSQz9sRK; Wed, 6 Nov 2019 21:29:29 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1iSIYz-0005Ii-C9; Wed, 06 Nov 2019 10:29:21 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1iSIYx-0005IB-7k for kernel-team@lists.ubuntu.com; Wed, 06 Nov 2019 10:29:19 +0000 Received: from mail-pf1-f197.google.com ([209.85.210.197]) by youngberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1iSIYw-0003rm-Qf for kernel-team@lists.ubuntu.com; Wed, 06 Nov 2019 10:29:19 +0000 Received: by mail-pf1-f197.google.com with SMTP id s24so7854931pfd.0 for ; Wed, 06 Nov 2019 02:29:18 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=jWabeRFR1d1ihDBAANG0GRK/unur3Twwe2h/WTg9FSM=; b=aImf4eHgRFVCLp6ZPlPhGV+nIOHGUUye7XcuX8GIQBAEgxgVmERXv95lNP6w1YSlpU RCUWrMT6g8/FEVkTiU9swdH/dl6HgUDjCuFuTfGCIt+zJsDw+dDf8VK8xCxPGVFxLkAw HzNNShzwNaQUFXteg1ps3RkcuI+zc6t2wRMysKYRxzcgtTJMG+bqm6Up6A1NpKj8JSjb Bt2tl5OBIgPZFhPBgtN2hk0Oo5KA3H1Ncj9KEJpJSGOnbHQazbeuIz/KWJCbZG99XqOw PC54MY9+SuqKvPHQjzlont6wyXgcI1MJkho6TrcCEyezKZdyGOmPnWuXxDLRn3wSR/AX qYyA== X-Gm-Message-State: APjAAAVgLItCALM47peFJljsLwD9jGLK+VqBR21IQ8VGqsSSA4I4t6q3 7HzMHA4KVV9leO46vCzYWu7ZYmcqk7GM7TZtztvZ2FaxRW/9S/7REh+AHEXBaZCNZx3FtOqx1G6 sdgvF3dBvYjrTP52MskLKepoztX0uczr9zk1SFJnr X-Received: by 2002:a63:1c06:: with SMTP id c6mr1983667pgc.417.1573036157202; Wed, 06 Nov 2019 02:29:17 -0800 (PST) X-Google-Smtp-Source: APXvYqxFEvef1VjM4wakWUf17SgErjXeTjR6YL9EnOLI6KDpGTWMQCe6NbAbGvXHoY1JgEhdrYehVw== X-Received: by 2002:a63:1c06:: with SMTP id c6mr1983634pgc.417.1573036156891; Wed, 06 Nov 2019 02:29:16 -0800 (PST) Received: from Leggiero.taipei.internal (61-220-137-37.HINET-IP.hinet.net. [61.220.137.37]) by smtp.gmail.com with ESMTPSA id x10sm19872046pgl.53.2019.11.06.02.29.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Nov 2019 02:29:16 -0800 (PST) From: Po-Hsu Lin To: kernel-team@lists.ubuntu.com Subject: [Bionic][SRU][PATCH 1/4] selftests: lib.mk set KSFT_TAP_LEVEL to prevent nested TAP headers Date: Wed, 6 Nov 2019 18:29:03 +0800 Message-Id: <20191106102906.28118-2-po-hsu.lin@canonical.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191106102906.28118-1-po-hsu.lin@canonical.com> References: <20191106102906.28118-1-po-hsu.lin@canonical.com> X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Shuah Khan BugLink: https://bugs.launchpad.net/bugs/1812352 Set KSFT_TAP_LEVEL before running tests to prevent nested TAP header printing from tests. Signed-off-by: Shuah Khan (cherry picked from commit 771cbc3bcbb59084766a501772853f2de7009534) Signed-off-by: Po-Hsu Lin --- tools/testing/selftests/lib.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk index 6cd4695..51bc464 100644 --- a/tools/testing/selftests/lib.mk +++ b/tools/testing/selftests/lib.mk @@ -32,6 +32,7 @@ endif .ONESHELL: define RUN_TESTS + @export KSFT_TAP_LEVEL=`echo 1`; @test_num=`echo 0`; @echo "TAP version 13"; @for TEST in $(1); do \ From patchwork Wed Nov 6 10:29:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Po-Hsu Lin X-Patchwork-Id: 1190259 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 477N7X3rjvz9sRD; Wed, 6 Nov 2019 21:29:28 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1iSIZ0-0005JR-Kj; Wed, 06 Nov 2019 10:29:22 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1iSIYz-0005Ib-0b for kernel-team@lists.ubuntu.com; Wed, 06 Nov 2019 10:29:21 +0000 Received: from mail-pf1-f198.google.com ([209.85.210.198]) by youngberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1iSIYy-0003rt-9t for kernel-team@lists.ubuntu.com; Wed, 06 Nov 2019 10:29:20 +0000 Received: by mail-pf1-f198.google.com with SMTP id a14so18658827pfr.12 for ; Wed, 06 Nov 2019 02:29:20 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=cE0FqhIbpsFg7cwPP3dEtwX7l0oCp6LmeRQBeWrk8Jo=; b=Zqk4WmhUZ7zKLGl6vI2Pp7ITA4cKfJrR2l+z1uxT53wxwZqO+SsRzv/Ld9w0nG6VsK eQdsNJW46BpKpR/zhrAnKmTO0OtyImzBnNXOEwujbG+ChS+vbbQ0Sc/AYPa5L+q4+XhU noBceQwXYTaEWhUliuApE9ACByngLMxTKv+dzhOsbX11uS5rD69pEEhr5HpieO7YK0bZ zqsnPdZHNH4w1Na9fTm/kzIXr5sGtUy2Mgya6XPsG/sQG/Al134KrvSAdhY3nRcKOCRX iSHrZxBYORLMT94OhLvUG+ePtxFUbOGKEC2Fq7th+Km7I57Xbi/pzuqWjjQiM/YDRWdo a1uQ== X-Gm-Message-State: APjAAAX+YT3JKOike9cGrNKHeHliOzY9abgMgkWVEMQ+/ckQAxFZ4kfE TFky3Cm90YiOTRXt9dV23Ba4+qu6r8h9vuWHBM+jKegf+xEza6M5EPUPvE7slbj8YCBFsQ8Jf3b sETInAawMdqv1aW085A76wh91WoNfQOsGaeZApcPO X-Received: by 2002:a63:f244:: with SMTP id d4mr1971765pgk.233.1573036158714; Wed, 06 Nov 2019 02:29:18 -0800 (PST) X-Google-Smtp-Source: APXvYqzr0lj/WGU2BQZepxYJN3PbYhnoEVvog2Gb4BuSFFCT3v5lh+SoVlQylsSMzgqr45P+SOgP/g== X-Received: by 2002:a63:f244:: with SMTP id d4mr1971731pgk.233.1573036158331; Wed, 06 Nov 2019 02:29:18 -0800 (PST) Received: from Leggiero.taipei.internal (61-220-137-37.HINET-IP.hinet.net. [61.220.137.37]) by smtp.gmail.com with ESMTPSA id x10sm19872046pgl.53.2019.11.06.02.29.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Nov 2019 02:29:17 -0800 (PST) From: Po-Hsu Lin To: kernel-team@lists.ubuntu.com Subject: [Bionic][SRU][PATCH 2/4] selftests: Fix lib.mk run_tests target shell script Date: Wed, 6 Nov 2019 18:29:04 +0800 Message-Id: <20191106102906.28118-3-po-hsu.lin@canonical.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191106102906.28118-1-po-hsu.lin@canonical.com> References: <20191106102906.28118-1-po-hsu.lin@canonical.com> X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Mathieu Desnoyers BugLink: https://bugs.launchpad.net/bugs/1812352 Within run_tests target, the whole script needs to be executed within the same shell and not as separate subshells, so the initial test_num variable set to 0 is still present when executing "test_num=`echo $$test_num+1 | bc`;". Demonstration of the issue (make run_tests): TAP version 13 (standard_in) 1: syntax error selftests: basic_test ======================================== ok 1.. selftests: basic_test [PASS] (standard_in) 1: syntax error selftests: basic_percpu_ops_test ======================================== ok 1.. selftests: basic_percpu_ops_test [PASS] (standard_in) 1: syntax error selftests: param_test ======================================== ok 1.. selftests: param_test [PASS] With fix applied: TAP version 13 selftests: basic_test ======================================== ok 1..1 selftests: basic_test [PASS] selftests: basic_percpu_ops_test ======================================== ok 1..2 selftests: basic_percpu_ops_test [PASS] selftests: param_test ======================================== ok 1..3 selftests: param_test [PASS] Signed-off-by: Mathieu Desnoyers Fixes: 1f87c7c15d7 ("selftests: lib.mk: change RUN_TESTS to print messages in TAP13 format") CC: Shuah Khan CC: linux-kselftest@vger.kernel.org Signed-off-by: Shuah Khan (Samsung OSG) (cherry picked from commit a33554401e4746cc33307910a1baad63ce3fd650) Signed-off-by: Po-Hsu Lin --- tools/testing/selftests/lib.mk | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk index 51bc464..a001ccc 100644 --- a/tools/testing/selftests/lib.mk +++ b/tools/testing/selftests/lib.mk @@ -32,10 +32,10 @@ endif .ONESHELL: define RUN_TESTS - @export KSFT_TAP_LEVEL=`echo 1`; - @test_num=`echo 0`; - @echo "TAP version 13"; - @for TEST in $(1); do \ + @export KSFT_TAP_LEVEL=`echo 1`; \ + test_num=`echo 0`; \ + echo "TAP version 13"; \ + for TEST in $(1); do \ BASENAME_TEST=`basename $$TEST`; \ test_num=`echo $$test_num+1 | bc`; \ echo "selftests: $$BASENAME_TEST"; \ From patchwork Wed Nov 6 10:29:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Po-Hsu Lin X-Patchwork-Id: 1190262 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 477N7c0ZqJz9sR0; Wed, 6 Nov 2019 21:29:32 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1iSIZ6-0005Ld-1P; Wed, 06 Nov 2019 10:29:28 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1iSIZ0-0005JK-7r for kernel-team@lists.ubuntu.com; Wed, 06 Nov 2019 10:29:22 +0000 Received: from mail-pf1-f198.google.com ([209.85.210.198]) by youngberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1iSIYz-0003s1-Qe for kernel-team@lists.ubuntu.com; Wed, 06 Nov 2019 10:29:22 +0000 Received: by mail-pf1-f198.google.com with SMTP id m185so18654950pfb.11 for ; Wed, 06 Nov 2019 02:29:21 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=EZDIQANA+YfYtVUGKq5VpGLsI11+OgFW7CevBgfgBF0=; b=kj8ZiRPEb6L4VSSSwqdqXkHPdPkluqMq/mzl8kEampbJxF/wWh6WfJBYyzYBhXP5vG sQcQlynIZ+Cx7EckO4RGkC7qLRXFP99c7ojwgtp/N+fDjz2A802OARNj3Pc3yYD/lQ1t v3EXu4PwPxxRT+bg3gEOqZ9GMNzrHP/0JYwAG1T8TH+Heqi+WF+WtEM6wSTrWNRs9FtP xa5kMKWLpwvu70gh6GPaqhNGbXeMAhIsXOzpxJ5AM/j5mMp/91Bm8aQGgAgX3E+LAv6s /OjslpXh/KnBAInEfxYsg09TWw+akNkqlNur0jp/VEAadquFj95YMS8+VltPI98UbLqo YmlA== X-Gm-Message-State: APjAAAX3ECfN4+EjoxiYn5yAooPEtOkBzGtxxcqYS2Rs8er4Xynlc55I TGLyh1tEuzq1zHpWUegYqJrCxjU8zVvXH4KzNCKY0OCyf8fg5/8mtUBncgl02dnOgIL7WQgTFPR 7o4gTSSVHnIJFfvaflHcGqnurewBJvmuaGZCjAkKq X-Received: by 2002:a17:90a:9b87:: with SMTP id g7mr2798017pjp.64.1573036160261; Wed, 06 Nov 2019 02:29:20 -0800 (PST) X-Google-Smtp-Source: APXvYqyJGdyh7pztt05H0FrLXnRV652pr5tiw9OGZOUa1FCx+ks14epwwFvi6dN2ww+v2Ybh4fuhYA== X-Received: by 2002:a17:90a:9b87:: with SMTP id g7mr2797976pjp.64.1573036159849; Wed, 06 Nov 2019 02:29:19 -0800 (PST) Received: from Leggiero.taipei.internal (61-220-137-37.HINET-IP.hinet.net. [61.220.137.37]) by smtp.gmail.com with ESMTPSA id x10sm19872046pgl.53.2019.11.06.02.29.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Nov 2019 02:29:19 -0800 (PST) From: Po-Hsu Lin To: kernel-team@lists.ubuntu.com Subject: [Bionic][SRU][PATCH 3/4] selftests: lib.mk: cleanup RUN_TESTS define and make it readable Date: Wed, 6 Nov 2019 18:29:05 +0800 Message-Id: <20191106102906.28118-4-po-hsu.lin@canonical.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191106102906.28118-1-po-hsu.lin@canonical.com> References: <20191106102906.28118-1-po-hsu.lin@canonical.com> X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: "Shuah Khan (Samsung OSG)" BugLink: https://bugs.launchpad.net/bugs/1812352 Refine RUN_TESTS define's output block for summary and non-summary code to remove duplicate code and make it readable. cd `dirname $$TEST` > /dev/null; and cd - > /dev/null; are moved to common code block and indentation fixed. Signed-off-by: Shuah Khan (Samsung OSG) (cherry picked from commit 42b44c34136857ccdf90ebb1cbc38f2bf0aec7a1) Signed-off-by: Po-Hsu Lin --- tools/testing/selftests/lib.mk | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk index a001ccc..0b76e4a 100644 --- a/tools/testing/selftests/lib.mk +++ b/tools/testing/selftests/lib.mk @@ -44,11 +44,13 @@ define RUN_TESTS echo "selftests: Warning: file $$BASENAME_TEST is not executable, correct this.";\ echo "not ok 1..$$test_num selftests: $$BASENAME_TEST [FAIL]"; \ else \ - if [ "X$(summary)" != "X" ]; then \ - cd `dirname $$TEST` > /dev/null; (./$$BASENAME_TEST > /tmp/$$BASENAME_TEST 2>&1 && echo "ok 1..$$test_num selftests: $$BASENAME_TEST [PASS]") || echo "not ok 1..$$test_num selftests: $$BASENAME_TEST [FAIL]"; cd - > /dev/null;\ + cd `dirname $$TEST` > /dev/null; \ + if [ "X$(summary)" != "X" ]; then \ + (./$$BASENAME_TEST > /tmp/$$BASENAME_TEST 2>&1 && echo "ok 1..$$test_num selftests: $$BASENAME_TEST [PASS]") || echo "not ok 1..$$test_num selftests: $$BASENAME_TEST [FAIL]"; \ else \ - cd `dirname $$TEST` > /dev/null; (./$$BASENAME_TEST && echo "ok 1..$$test_num selftests: $$BASENAME_TEST [PASS]") || echo "not ok 1..$$test_num selftests: $$BASENAME_TEST [FAIL]"; cd - > /dev/null;\ + (./$$BASENAME_TEST && echo "ok 1..$$test_num selftests: $$BASENAME_TEST [PASS]") || echo "not ok 1..$$test_num selftests: $$BASENAME_TEST [FAIL]"; \ fi; \ + cd - > /dev/null; \ fi; \ done; endef From patchwork Wed Nov 6 10:29:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Po-Hsu Lin X-Patchwork-Id: 1190261 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 477N7Y5PCVz9sPk; Wed, 6 Nov 2019 21:29:29 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1iSIZ3-0005Ke-Ql; Wed, 06 Nov 2019 10:29:25 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1iSIZ1-0005Jv-PD for kernel-team@lists.ubuntu.com; Wed, 06 Nov 2019 10:29:23 +0000 Received: from mail-pl1-f197.google.com ([209.85.214.197]) by youngberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1iSIZ1-0003s5-CS for kernel-team@lists.ubuntu.com; Wed, 06 Nov 2019 10:29:23 +0000 Received: by mail-pl1-f197.google.com with SMTP id f7so4404319plj.12 for ; Wed, 06 Nov 2019 02:29:23 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=4Y9lmH/MVE8rpKddJtc3qC4QgnRU4FtFqtV8j6sjAJ4=; b=WyC7QKj7X6ZVC85IE01c5Jut/tU5KxU8m0pACgZXiYrLzs00cK7Ou3h5i3Fxeoo47R CtYVsvre5PnQZuf3827qDkYbDfoGeaj41g8DAGggqcaWanklIGvTxlhnfvYIa3NEGuFN sMlpS31imsexYf0filNF1D7/xJnpaFbNTkQi0OQOz6ZpiWN4727nJxihyboJqqp2c3g2 ec269TjwiZTl/kB0Gobf2KuIswvGnQN1+mCoBwx+LMZrZyar7DyEW3/NVJzFiC4aPQNW KXJ9PX0cpAuDp13ADDAOW5mEXtFlMoyV6CQ2AiOH1KL1p1w2Mgm8+mDTc87h8hVr8VPT sIPQ== X-Gm-Message-State: APjAAAX4Tp0gKpImocbgp+2mMpRdmAB5QtPYia2l9NnBiFggXtbxQtB+ amZtwGEG3fO5Izco9Bly1aDlkPs3sUXI7awwTPONtNEvN+TBtudfEDY2Pz3AfXgBVXxsg0hLQsA 7USbdxFDl7Tdvo0GBRY+E8/8h2YIgQ4wiiHr9thAO X-Received: by 2002:aa7:9467:: with SMTP id t7mr2457681pfq.142.1573036161549; Wed, 06 Nov 2019 02:29:21 -0800 (PST) X-Google-Smtp-Source: APXvYqxjBQIMuFfa/fp7rNGgHyUwwOCSwDgGzV/wGudObClbPG4A2zHLjs0dtl6NvNnIEwsHGqEkIQ== X-Received: by 2002:aa7:9467:: with SMTP id t7mr2457655pfq.142.1573036161295; Wed, 06 Nov 2019 02:29:21 -0800 (PST) Received: from Leggiero.taipei.internal (61-220-137-37.HINET-IP.hinet.net. [61.220.137.37]) by smtp.gmail.com with ESMTPSA id x10sm19872046pgl.53.2019.11.06.02.29.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Nov 2019 02:29:20 -0800 (PST) From: Po-Hsu Lin To: kernel-team@lists.ubuntu.com Subject: [Bionic][SRU][PATCH 4/4] selftests: lib.mk: add SKIP handling to RUN_TESTS define Date: Wed, 6 Nov 2019 18:29:06 +0800 Message-Id: <20191106102906.28118-5-po-hsu.lin@canonical.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191106102906.28118-1-po-hsu.lin@canonical.com> References: <20191106102906.28118-1-po-hsu.lin@canonical.com> X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: "Shuah Khan (Samsung OSG)" BugLink: https://bugs.launchpad.net/bugs/1812352 RUN_TESTS which is the common function that implements run_tests target, treats all non-zero return codes from tests as failures. When tests are skipped with non-zero return code, because of unmet dependencies and/or unsupported configuration, it reports them as failed. This will lead to too many false negatives even on the tests that couldn't be run. RUN_TESTS is changed to test for SKIP=4 return from tests to enable the framework for individual tests to return special SKIP code. Tests will be changed as needed to report SKIP instead FAIL/PASS when they get skipped. Signed-off-by: Shuah Khan (Samsung OSG) (cherry picked from commit 3f4435b5149372b3bbc5acab5c835d490490d6bc) Signed-off-by: Po-Hsu Lin --- tools/testing/selftests/lib.mk | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk index 0b76e4a..02273bf 100644 --- a/tools/testing/selftests/lib.mk +++ b/tools/testing/selftests/lib.mk @@ -34,6 +34,7 @@ endif define RUN_TESTS @export KSFT_TAP_LEVEL=`echo 1`; \ test_num=`echo 0`; \ + skip=`echo 4`; \ echo "TAP version 13"; \ for TEST in $(1); do \ BASENAME_TEST=`basename $$TEST`; \ @@ -46,9 +47,19 @@ define RUN_TESTS else \ cd `dirname $$TEST` > /dev/null; \ if [ "X$(summary)" != "X" ]; then \ - (./$$BASENAME_TEST > /tmp/$$BASENAME_TEST 2>&1 && echo "ok 1..$$test_num selftests: $$BASENAME_TEST [PASS]") || echo "not ok 1..$$test_num selftests: $$BASENAME_TEST [FAIL]"; \ + (./$$BASENAME_TEST > /tmp/$$BASENAME_TEST 2>&1 && \ + echo "ok 1..$$test_num selftests: $$BASENAME_TEST [PASS]") || \ + (if [ $$? -eq $$skip ]; then \ + echo "not ok 1..$$test_num selftests: $$BASENAME_TEST [SKIP]"; \ + else echo "not ok 1..$$test_num selftests: $$BASENAME_TEST [FAIL]"; \ + fi;) \ else \ - (./$$BASENAME_TEST && echo "ok 1..$$test_num selftests: $$BASENAME_TEST [PASS]") || echo "not ok 1..$$test_num selftests: $$BASENAME_TEST [FAIL]"; \ + (./$$BASENAME_TEST && \ + echo "ok 1..$$test_num selftests: $$BASENAME_TEST [PASS]") || \ + (if [ $$? -eq $$skip ]; then \ + echo "not ok 1..$$test_num selftests: $$BASENAME_TEST [SKIP]"; \ + else echo "not ok 1..$$test_num selftests: $$BASENAME_TEST [FAIL]"; \ + fi;) \ fi; \ cd - > /dev/null; \ fi; \