From patchwork Fri Feb 23 21:38:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Zwisler X-Patchwork-Id: 10239885 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7D12860225 for ; Fri, 23 Feb 2018 21:38:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5F49C299F0 for ; Fri, 23 Feb 2018 21:38:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5424D299F3; Fri, 23 Feb 2018 21:38:36 +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=-1.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E9057299F0 for ; Fri, 23 Feb 2018 21:38:35 +0000 (UTC) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 3C9EA20954CB7; Fri, 23 Feb 2018 13:32:33 -0800 (PST) X-Original-To: linux-nvdimm@lists.01.org Delivered-To: linux-nvdimm@lists.01.org Received-SPF: None (no SPF record) identity=mailfrom; client-ip=134.134.136.100; helo=mga07.intel.com; envelope-from=ross.zwisler@linux.intel.com; receiver=linux-nvdimm@lists.01.org Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id EA4E5208F7AA7 for ; Fri, 23 Feb 2018 13:32:31 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Feb 2018 13:38:33 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,383,1515484800"; d="scan'208";a="19875495" Received: from theros.lm.intel.com ([10.232.112.164]) by orsmga007.jf.intel.com with ESMTP; 23 Feb 2018 13:38:33 -0800 From: Ross Zwisler To: dan.j.williams@intel.com, linux-nvdimm@lists.01.org, vishal.l.verma@intel.com, dave.jiang@intel.com Subject: [ndctl PATCH] ndctl, tests: firmware-update.sh post-test cleanup Date: Fri, 23 Feb 2018 14:38:27 -0700 Message-Id: <20180223213827.24808-1-ross.zwisler@linux.intel.com> X-Mailer: git-send-email 2.14.3 X-BeenThere: linux-nvdimm@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Linux-nvdimm developer list." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" X-Virus-Scanned: ClamAV using ClamSMTP When firmware-update.sh is run multiple times by itself, all runs but the first fail with this: + ../ndctl/ndctl update-firmware -d nmem1 -f update-fw.img Error: START FIRMWARE UPDATE failed: 0x9 Error: Another firmware upload in progress or finished. Fix this by having the test properly clean up and disable all the nfit_test regions and unloading the nfit_test module, as we do in test/pmem-errors.sh et al. Signed-off-by: Ross Zwisler Reviewed-by: Dan Williams --- test/firmware-update.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/test/firmware-update.sh b/test/firmware-update.sh index 1736472..44c1412 100755 --- a/test/firmware-update.sh +++ b/test/firmware-update.sh @@ -6,6 +6,7 @@ [ -f "./ndctl/ndctl" ] && [ -x "./ndctl/ndctl" ] && ndctl="./ndctl/ndctl" [ -z "$ndctl" ] && echo "Couldn't find an ndctl binary" && exit 1 bus="nfit_test.0" +bus1="nfit_test.1" json2var="s/[{}\",]//g; s/:/=/g" rc=77 dev="" @@ -41,6 +42,13 @@ reset() fi } +cleanup() +{ + $ndctl disable-region -b "$bus" all + $ndctl disable-region -b "$bus1" all + modprobe -r nfit_test +} + detect() { dev=$($ndctl list -b "$bus" -D | jq .[0].dev | tr -d '"') @@ -59,6 +67,5 @@ rc=1 reset detect do_tests -reset +cleanup exit 0 -