From patchwork Wed Nov 8 19:54:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Pundir X-Patchwork-Id: 118333 Delivered-To: patch@linaro.org Received: by 10.80.225.132 with SMTP id k4csp55015edl; Wed, 8 Nov 2017 11:54:30 -0800 (PST) X-Google-Smtp-Source: ABhQp+Th/0I7arHDgXtS709ckySoD+JuYync3utF6iFnIXAncFkPXxAhleKjAcsDB54v2JXdYiHQ X-Received: by 10.99.43.6 with SMTP id r6mr1472212pgr.353.1510170869990; Wed, 08 Nov 2017 11:54:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510170869; cv=none; d=google.com; s=arc-20160816; b=KxCBMhFGaKS+w8dp+E0EOWqdKEn2i5f4FNEZADPBHXYPXz+rrhe30DgvI48C9s5aOI zg4sLloEhxNk+50Hu+2FBmC354rKLFzvyQ73b+NKKnzoRYFAJPkZxHt3YuopTLr5N8uT G6YPsrX5D5iqxAtqIGFnpkDZ0AVDy+r4nnQ0ic94GJReiqjCouvSbq4CsCzFHoNusPr1 FIr9o+8GfDK2lqUMNTp+wYV5sSvbtBtm6n5oa3/tZotV58EOWOLInI4wFQyJRqebOdEY OE/FstsooNAE+jbwiWOPw7OcFdWYbQehmJVw17GO6TrgjM7PGcObV63XI1vYNrVAWBj3 fmWA== 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=u5yWdHmpt/O/FxwiK85l0WrpO0aTIsb2302qRRd+LLg=; b=njCZLUizNDMCMQ16kHgmr2h6xtN3Ex9UnV3jHOMmGv+Qwf62csb86b65T9c5woiYBW 5hZS8Ux2oUHfDRmMHOs3snS4RHByeQYOXZETuxo7PrmSZB+5YhDKhuAcetkfLiLvdI7z C3bLRCobpZS0qpq8nIok8PGKg3bP8QWQOQx30xaUrpvGj17pCAvaNHuy/3jdEwMlo+Gu 59P6L2lNY2QoPgJwF7A3JX7Pxj/bngmc78hf7IdsxMt5E5VDh78p3TwHCD8czcDjlk8e GbG0Uf9x2GTbnQmPXzxZ1CF15iBZAAVmpRh2ifJfimTDc/AsZHy4ovp9MbNRvLNgY3y9 3Rqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TgXy43Jd; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 f5si4413061plo.19.2017.11.08.11.54.29; Wed, 08 Nov 2017 11:54:29 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-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=TgXy43Jd; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 S1751749AbdKHTy2 (ORCPT + 9 others); Wed, 8 Nov 2017 14:54:28 -0500 Received: from mail-pf0-f193.google.com ([209.85.192.193]:46575 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752633AbdKHTy1 (ORCPT ); Wed, 8 Nov 2017 14:54:27 -0500 Received: by mail-pf0-f193.google.com with SMTP id p87so2493965pfj.3 for ; Wed, 08 Nov 2017 11:54:27 -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=u5yWdHmpt/O/FxwiK85l0WrpO0aTIsb2302qRRd+LLg=; b=TgXy43JdlY2rxleqV1ep9viN5u0DwE82Gbdqb2m/DJhl6AyuYgCwq6esDmLJz0O2Rr gq44tofh/L7LBSgoPjYCv36uo8nIatVcEqFfq7W0ChbdABHr9w0w7lBfEMoEUXEzP+NN 0VeBePGyb7TZdesr5jSqq1R4ynmlw7CsD4suE= 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=u5yWdHmpt/O/FxwiK85l0WrpO0aTIsb2302qRRd+LLg=; b=VVU1tbDY/1sQDbMeR0PcspharAcx3zQrr+zjC3fQxwq/VIupJ4NuaP1x1mPsiavtF2 t3VeWXjxM0MCCo5/8a8Yl7I9nfIZm0P1IMtuMWY8K9ugTS8EmjWvEHPXIZqkiKatpjyM kRXCdjU7BuPZXu/DTR5VPIvFIPHCu3I72n3CkkD3tXhKNVWDKhJP6EyoTDA5xz4kf+yp sl73AaDLSMsMwZb5hfPrku0EghyYjEZRq/UDoFqvXNPQoBLLoMnZ5CfvhIjd17RsAwPe /iymJlWde1mDNg9NODzbocS/a8w+54TorUuDMspO2Qw6yklwIqUa62mwu8Cqo1XHIidu WjiQ== X-Gm-Message-State: AJaThX64s3aZW2qT7UQd1dHvqi9MC+0IwbbRP87uSzIja1QN4UxnyIlQ WkFoU1ScA3pw2525lObLHl8fwM3GDD0= X-Received: by 10.101.72.196 with SMTP id o4mr1480257pgs.147.1510170867095; Wed, 08 Nov 2017 11:54:27 -0800 (PST) Received: from localhost.localdomain ([106.51.18.232]) by smtp.gmail.com with ESMTPSA id p83sm10021226pfd.61.2017.11.08.11.54.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 08 Nov 2017 11:54:25 -0800 (PST) From: Amit Pundir To: Greg KH Cc: Stable , Fengguang Wu , Shuah Khan , "Luis R . Rodriguez" , Brian Norris , Sumit Semwal , Shuah Khan Subject: [PATCH for-4.4.y 2/4] selftests: firmware: add empty string and async tests Date: Thu, 9 Nov 2017 01:24:10 +0530 Message-Id: <1510170852-32052-3-git-send-email-amit.pundir@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1510170852-32052-1-git-send-email-amit.pundir@linaro.org> References: <1510170852-32052-1-git-send-email-amit.pundir@linaro.org> Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Brian Norris commit 1b1fe542b6f010cf6bc7e1c92805e1c0e133e007 upstream. Now that we've added a 'trigger_async_request' knob to test the request_firmware_nowait() API, let's use it. Also add tests for the empty ("") string, since there have been a couple errors in that handling already. Since we now have real ways that the sysfs write might fail, let's add the appropriate check on the 'echo' lines too. Signed-off-by: Brian Norris Acked-by: Kees Cook Signed-off-by: Shuah Khan [AmitP: Dropped the async trigger testing parts from original commit] Signed-off-by: Amit Pundir --- tools/testing/selftests/firmware/fw_filesystem.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) -- 2.7.4 diff --git a/tools/testing/selftests/firmware/fw_filesystem.sh b/tools/testing/selftests/firmware/fw_filesystem.sh index c4366dc74e01..e9f563fd200a 100755 --- a/tools/testing/selftests/firmware/fw_filesystem.sh +++ b/tools/testing/selftests/firmware/fw_filesystem.sh @@ -48,8 +48,16 @@ echo "ABCD0123" >"$FW" NAME=$(basename "$FW") +if printf '\000' >"$DIR"/trigger_request; then + echo "$0: empty filename should not succeed" >&2 + exit 1 +fi + # Request a firmware that doesn't exist, it should fail. -echo -n "nope-$NAME" >"$DIR"/trigger_request +if echo -n "nope-$NAME" >"$DIR"/trigger_request; then + echo "$0: firmware shouldn't have loaded" >&2 + exit 1 +fi if diff -q "$FW" /dev/test_firmware >/dev/null ; then echo "$0: firmware was not expected to match" >&2 exit 1