From patchwork Wed Nov 8 19:40:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Pundir X-Patchwork-Id: 118329 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp5695782qgn; Wed, 8 Nov 2017 11:40:53 -0800 (PST) X-Google-Smtp-Source: ABhQp+QQ+S40ut5yDyGUh/njnd/iEP0MON2vGYfVMsF7ePBkB5lVazfaKglEEHVN3AsHEXcp+CWT X-Received: by 10.84.245.145 with SMTP id j17mr1368349pll.163.1510170053310; Wed, 08 Nov 2017 11:40:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510170053; cv=none; d=google.com; s=arc-20160816; b=T+vBC2n2mZQk/umYsqqAEkDvDZ8tUFUcX1pivneh7dkivX/6SFZUPUlqvsYXQhIdZj dVI0/x9ywuHccGMIEYuC8GKzj3O9NVAnH7q6YFV+8KKuEl6TDjFAiEXZtTmtP1EWWTV8 iA6YT0E9H+EOEK7KQsZJ9dJm8eKUCSkXX9b2azmPTRAVDo1WuridF90TQp2nNPN3pA6s m/JpVcGCW8soJUKN+LGOb+f+KNXmlnvcMwR65xSg8bXHmg3qlghVJQTlzVFZ7sGUKO7o FWvRLOVpbEKBEZepnrIXPBPZ7C7Uo/6UGRqKmJYNu55ZKjguujs3GHes8lG6YiH3RZOW w3TA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:author:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature:arc-authentication-results; bh=1FTYM0KxnnPX+70IAA1DUtmOvj9KoHnYWx5DW2Sn3II=; b=qfvX2rawmMCTD5keznnybkDwn9xU2JOL8S5WXEzISnHntdkYCGpdqiBMP1xMmrovsf 19iLbR0DyggrH8YBrq8jn40fYxiCD4M9e4Inlfa1daRhtDu8ojQKVYYgzejMfORJlgRM 8IWbsMQdqhhvrtWFzRfLPSJmvgq1zauA+GkO6f8Eh+vaNw1KuJRK+qP882sXpW0YFEvb BmY1A4Tj4Cwsd2ff6qbpDi92K0Ic5uL9xT0ctJQWqGIWseGCP7Dw4ri1z3yCHQV7YiXs i1+xxuq+MsBej/Mti1/UwCNSNd3EWUxEU660dAgK3Fncq2smguTkpCbwku0FUrqkMCJq MXzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Les4jr4S; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j21si4981372pfa.266.2017.11.08.11.40.52; Wed, 08 Nov 2017 11:40:53 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Les4jr4S; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752519AbdKHTku (ORCPT + 25 others); Wed, 8 Nov 2017 14:40:50 -0500 Received: from mail-pf0-f193.google.com ([209.85.192.193]:46922 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752496AbdKHTkq (ORCPT ); Wed, 8 Nov 2017 14:40:46 -0500 Received: by mail-pf0-f193.google.com with SMTP id p87so2468444pfj.3 for ; Wed, 08 Nov 2017 11:40:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references:author; bh=1FTYM0KxnnPX+70IAA1DUtmOvj9KoHnYWx5DW2Sn3II=; b=Les4jr4SAR2AlKzYXrW979D0C5/notCB6edBP8L0useb8ksnJtEGs60nO3VaPWEOCL uGK8iaAtbe+RhB22SMMKshbo7ga8JZ72ZWsuwlVCsTdJsJSWjw6UbGMKIXAJ+syvbbRv uIgz72j7dexVebxZ5itLjHGYM1q2k74vhW2dU= 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:in-reply-to :references:author; bh=1FTYM0KxnnPX+70IAA1DUtmOvj9KoHnYWx5DW2Sn3II=; b=Y4lzW8PCAndjrdB0Efvq2kkza7dR+M4a6CwkFvzypfsE73HcfIS9o6mHqNIkHtW46W Z0uGe//bYWiWHNxZrFJV3Rs7XzDsxVvQhQAuu/ZdEjmTcqHerDL/76gELfBdh5Ozu6rh rSW1Ky+RAf2cgW+zFGHj9YOlRNo4a1rxKRxpewg8KgPYX2eCfJ2pgRfZ6/fZXE33K3dI R+JKunV0GeN8b20ARgYOD4dV2IVeLouLcKRetuockNixQGc7IuP+W9ub6SfUm1FXFpyk y1pUQuNxTj61gRZ8vUJaGp112RvZMsXWKFKhC0z+aA9GvL6T/mk340oQZIPiLAZTTcKb qz6w== X-Gm-Message-State: AJaThX4r2v6It0E+36wSdr6Sv470RuLCDCEG3R/DyuzLEdFQNLSQQ/JI H30bjYkrEPB6xy+41KJNVxCsvg== X-Received: by 10.99.117.7 with SMTP id q7mr1469827pgc.382.1510170045763; Wed, 08 Nov 2017 11:40:45 -0800 (PST) Received: from localhost.localdomain ([106.51.18.232]) by smtp.gmail.com with ESMTPSA id j6sm8658143pgn.68.2017.11.08.11.40.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 08 Nov 2017 11:40:44 -0800 (PST) From: Amit Pundir To: kselftest , lkml Cc: Shuah Khan , Greg Kroah-Hartman , "Luis R . Rodriguez" , Masami Hiramatsu , Sumit Semwal Subject: [PATCH v2 1/2] selftests: firmware: skip unsupported async loading tests Date: Thu, 9 Nov 2017 01:10:34 +0530 Message-Id: <1510170035-31384-2-git-send-email-amit.pundir@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1510170035-31384-1-git-send-email-amit.pundir@linaro.org> References: <1510170035-31384-1-git-send-email-amit.pundir@linaro.org> Author: Amit Pundir Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Ignore async firmware loading tests on older kernel releases, which do not support this feature. Fixes: 1b1fe542b6f0 ("selftests: firmware: add empty string and async tests") Reviewed-by: Sumit Semwal Acked-by: Luis R. Rodriguez Acked-by: Greg Kroah-Hartman Signed-off-by: Amit Pundir --- v2: Changed the display message to make it consistent across all the firmware test scripts. Added Fixes tag. tools/testing/selftests/firmware/fw_filesystem.sh | 34 ++++++++++++++--------- 1 file changed, 21 insertions(+), 13 deletions(-) -- 2.7.4 diff --git a/tools/testing/selftests/firmware/fw_filesystem.sh b/tools/testing/selftests/firmware/fw_filesystem.sh index 62f2d6f54929..b1f20fef36c7 100755 --- a/tools/testing/selftests/firmware/fw_filesystem.sh +++ b/tools/testing/selftests/firmware/fw_filesystem.sh @@ -70,9 +70,13 @@ if printf '\000' >"$DIR"/trigger_request 2> /dev/null; then exit 1 fi -if printf '\000' >"$DIR"/trigger_async_request 2> /dev/null; then - echo "$0: empty filename should not succeed (async)" >&2 - exit 1 +if [ ! -e "$DIR"/trigger_async_request ]; then + echo "$0: empty filename: async trigger not present, ignoring test" >&2 +else + if printf '\000' >"$DIR"/trigger_async_request 2> /dev/null; then + echo "$0: empty filename should not succeed (async)" >&2 + exit 1 + fi fi # Request a firmware that doesn't exist, it should fail. @@ -105,17 +109,21 @@ else fi # Try the asynchronous version too -if ! echo -n "$NAME" >"$DIR"/trigger_async_request ; then - echo "$0: could not trigger async request" >&2 - exit 1 -fi - -# Verify the contents are what we expect. -if ! diff -q "$FW" /dev/test_firmware >/dev/null ; then - echo "$0: firmware was not loaded (async)" >&2 - exit 1 +if [ ! -e "$DIR"/trigger_async_request ]; then + echo "$0: firmware loading: async trigger not present, ignoring test" >&2 else - echo "$0: async filesystem loading works" + if ! echo -n "$NAME" >"$DIR"/trigger_async_request ; then + echo "$0: could not trigger async request" >&2 + exit 1 + fi + + # Verify the contents are what we expect. + if ! diff -q "$FW" /dev/test_firmware >/dev/null ; then + echo "$0: firmware was not loaded (async)" >&2 + exit 1 + else + echo "$0: async filesystem loading works" + fi fi ### Batched requests tests