From patchwork Tue Jun 27 13:42:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 9811699 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 40E4D60351 for ; Tue, 27 Jun 2017 13:43:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3549428553 for ; Tue, 27 Jun 2017 13:43:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 297EE28660; Tue, 27 Jun 2017 13:43:08 +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=-6.9 required=2.0 tests=BAYES_00,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 7B991285E0 for ; Tue, 27 Jun 2017 13:43:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751659AbdF0NnG (ORCPT ); Tue, 27 Jun 2017 09:43:06 -0400 Received: from mx2.suse.de ([195.135.220.15]:40302 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752128AbdF0NnF (ORCPT ); Tue, 27 Jun 2017 09:43:05 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id ECB6AAE18; Tue, 27 Jun 2017 13:43:03 +0000 (UTC) From: Johannes Thumshirn To: Omar Sandoval Cc: Jens Axboe , Linux Block Layer Mailinglist , Johannes Thumshirn Subject: [PATCH blktests v2 2/2] block/011: Perform PCI reset while doing IO Date: Tue, 27 Jun 2017 15:42:57 +0200 Message-Id: <20170627134257.15863-3-jthumshirn@suse.de> X-Mailer: git-send-email 2.12.3 In-Reply-To: <20170627134257.15863-1-jthumshirn@suse.de> References: <20170627134257.15863-1-jthumshirn@suse.de> 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-case performs I/O with fio while doing PCI disable/enable cycles. In the results we don't care for I/O errors but for hiccups in dmesg only. Signed-off-by: Johannes Thumshirn --- tests/block/011 | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++ tests/block/011.out | 2 ++ 2 files changed, 57 insertions(+) create mode 100755 tests/block/011 create mode 100644 tests/block/011.out diff --git a/tests/block/011 b/tests/block/011 new file mode 100755 index 000000000000..65ed3dfa7092 --- /dev/null +++ b/tests/block/011 @@ -0,0 +1,55 @@ +#!/bin/bash +# +# Do disable PCI device while doing I/O to it +# +# Copyright (C) 2017 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="disable PCI device while doing I/O" +TIMED=1 + +requires() { + _have_fio +} + +device_requires() { + _test_dev_is_pci +} + +test_device() { + echo "Running ${TEST_NAME}" + + pdev=$(_get_pci_dev_from_blkdev) + + if _test_dev_is_rotational; then + size="32m" + else + size="1g" + fi + + # start fio job + _run_fio --bs=4k --rw=randread --norandommap \ + --name=reads --filename="$TEST_DEV" --size="$size" \ + --numjobs=8 --direct=1 --ignore_error=EIO,ENXIO,ENODEV & + + while kill -0 $! 2>/dev/null; do + echo 0 > "/sys/bus/pci/devices/${pdev}/enable" + sleep .2 + echo 1 > "/sys/bus/pci/devices/${pdev}/enable" + sleep .2 + done + + echo "Test complete" +} diff --git a/tests/block/011.out b/tests/block/011.out new file mode 100644 index 000000000000..8e067df63097 --- /dev/null +++ b/tests/block/011.out @@ -0,0 +1,2 @@ +Running block/011 +Test complete