From patchwork Wed Jun 12 23:08:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alison Schofield X-Patchwork-Id: 10991003 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5876714E5 for ; Wed, 12 Jun 2019 23:05:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 448502870E for ; Wed, 12 Jun 2019 23:05:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3607C28841; Wed, 12 Jun 2019 23:05:35 +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=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 BE4AD2870E for ; Wed, 12 Jun 2019 23:05:34 +0000 (UTC) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 93C2521290DF6; Wed, 12 Jun 2019 16:05:34 -0700 (PDT) X-Original-To: linux-nvdimm@lists.01.org Delivered-To: linux-nvdimm@lists.01.org Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.151; helo=mga17.intel.com; envelope-from=alison.schofield@intel.com; receiver=linux-nvdimm@lists.01.org Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) (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 3C1BB21290DF2 for ; Wed, 12 Jun 2019 16:05:33 -0700 (PDT) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Jun 2019 16:05:32 -0700 X-ExtLoop1: 1 Received: from alison-desk.jf.intel.com ([10.54.74.53]) by orsmga008.jf.intel.com with ESMTP; 12 Jun 2019 16:05:32 -0700 Date: Wed, 12 Jun 2019 16:08:45 -0700 From: Alison Schofield To: linux-nvdimm@lists.01.org Subject: [ndctl PATCH] ndctl, test: handle backup_keys in security.sh Message-ID: <20190612230845.GA13679@alison-desk.jf.intel.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.9.4 (2018-02-28) X-BeenThere: linux-nvdimm@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Linux-nvdimm developer list." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" X-Virus-Scanned: ClamAV using ClamSMTP Fix a typo in security.sh that causes a script failure when an nvdimm-master.blob already exists and needs to be backed up. + setup_keys + '[' '!' -d /etc/ndctl/keys ']' + '[' -f /etc/ndctl/keys/nvdimm-master.blob ']' + mv /etc/ndctl/keys/nvdimm-master.blob /etc/ndctl/keys/nvdimm-master.blob.bak + 0=1 ./security.sh: line 39: 0=1: command not found Fixes: ba35642d3815 ("ndctl: add a load-keys test in the security unit test") Signed-off-by: Alison Schofield Reviewed-by: Dan Williams --- test/security.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/security.sh b/test/security.sh index 8a36265..c86d2c6 100755 --- a/test/security.sh +++ b/test/security.sh @@ -36,11 +36,11 @@ setup_keys() if [ -f "$masterpath" ]; then mv "$masterpath" "$masterpath.bak" - $backup_key=1 + backup_key=1 fi if [ -f "$keypath/tpm.handle" ]; then mv "$keypath/tpm.handle" "$keypath/tmp.handle.bak" - $backup_handle=1 + backup_handle=1 fi dd if=/dev/urandom bs=1 count=32 2>/dev/null | keyctl padd user "$masterkey" @u