Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp469207rwr; Wed, 3 May 2023 01:05:27 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7UPFeS0EPXKUh4Z3cpHGjSIVW5tEU6rA26I+qiCsiTn0+XZdANaY2cSx01c6qt54O7p3Nq X-Received: by 2002:a05:6a20:bea9:b0:ee:a89f:5b55 with SMTP id gf41-20020a056a20bea900b000eea89f5b55mr15717105pzb.34.1683101127045; Wed, 03 May 2023 01:05:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683101127; cv=none; d=google.com; s=arc-20160816; b=JimPTUVvDS3yxpP7vGTT1+k/TQsm6iF0byyfivJeHmOuNyf2roo63I9h9B96WUPajb CRqKwBt4etEMOv5w2E5iGnGuhv89OahNMNJ3YPyguQmI2dcBLedEVda+NfBcb3JpNPQO AvdjygtAKYi56CE4XKOKTfFUF5M4JdX6Cxyhguab6PBcGZGxAtgFdhXWPRclPuK6kkwo tkd8pWS1UQ3pVTJWUxx3BPcqboM2svusvokhgk9n3IDM+cT7TpEvQvAO5SXxlCdE08i5 ZUAsPYL+OZ3hQ5lQm9xqMSpuNZTZ6lFVvFmK8+WaZ7dPCCJjxnKKJJKroELvxgMIfFPE D7eQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=4tjE0NvC6MVI533blqgvoUgxDFlwXYq30tEklO1YpJ0=; b=cU05eUOk4N/RMU0/1uwvah+yZOudS8up+iMM7MbiSF0je+OEd4oRmdhcq2Fomf/z4m g0K0Svu/HW0sARQ4/WuiphIK2YhBZNFQadW8nzN1IS7P18wPKyfL/jW3QT3Pbl8g5ks8 LbekRL2TmKIZeztfD1sOFXqBixjGChEp3mrMU7qCChkZFcrFwwfsTd4+EiKcxcD9dbaF ZKuG1Dd28z90t9ryc3KFAaI4IwFvN137RPfUAtnGG2sd5qYwifXfyGLwNEVVhWjRucFy Lk/T+L5nMAq5B7vUMXUQl+B5SwzXjhA1MBsY89WXst0nr+Cjjq3MlZ24lqJcRbEOMVFf eWhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=CtMiP3Z5; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b="v/S/oorU"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j190-20020a6380c7000000b005180515929csi10518351pgd.28.2023.05.03.01.05.13; Wed, 03 May 2023 01:05:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=CtMiP3Z5; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b="v/S/oorU"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229845AbjECIDy (ORCPT + 99 others); Wed, 3 May 2023 04:03:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59062 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229729AbjECIDS (ORCPT ); Wed, 3 May 2023 04:03:18 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0088C469A; Wed, 3 May 2023 01:03:15 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 9BF56223C8; Wed, 3 May 2023 08:03:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1683100994; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4tjE0NvC6MVI533blqgvoUgxDFlwXYq30tEklO1YpJ0=; b=CtMiP3Z5krP0JLc1HmiqxpTQdYbELINNJXMQRnjrRXF58FcwvdejfTXM2MtCoCYa3Iv3Ho Df3auU4Ppi91PQQsedxI49CvtR0AC8VYCaLbt2P1V48TlIeFDdeJMK6ArxKJZSoX8XFc2A D54+VGIgasCfl263FCfrVhh1HHoXQMg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1683100994; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4tjE0NvC6MVI533blqgvoUgxDFlwXYq30tEklO1YpJ0=; b=v/S/oorULdefpK5+10mObYc6T/jS5YfCq8+tEtx7YXv3g4jQ62MnPqSYzpIergkXMguIGw cKQUYhlUSMoM6yDQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 8EC001331F; Wed, 3 May 2023 08:03:14 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id H57WIkIVUmRBYgAAMHmgww (envelope-from ); Wed, 03 May 2023 08:03:14 +0000 From: Daniel Wagner To: linux-nvme@lists.infradead.org Cc: linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, Chaitanya Kulkarni , Shin'ichiro Kawasaki , Hannes Reinecke , Daniel Wagner Subject: [PATCH blktests v3 08/12] nvme/rc: Add minimal test image size requirement Date: Wed, 3 May 2023 10:02:54 +0200 Message-Id: <20230503080258.14525-9-dwagner@suse.de> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230503080258.14525-1-dwagner@suse.de> References: <20230503080258.14525-1-dwagner@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Some tests need a minimal test image size to work correctly. Thus add a helper to check the size and update these tests accordingly. The image minimum is 4M because some of the test have hard coded values. All tests which use the xfs fio verification job have a minimum requirement of 350M impossed by the xfs filesystem. Reviewed-by: Hannes Reinecke Signed-off-by: Daniel Wagner --- tests/nvme/012 | 1 + tests/nvme/013 | 1 + tests/nvme/029 | 1 - tests/nvme/045 | 2 +- tests/nvme/rc | 15 +++++++++++++++ 5 files changed, 18 insertions(+), 2 deletions(-) diff --git a/tests/nvme/012 b/tests/nvme/012 index ecf44fcb5a51..efe227538c57 100755 --- a/tests/nvme/012 +++ b/tests/nvme/012 @@ -16,6 +16,7 @@ requires() { _have_fio _have_loop _require_nvme_trtype_is_fabrics + _require_nvme_test_img_size 350m } test() { diff --git a/tests/nvme/013 b/tests/nvme/013 index e249add46295..14e646a19c47 100755 --- a/tests/nvme/013 +++ b/tests/nvme/013 @@ -15,6 +15,7 @@ requires() { _have_xfs _have_fio _require_nvme_trtype_is_fabrics + _require_nvme_test_img_size 350m } test() { diff --git a/tests/nvme/029 b/tests/nvme/029 index 1808b7b0edf1..c6d38b42af70 100755 --- a/tests/nvme/029 +++ b/tests/nvme/029 @@ -14,7 +14,6 @@ requires() { _nvme_requires _have_loop _require_nvme_trtype_is_fabrics - _require_test_dev_size 1M } test_user_io() diff --git a/tests/nvme/045 b/tests/nvme/045 index 7c51da27b5f1..99012f6bed8f 100755 --- a/tests/nvme/045 +++ b/tests/nvme/045 @@ -120,7 +120,7 @@ test() { nvmedev=$(_find_nvme_dev "${subsys_name}") - _run_fio_rand_io --size=8m --filename="/dev/${nvmedev}n1" + _run_fio_rand_io --size=4m --filename="/dev/${nvmedev}n1" _nvme_disconnect_subsys "${subsys_name}" diff --git a/tests/nvme/rc b/tests/nvme/rc index 51dde39c2966..0b4d5f6570d6 100644 --- a/tests/nvme/rc +++ b/tests/nvme/rc @@ -21,6 +21,7 @@ nvme_img_size=${nvme_img_size:-"1G"} _nvme_requires() { _have_program nvme + _require_nvme_test_img_size 4m case ${nvme_trtype} in loop) _have_driver nvme-loop @@ -94,6 +95,20 @@ _require_test_dev_is_nvme() { return 0 } +_require_nvme_test_img_size() { + local require_sz_mb + local nvme_img_size_mb + + require_sz_mb="$(convert_to_mb "$1")" + nvme_img_size_mb="$(convert_to_mb "${nvme_img_size}")" + + if (( "${nvme_img_size_mb}" < "$require_sz_mb" )); then + SKIP_REASONS+=("nvme_img_size must be at least ${require_sz_mb}m") + return 1 + fi + return 0 +} + _require_nvme_trtype() { local trtype for trtype in "$@"; do -- 2.40.0