Received: by 10.223.164.202 with SMTP id h10csp41048wrb; Wed, 8 Nov 2017 11:41:43 -0800 (PST) X-Google-Smtp-Source: ABhQp+Qvuy/3ypuLJAEeN7ofrf9QmI3X0FVrAIL/nkmZSPDPogASvuYnRDZ38QCOYZLnQgGal8A+ X-Received: by 10.101.92.8 with SMTP id u8mr1443286pgr.93.1510170103770; Wed, 08 Nov 2017 11:41:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510170103; cv=none; d=google.com; s=arc-20160816; b=sD652wa05N/QHhzRK4E+03M7+sM2vO72xuy4663tlF/4acspxAP1LB0H9P/8/9CGit 4Yl9t2JYn72gstc8lXXbkIrwuXzXIKZ4G7VxiQ2bjpS5Dv2QlE4YXVwvQpns1ilNgBvx f9fuG/Y0nzK0xxJ0Sa8E1iYMWsYJFDhaQRLXKNkNsROTyMxwnSIes5Bvm9MryOyZoe5k n4RDbEps1/4U24KGf9wQ34+qhByJhDy8XAJI2OgqlsI4DClK6LCyfJEXjIOUP7LGTAmr F8tb1bukzbWXA6aldlTxIQOpv0i/w7q+/nv+deHEOtAdT0CfjCmHC3Xjvnlcs5/i0TgG 8lHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=eAFyjUN+956L9fH/V+GlPE/C5+2z6kmt1Y4jFBOMiso=; b=o3tcYRa45uVHcopL5xTKw1xxM4wL8iRE0hRSJYzaY0GRlwipKdzEXh53gz2lgPrkW7 FNzXq9qcIYJXr46gkjWaAInHsGdXkI7URg4GLBSE53aBVmm0NhhHxQXgswJ+gKN3URBR OgccPgR7VVi+S7MjMDFSmLAK48m56rPmp95Me3uXqus2TjJQG+wMhoHhUPwS4O8L9P1y /nZ8uNbEfJ6BG2OG1DFq2Zq6s2N63XUJrCt2amUtzzbbnc3klwluJ+pO0W4xM+zChEjx TsNOL3QrFt5tK9Cj6tuOCUr1WDPUr0Ly3J/b0r+jbW61b3+QkG0OJD5+7+pz8lymeejj +PXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=X/aP12Mp; 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 70si2030346pfr.28.2017.11.08.11.41.32; Wed, 08 Nov 2017 11:41:43 -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=X/aP12Mp; 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 S1752565AbdKHTkx (ORCPT + 84 others); Wed, 8 Nov 2017 14:40:53 -0500 Received: from mail-pg0-f67.google.com ([74.125.83.67]:47279 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752496AbdKHTku (ORCPT ); Wed, 8 Nov 2017 14:40:50 -0500 Received: by mail-pg0-f67.google.com with SMTP id o7so2698299pgc.4 for ; Wed, 08 Nov 2017 11:40:50 -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; bh=eAFyjUN+956L9fH/V+GlPE/C5+2z6kmt1Y4jFBOMiso=; b=X/aP12Mp0rDSAnP8ZdMGpzznku34CB9E8Y+9VSqasrOgpjYhW3P0tAimb9xgRK0pL7 wajHkzEGaj3hGsJvY/VPNdCMErY0am8rgJs6L4k9Rv1XESVOfS+bjYJ76l900lHrfrha VOqaQXf5+hNxjKVX4H75iyb/RPw2rBMBnxXyg= 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; bh=eAFyjUN+956L9fH/V+GlPE/C5+2z6kmt1Y4jFBOMiso=; b=HHMnRQ+pajgllq0SwXivK0VmTA78kyfT8XuEaR7wYh0UGOYNrM9FJSOg8Wuo82et3S C1m43kbb5nKNQxKUK29X2bkWiVKUc+veBF+7L4XMjF1bUvMdGnpwSZ6dN4DY3uZxsd1S Ui4szPiwMqlbVmjpAvDP/GuVtBCOUfzhoTDAX4cCn3CtMkTFAfLRxKOsZQ5amaKuto5Y JnQ0mcyZ/3wlZHckoDBZvoEJsUeHesGrFmRHV/YoeiExjdcYGF5mQTCQOLf+a74liF56 ehl9mInHJ7gJj6LFLI2ljdGyWSdwmlE7n0MX2HNMohfnz8LFYUYdVb+Oc5TTP4u1X7TL V0Xw== X-Gm-Message-State: AJaThX6g8dxsF37h1nWXQNkqHVEIpPw/QqrqpJ9BnWtitMpvohkmtVUy fVCaivFOAZHtOFpwCiLKSM31Ng== X-Received: by 10.99.120.138 with SMTP id t132mr1502459pgc.88.1510170049519; Wed, 08 Nov 2017 11:40:49 -0800 (PST) Received: from localhost.localdomain ([106.51.18.232]) by smtp.gmail.com with ESMTPSA id j6sm8658143pgn.68.2017.11.08.11.40.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 08 Nov 2017 11:40:48 -0800 (PST) From: Amit Pundir To: kselftest , lkml Cc: Shuah Khan , Greg Kroah-Hartman , "Luis R . Rodriguez" , Masami Hiramatsu , Sumit Semwal Subject: [PATCH v2 2/2] selftests: firmware: skip unsupported custom firmware fallback tests Date: Thu, 9 Nov 2017 01:10:35 +0530 Message-Id: <1510170035-31384-3-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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Ignore custom firmware loading and cancellation tests on older kernel releases, which do not support this feature. Fixes: 061132d2b9c9 ("test_firmware: add test custom fallback trigger") 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_fallback.sh | 38 +++++++++++++++++-------- 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/tools/testing/selftests/firmware/fw_fallback.sh b/tools/testing/selftests/firmware/fw_fallback.sh index a52a3bab532b..72858c921eed 100755 --- a/tools/testing/selftests/firmware/fw_fallback.sh +++ b/tools/testing/selftests/firmware/fw_fallback.sh @@ -86,6 +86,11 @@ load_fw_cancel() load_fw_custom() { + if [ ! -e "$DIR"/trigger_custom_fallback ]; then + echo "$0: custom fallback trigger not present, ignoring test" >&2 + return 1 + fi + local name="$1" local file="$2" @@ -108,11 +113,17 @@ load_fw_custom() # Wait for request to finish. wait + return 0 } load_fw_custom_cancel() { + if [ ! -e "$DIR"/trigger_custom_fallback ]; then + echo "$0: canceling custom fallback trigger not present, ignoring test" >&2 + return 1 + fi + local name="$1" local file="$2" @@ -133,6 +144,7 @@ load_fw_custom_cancel() # Wait for request to finish. wait + return 0 } load_fw_fallback_with_child() @@ -227,20 +239,22 @@ else echo "$0: cancelling fallback mechanism works" fi -load_fw_custom "$NAME" "$FW" -if ! diff -q "$FW" /dev/test_firmware >/dev/null ; then - echo "$0: firmware was not loaded" >&2 - exit 1 -else - echo "$0: custom fallback loading mechanism works" +if load_fw_custom "$NAME" "$FW" ; then + if ! diff -q "$FW" /dev/test_firmware >/dev/null ; then + echo "$0: firmware was not loaded" >&2 + exit 1 + else + echo "$0: custom fallback loading mechanism works" + fi fi -load_fw_custom_cancel "nope-$NAME" "$FW" -if diff -q "$FW" /dev/test_firmware >/dev/null ; then - echo "$0: firmware was expected to be cancelled" >&2 - exit 1 -else - echo "$0: cancelling custom fallback mechanism works" +if load_fw_custom_cancel "nope-$NAME" "$FW" ; then + if diff -q "$FW" /dev/test_firmware >/dev/null ; then + echo "$0: firmware was expected to be cancelled" >&2 + exit 1 + else + echo "$0: cancelling custom fallback mechanism works" + fi fi set +e -- 2.7.4 From 1583524462884388608@xxx Wed Nov 08 18:43:29 +0000 2017 X-GM-THRID: 1583524462884388608 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread