From patchwork Fri Jun 23 14:29:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 9806717 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 B6AE760329 for ; Fri, 23 Jun 2017 14:30:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A7F4B28773 for ; Fri, 23 Jun 2017 14:30:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9CB6A28780; Fri, 23 Jun 2017 14:30:14 +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 846C928773 for ; Fri, 23 Jun 2017 14:30:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752006AbdFWOaN (ORCPT ); Fri, 23 Jun 2017 10:30:13 -0400 Received: from mx2.suse.de ([195.135.220.15]:38766 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751488AbdFWOaM (ORCPT ); Fri, 23 Jun 2017 10:30:12 -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 3F094AAB6; Fri, 23 Jun 2017 14:30:11 +0000 (UTC) From: Johannes Thumshirn To: Omar Sandoval Cc: Linux Block Layer Mailinglist , Omar Sandoval , Johannes Thumshirn Subject: [PATCH blktests 2/2] block/011: Perform PCI reset while doing IO Date: Fri, 23 Jun 2017 16:29:51 +0200 Message-Id: <20170623142951.17189-2-jthumshirn@suse.de> X-Mailer: git-send-email 2.12.3 In-Reply-To: <20170623142951.17189-1-jthumshirn@suse.de> References: <20170623142951.17189-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 From: Omar Sandoval 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 | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++++ tests/block/011.out | 2 ++ 2 files changed, 56 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..b0de35816d48 --- /dev/null +++ b/tests/block/011 @@ -0,0 +1,54 @@ +#!/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 2>/dev/null & + + 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" + 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