From patchwork Tue Mar 12 09:58:45 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: 10848987 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EE07613B5 for ; Tue, 12 Mar 2019 09:59:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D986A28694 for ; Tue, 12 Mar 2019 09:59:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CE198286C6; Tue, 12 Mar 2019 09:59:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2DA5E28694 for ; Tue, 12 Mar 2019 09:59:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726349AbfCLJ7X (ORCPT ); Tue, 12 Mar 2019 05:59:23 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:36093 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725917AbfCLJ7X (ORCPT ); Tue, 12 Mar 2019 05:59:23 -0400 Received: from mail-pf1-f200.google.com ([209.85.210.200]) by youngberry.canonical.com with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1h3eBu-0003kq-32 for linux-kselftest@vger.kernel.org; Tue, 12 Mar 2019 09:59:22 +0000 Received: by mail-pf1-f200.google.com with SMTP id 23so2420941pfj.18 for ; Tue, 12 Mar 2019 02:59:22 -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:cc:subject:date:message-id; bh=jusRkWJSy8oqkA4FSVnA9QAWyZ3aU9dHEMXjZIwG3MU=; b=t4WroHk+gYghTNLTR+xl6sjnA1SakZoxn6GsG4pR/K1Ob6zk+QmvuNH42T2L6XeX5I w9GZsU9dOzyx0HpETAb8wkhgkiD5UVC9LfrOVh3n4+RQM22OfXjF5ct9bBHOmZGaSSsp Ebs3zsVGQ4ArvHPWlGGdaEMn+3PI7jGy5RjX5VQkgj7BJDZcKBnuHEB0DTi4G3KlQGn7 18MuzZNqXSBQYHbrVLBLlmvVQY+OYL/em7ZbthPmlGBpioKQaZfV1+/3HkCrh3ukAhvi tXT8Iv0vA/+6VsKyYK/x81aMh1d/ST9JNoT9Zju982qDLhZ2kQU68dhuu8VmMdD8gKnZ d5FA== X-Gm-Message-State: APjAAAVymcsCI0H6OWCWjjg0uPxaPx0r1UUF+9z1HHr9k6dCkiMCK8V8 15QjSeonfCGjxF5x3zXIS8KEHe4vGBf3V44ozEn1YrFrrnZbhTp5r0C1un6SYocetNE68Z3YC6g 2AfAQbbQtQLTe0duf30mbHC4GaIOPI4srD1Hrvqj293t5 X-Received: by 2002:aa7:8157:: with SMTP id d23mr37751307pfn.67.1552384760435; Tue, 12 Mar 2019 02:59:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqwN3x9ZJxiP8V2pxD6rdUNTwubW7lCxJqbN4eDQvc8yB6u5cwM6lJNS/NBUyna+yGb/T8nyLQ== X-Received: by 2002:aa7:8157:: with SMTP id d23mr37751286pfn.67.1552384760189; Tue, 12 Mar 2019 02:59:20 -0700 (PDT) Received: from localhost.localdomain (61-220-137-37.HINET-IP.hinet.net. [61.220.137.37]) by smtp.gmail.com with ESMTPSA id g71sm18328045pfg.157.2019.03.12.02.59.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Mar 2019 02:59:19 -0700 (PDT) From: Po-Hsu Lin To: shuah@kernel.org, linux-kselftest@vger.kernel.org Cc: linux-kernel@vger.kernel.org Subject: [PATCH] selftests: cpu-hotplug: check hotplug dir for the CONFIG_HOTPLUG_CPU Date: Tue, 12 Mar 2019 17:58:45 +0800 Message-Id: <20190312095845.17541-1-po-hsu.lin@canonical.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When the CONFIG_HOTPLUG_CPU is not set, there won't be a "hotplug" directory in /sys/devices/system/cpu/. Make use of this fact to check if we need to skip this test. Signed-off-by: Po-Hsu Lin --- tools/testing/selftests/cpu-hotplug/cpu-on-off-test.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/testing/selftests/cpu-hotplug/cpu-on-off-test.sh b/tools/testing/selftests/cpu-hotplug/cpu-on-off-test.sh index 0d26b5e..27275a1 100755 --- a/tools/testing/selftests/cpu-hotplug/cpu-on-off-test.sh +++ b/tools/testing/selftests/cpu-hotplug/cpu-on-off-test.sh @@ -23,6 +23,11 @@ prerequisite() exit $ksft_skip fi + if [ ! -d $SYSFS/devices/system/cpu/hotplug/ ]; then + echo $msg CONFIG_HOTPLUG_CPU needs to be enabled >&2 + exit $ksft_skip + fi + if ! ls $SYSFS/devices/system/cpu/cpu* > /dev/null 2>&1; then echo $msg cpu hotplug is not supported >&2 exit $ksft_skip