Received: by 10.213.65.68 with SMTP id h4csp456849imn; Tue, 27 Mar 2018 02:35:28 -0700 (PDT) X-Google-Smtp-Source: AG47ELtwRz0P3kyXfnMJ/Ds3gRz+Y+5Cb6jskQAotjTGnhTQROciPNNB6DtjO78kptlVX56dDJaA X-Received: by 10.98.103.199 with SMTP id t68mr32596676pfj.24.1522143328032; Tue, 27 Mar 2018 02:35:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522143328; cv=none; d=google.com; s=arc-20160816; b=dYuJidzxvp758u52G4oMER14NcgMKRthxjp45rCk9u/IKmW/4v+3+QKEYX1vqLISqU hJJBJ1PM9P4LFjhQiaZWY11p5AVau9Zi1nXjVcbLBHHQmMR2VQg8TypnWz+NC2KUITBu XqKGNo4uCNQBefYFIrjrrCOZQBnO/MHQI5yF0nRgDW/TTh89k2iJdvljku+LhLUj15iI kHfUlxexsiOQqai2NUlpmXKTsu/O5LC2L4XEKnbQv4ArqlHCliXeHbQWv5kQgmWaghGf kodhN75Bz3BbyoEfPR6njgHVKKuN4hItnGeWBWOZZfmVL85sDbArrn8PqfznjQJzHa2d 8sig== 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:arc-authentication-results; bh=WnbT1Dbnb0Q7a2X586GPjvGVl8hpE8SHWyxMWLtcWOo=; b=P6bK35y6QhUdeGIlqMYMw3BPgh9JBnD4KZPgdAwfBXNVvFlaXxXsMGv447Lt52JLA+ WsBaFrb+8OfX+wqHvybxwFJACWRvRMDpPazgfajs290WnNuTXhSzUjhjH+SV0dDDynSd eTpCtyS2kKU1vItfWbAaG+3iBHFB71ZuXMX2zPCJI4UUP22ZrNacV+8cNM+extG7iZu0 vmfSYH0mA4q8ptqhWvRaTnKed3aPRVA0qwUJSkaA1DsaDV30g9H51OMNsIbSheIgU1j4 t7nho3CiBEaNxaOZA+aZ78Ndnyh2pin+QVuR586kpSowbMlQEYCCDuSvGK/c5CJYU6oC 1zUA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o1-v6si892157pld.255.2018.03.27.02.35.12; Tue, 27 Mar 2018 02:35:28 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752447AbeC0JeD (ORCPT + 99 others); Tue, 27 Mar 2018 05:34:03 -0400 Received: from mx2.suse.de ([195.135.220.15]:44129 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751075AbeC0JeB (ORCPT ); Tue, 27 Mar 2018 05:34:01 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id D3FC5AFFC; Tue, 27 Mar 2018 09:33:56 +0000 (UTC) From: Johannes Thumshirn To: Omar Sandoval Cc: Linux Kernel Mailinglist , Linux NVMe Mailinglist , Johannes Thumshirn Subject: [PATCH] test/nvme/003: add test case for patch "nvme: don't send keep-alives to the discovery controller" Date: Tue, 27 Mar 2018 11:31:47 +0200 Message-Id: <20180327093147.10684-1-jthumshirn@suse.de> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180327092848.10404-1-jthumshirn@suse.de> References: <20180327092848.10404-1-jthumshirn@suse.de> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add a regression test for the patch titled "nvme: don't send keep-alives to the discovery controller". This patch creates a local loopback nvme target and then connects to it. If the patch is not applied we see two error messages in dmesg: "failed nvme_keep_alive_end_io error=" from the nvme host and "nvmet: unsupported cmd 24" from the nvme target. If the patch is applied dmesg is quiet. Signed-off-by: Johannes Thumshirn --- tests/nvme/003 | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ tests/nvme/003.out | 2 ++ 2 files changed, 63 insertions(+) create mode 100755 tests/nvme/003 create mode 100644 tests/nvme/003.out diff --git a/tests/nvme/003 b/tests/nvme/003 new file mode 100755 index 000000000000..5353de5ae9c3 --- /dev/null +++ b/tests/nvme/003 @@ -0,0 +1,61 @@ +#!/bin/bash +# +# Regression test for patch "nvme: don't send keep-alives to the discovery +# controller" +# +# Copyright (C) 2018 Johannes Thumshirn +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +DESCRIPTION="Test if we're sending keep-alives to a discovery controller" + +QUICK=1 + +requires() { + _have_program nvme && _have_module nvme-loop && _have_module loop \ + && _have_configfs +} + +test() { + echo "Running ${TEST_NAME}" + + modprobe nvmet + modprobe nvme-loop + + port=$(_create_nvmet_port "loop") + + loop_dev="$(losetup -f)" + + _create_nvmet_subsystem "blktests-subsystem-1" ${loop_dev} + _add_nvmet_subsys_to_port ${port} "blktests-subsystem-1" + + nvme connect -t loop -n nqn.2014-08.org.nvmexpress.discovery + + # This is ugly but checking for the absence of error messages is ... + sleep 10 + + if dmesg | grep -q "failed nvme_keep_alive_end_io error="; then + echo "Fail" + fi + + if dmesg | grep -q "nvmet: unsupported cmd 24"; then + echo "Fail" + fi + + _remove_nvmet_subsystem_from_port ${port} "blktests-subsystem-1" + _remove_nvmet_subsystem "blktests-subsystem-1" + _remove_nvmet_port ${port} + + echo "Test complete" +} diff --git a/tests/nvme/003.out b/tests/nvme/003.out new file mode 100644 index 000000000000..01b275612159 --- /dev/null +++ b/tests/nvme/003.out @@ -0,0 +1,2 @@ +Running nvme/003 +Test complete -- 2.12.3