From patchwork Mon May 14 20:02:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Keith Busch X-Patchwork-Id: 10399175 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 75AD6601F9 for ; Mon, 14 May 2018 20:00:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8D98127E01 for ; Mon, 14 May 2018 20:00:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 824D728468; Mon, 14 May 2018 20:00:46 +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=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 17A2C27E01 for ; Mon, 14 May 2018 20:00:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751954AbeENUAp (ORCPT ); Mon, 14 May 2018 16:00:45 -0400 Received: from mga11.intel.com ([192.55.52.93]:3943 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751422AbeENUAp (ORCPT ); Mon, 14 May 2018 16:00:45 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 May 2018 13:00:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,401,1520924400"; d="scan'208";a="46180670" Received: from unknown (HELO localhost.lm.intel.com) ([10.232.112.44]) by fmsmga002.fm.intel.com with ESMTP; 14 May 2018 13:00:44 -0700 From: Keith Busch To: Omar Sandoval , Johannes Thumshirn , linux-block@vger.kernel.org, linux-nvme@lists.infradead.org Cc: Keith Busch Subject: [PATCH blktests] nvme: Add command timeout injection test Date: Mon, 14 May 2018 14:02:37 -0600 Message-Id: <20180514200237.15135-1-keith.busch@intel.com> X-Mailer: git-send-email 2.13.6 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This test will run a background IO process and inject an admin command with a very short timeout that is all but guaranteed to expire without a completion: the async event request. Signed-off-by: Keith Busch --- tests/nvme/005 | 42 ++++++++++++++++++++++++++++++++++++++++++ tests/nvme/005.out | 3 +++ 2 files changed, 45 insertions(+) create mode 100755 tests/nvme/005 create mode 100644 tests/nvme/005.out diff --git a/tests/nvme/005 b/tests/nvme/005 new file mode 100755 index 0000000..3fe9cbe --- /dev/null +++ b/tests/nvme/005 @@ -0,0 +1,42 @@ +#!/bin/bash +# +# Regression test for timeout handling. +# +# Copyright (C) 2018 Keith Busch +# +# 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 nvme admin command timeout handling with in-flight io" + +QUICK=1 + +requires() { + _have_program nvme +} + +test_device() { + echo "Running ${TEST_NAME}" + + # start fio job + _run_fio_rand_io --filename="${TEST_DEV}" --time_based --runtime=20 & + + sleep 5 + + # send nvme admin command 'async event request', which will surely time out + nvme admin-passthru ${TEST_DEV} -o 0xc --timeout=1 + + wait + + echo "Test complete" +} diff --git a/tests/nvme/005.out b/tests/nvme/005.out new file mode 100644 index 0000000..f4ff837 --- /dev/null +++ b/tests/nvme/005.out @@ -0,0 +1,3 @@ +Running nvme/005 +passthru: Interrupted system call +Test complete