From patchwork Mon Apr 27 08:55:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Po-Hsu Lin X-Patchwork-Id: 1277463 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 499dsK0CnRz9sP7; Mon, 27 Apr 2020 18:55:33 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1jSzY1-0005UB-PZ; Mon, 27 Apr 2020 08:55:29 +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 1jSzXw-0005RJ-Je for kernel-team@lists.ubuntu.com; Mon, 27 Apr 2020 08:55:24 +0000 Received: from mail-pj1-f69.google.com ([209.85.216.69]) by youngberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1jSzXw-0004DS-6q for kernel-team@lists.ubuntu.com; Mon, 27 Apr 2020 08:55:24 +0000 Received: by mail-pj1-f69.google.com with SMTP id o103so15514585pjb.3 for ; Mon, 27 Apr 2020 01:55:24 -0700 (PDT) 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:mime-version:content-transfer-encoding; bh=5bogMIM9Sxt0LN1VmVI+Hd2pLesbipEgjUrjczoS+bg=; b=Wzmce+RToHh9qOVoJVjXiGCooFC7oUjJt3aOTh/1MhqmFvyF5RO/jPthONYzLA89vD OyvQFoW6DRIWTxv4+TqKi7t/FCk/dhGzqxhIPsI8CJNJ18FtibnFklXdrv7fmrZ3wIII JCgShJ5M30tl/Fcwex1Saa+kso63VsqmK4H3A9VWaxsWMZPJyM0UCdARQCDmPosQxatn E8gxlnwESSq1/mCowjyVYYKsy7d9KCVxsoGi6jCJWnYn5h7k1NXqb0+4skPlgAo0opKA omGKeel02E3njlfnB+b/jMDfgSY7BVw0FZAfKFULQTCA9hfCGD9czHeGnaGGyFmVw27s w0Uw== X-Gm-Message-State: AGi0PuazxH0DDdMP3zJQkFcSbAGicpjLpHNKJzk4UI3PzztJoQlEaLj9 T6VEPl8hCDi0lh+U/nedL2j07YlfPH0nFP38nDX9MZyUBKlUoZ8jwQcA/vcl/NqbDe8PB2mT/vj tEoOvFqD2VKvArVpHkhioL65JCRzST8Hv9dzvZ9dz X-Received: by 2002:a17:90b:3115:: with SMTP id gc21mr20886950pjb.183.1587977722578; Mon, 27 Apr 2020 01:55:22 -0700 (PDT) X-Google-Smtp-Source: APiQypLCXzFjcERSCuiLuCc/KYSZ7MzqC56zdGLC5SZ6cdusfT2DvCQG7nuloPmbQb+qOEMbj72aYA== X-Received: by 2002:a17:90b:3115:: with SMTP id gc21mr20886932pjb.183.1587977722269; Mon, 27 Apr 2020 01:55:22 -0700 (PDT) Received: from localhost.localdomain (59-115-62-114.dynamic-ip.hinet.net. [59.115.62.114]) by smtp.gmail.com with ESMTPSA id l30sm10636336pje.34.2020.04.27.01.55.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Apr 2020 01:55:21 -0700 (PDT) From: Po-Hsu Lin To: kernel-team@lists.ubuntu.com Subject: [B][SRU][PATCH 1/1] selftests/net: skip psock_tpacket test if KALLSYMS was not enabled Date: Mon, 27 Apr 2020 16:55:07 +0800 Message-Id: <20200427085508.26032-3-po-hsu.lin@canonical.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200427085508.26032-1-po-hsu.lin@canonical.com> References: <20200427085508.26032-1-po-hsu.lin@canonical.com> MIME-Version: 1.0 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: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" BugLink: https://bugs.launchpad.net/bugs/1812176 The psock_tpacket test will need to access /proc/kallsyms, this would require the kernel config CONFIG_KALLSYMS to be enabled first. Apart from adding CONFIG_KALLSYMS to the net/config file here, check the file existence to determine if we can run this test will be helpful to avoid a false-positive test result when testing it directly with the following commad against a kernel that have CONFIG_KALLSYMS disabled: make -C tools/testing/selftests TARGETS=net run_tests Signed-off-by: Po-Hsu Lin Acked-by: Shuah Khan Signed-off-by: David S. Miller (backported from commit ff95bf28c23490584b9d75913a520bb7bb1f2ecb) Signed-off-by: Po-Hsu Lin --- tools/testing/selftests/net/config | 1 + tools/testing/selftests/net/run_afpackettests | 14 +++++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/tools/testing/selftests/net/config b/tools/testing/selftests/net/config index 7177bea..28b5020 100644 --- a/tools/testing/selftests/net/config +++ b/tools/testing/selftests/net/config @@ -2,3 +2,4 @@ CONFIG_USER_NS=y CONFIG_BPF_SYSCALL=y CONFIG_TEST_BPF=m CONFIG_NUMA=y +CONFIG_KALLSYMS=y diff --git a/tools/testing/selftests/net/run_afpackettests b/tools/testing/selftests/net/run_afpackettests index c6708d8..d05800b 100755 --- a/tools/testing/selftests/net/run_afpackettests +++ b/tools/testing/selftests/net/run_afpackettests @@ -21,11 +21,15 @@ fi echo "--------------------" echo "running psock_tpacket test" echo "--------------------" -./in_netns.sh ./psock_tpacket -if [ $? -ne 0 ]; then - echo "[FAIL]" - ret=1 +if [ -f /proc/kallsyms ]; then + ./in_netns.sh ./psock_tpacket + if [ $? -ne 0 ]; then + echo "[FAIL]" + ret=1 + else + echo "[PASS]" + fi else - echo "[PASS]" + echo "[SKIP] CONFIG_KALLSYMS not enabled" fi exit $ret