From patchwork Tue Jan 29 20:54:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Strachan X-Patchwork-Id: 1033004 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=lists.linux.it (client-ip=2001:1418:10:5::2; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.b="dPGiAAlK"; dkim-atps=neutral Received: from picard.linux.it (picard.linux.it [IPv6:2001:1418:10:5::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43pzJZ3hCtz9sBb for ; Wed, 30 Jan 2019 07:54:37 +1100 (AEDT) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 662A13EAD0D for ; Tue, 29 Jan 2019 21:54:34 +0100 (CET) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-6.smtp.seeweb.it (in-6.smtp.seeweb.it [217.194.8.6]) by picard.linux.it (Postfix) with ESMTP id 76CA83EA01B for ; Tue, 29 Jan 2019 21:54:31 +0100 (CET) Received: from mail-vs1-xe4a.google.com (mail-vs1-xe4a.google.com [IPv6:2607:f8b0:4864:20::e4a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by in-6.smtp.seeweb.it (Postfix) with ESMTPS id A843F1400742 for ; Tue, 29 Jan 2019 21:54:30 +0100 (CET) Received: by mail-vs1-xe4a.google.com with SMTP id j123so9848332vsd.9 for ; Tue, 29 Jan 2019 12:54:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:message-id:mime-version:subject:from:to:cc; bh=bWwsoxeybsvKkS1cLDGua4bY35QV3prxJRCeUpKFuWE=; b=dPGiAAlKFLSYuq0H/iJOjGIwdVpu7d62+4tNq7LtaQSurNtf/o5cPu6XArPvLi+f24 dlyAFkVAQpUtRe+eOVpz9UZPM+JAsfOC14mtIBeRHy6b1THELdw+W7RwKRK4TEVI/Kp7 jT22ytKSrdu4m95oMxNhlcCgFq/2thOGRgjmHzF1Hc6FFi+8WAJhmubMa3ASDh1pf32B Q1WD0vU7XkBJLOIt38ZnxYwtG95qE5772m5W96Wc0PPuqlnwpllu9KPpvLV0BJExyVlh XC2v9MsAaOuCUTXYli28WfvILUJvKWIfoiOYjwlp6TIOkEU884z/JPAsbqfVZAk/U7SL tdNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=bWwsoxeybsvKkS1cLDGua4bY35QV3prxJRCeUpKFuWE=; b=M/4B1I5ZaRQ6miVY+AHjaHwHysSNPidUidASfsMUvOhcoH2xKc1aDWMjqLZ9bFYC1h 11zQud2YApSLpkzw1h5cy4zkhQ255T9rjPuifJ8wljOJE5Cx5GsHaRCJPgHiWFxu/A4M eKjnO8IIHvvdyeMs1xIA/BUdca0mnQtIV1CBNm6bwQDTyKbkcG4cTDRFGl7JXKYFwA4n Jo1DZp7GHWkunbSzDbHpXOUoc8DyGS5oRAe2gWyemJaVPPp3WHn5NoaoKr+BexEoyDZ4 vqlkgIJUnEa47kmACFO1brlkjpcQgNrjvcd1d5D1TNJ2LU5f8gjUhkT+2nkW9AvTwIBd glQA== X-Gm-Message-State: AHQUAuad8MK33orFMXb15Cwxa6bltcHdN8YQ6GVr4yUMAHT/fZDnpd+W /MfcZpdomjE33ikxpMxN5z9NtWxzGZzpHokPt0E6sUBEG5hBfBbWNrRELPWR53SLq7N9jwtzBHi SIE9qWfgNh/YQU/IoiA1kOxgF0IK4oloDtLF0BDWVyQnrqMI5Uvslx6TS4UmluedW X-Google-Smtp-Source: ALg8bN54iSBYq1l6P3EAd9cKj4sje5wCg8EyAD2RW58gzof+z17d6H8uVhc72ZEWzmS4DTrhUh0LPGYEUKKNixE= X-Received: by 2002:a67:89c8:: with SMTP id l191mr4891321vsd.39.1548795268947; Tue, 29 Jan 2019 12:54:28 -0800 (PST) Date: Tue, 29 Jan 2019 12:54:25 -0800 Message-Id: <20190129205425.62110-1-astrachan@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.20.1.495.gaa96b0ce6b-goog From: Alistair Strachan To: ltp@lists.linux.it X-Virus-Scanned: clamav-milter 0.99.2 at in-6.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=-7.4 required=7.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, SPF_PASS, USER_IN_DEF_DKIM_WL autolearn=disabled version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on in-6.smtp.seeweb.it Cc: kernel-team@android.com Subject: [LTP] [PATCH] lib/tst_kernel.c: Fix tst_check_driver() for Android X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.18 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" The change 1f70b0a ("lib/tst_test.c: add 'needs_drivers' option with tst_check_drivers cmd") and subsequent changes to tests to use .needs_drivers caused some tests from older LTP releases to longer run successfully under Android. Android's modprobe currently lacks a dry-run mode, so it will return a positive error code when invoked as 'modprobe -n', which pessimistically disables tests that could run (such as fsetxattr2) with a TCONF status. Even if this was fixed, Android systems might not have the modprobe.*.bin files available to determine which drivers were built into the kernel, so this probing method does not work for Android. For now, allow tests that set .needs_drivers to continue to run under Android by assuming that drivers are always present. The Android ecosystem has other ways to enforce the presence of kernel features. Signed-off-by: Alistair Strachan Cc: Cyril Hrubis Cc: Steve Muckle Cc: kernel-team@android.com --- lib/tst_kernel.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/tst_kernel.c b/lib/tst_kernel.c index d051f3b07..a7fd38b4d 100644 --- a/lib/tst_kernel.c +++ b/lib/tst_kernel.c @@ -83,9 +83,17 @@ int tst_kernel_bits(void) int tst_check_driver(const char *name) { +#ifndef __ANDROID__ const char * const argv[] = { "modprobe", "-n", name, NULL }; int res = tst_run_cmd_(NULL, argv, "/dev/null", "/dev/null", 1); /* 255 - it looks like modprobe not available */ return (res == 255) ? 0 : res; +#else + /* Android modprobe may not have '-n', or properly installed + * module.*.bin files to determine built-in drivers. Assume + * all drivers are available. + */ + return 0; +#endif }