From patchwork Fri Apr 5 19:56:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 13619373 Received: from mail-yw1-f172.google.com (mail-yw1-f172.google.com [209.85.128.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6FB1515F40B for ; Fri, 5 Apr 2024 19:56:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712346987; cv=none; b=QCtr+mXv3vRK5K/IPUWSZvwe+vSj+8qlIuq/VUcQ1/LJj5ituRtdccGk3aC9UYXYfikR4MPRuOsFHEpz0WTiCbQtnMoNozmoURZL3sm9zI08xKcQuagidgjxNz/vfgVKCD9sk53F4WL4bwJBt14v8swrM1hhTyH020Ajng54nN8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712346987; c=relaxed/simple; bh=f7n9wQyvNkyfre4dBDX+1wJDTsB+exwyeh1Cu5coEfk=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=EUyRy28J4P1QKg77LZW8nY4U2PYGaBB+2YDbAymcZ4i2l+siqzZ7WxmT50SBsHdD7ggyLmjhoTFUK/ekxn5gjOR7k77SlIItWQto5jyQMhaa3Rv8dRUlslBp4wwKSWgA2yC6M29NL3Pxw+s0tpV5byhmQKTiE1lzXtmCA/9Fw7w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=toxicpanda.com; spf=none smtp.mailfrom=toxicpanda.com; dkim=pass (2048-bit key) header.d=toxicpanda-com.20230601.gappssmtp.com header.i=@toxicpanda-com.20230601.gappssmtp.com header.b=R5+rgcOX; arc=none smtp.client-ip=209.85.128.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=toxicpanda.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=toxicpanda.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=toxicpanda-com.20230601.gappssmtp.com header.i=@toxicpanda-com.20230601.gappssmtp.com header.b="R5+rgcOX" Received: by mail-yw1-f172.google.com with SMTP id 00721157ae682-6152088aa81so27621047b3.0 for ; Fri, 05 Apr 2024 12:56:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toxicpanda-com.20230601.gappssmtp.com; s=20230601; t=1712346984; x=1712951784; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=8jAQhTkshKgHWtfiyScKAvltEzvkerS8QAtp+/c9zro=; b=R5+rgcOXxgl5Aog2REqlDfWiynn08q/QW+O6Bs0QczTidM1O+YgWpunNvKepYyuftx 0ABwtsE8yWnnGkIEly80lzi6lWj9h3sHL7cIxsy5+tQMvHdkbWv4FcF9kgFT2DOvTmd9 ETlMEHx5rYKUUxSStv1iPMQw88y74Pvt6nSar9u0g4whdw91r4hiBoIYm3fBlHfdmBLo cdXWO+G8sdAXfqvTA+Lc6L2mT8IulwMk26h+BWRo3RlVpxphPZ2bQ4Laj4sA3u6JaZ02 ihE4S+HJT/CD+lTuLcGSESRDEii7CUauFprwpDSmA7+bl7Hucxvjt5GJgNYKtSx+AvEH r2RQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712346984; x=1712951784; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8jAQhTkshKgHWtfiyScKAvltEzvkerS8QAtp+/c9zro=; b=FddjIve5ezuqcUvGULWLHe7N1ntCq49FHuAUyxw7/dbj/i46A76T/x9XLBbf5vLPN/ 1H5h+NAftNTR6VQz5R/3hlWk2IRHefW/bfteTk6HEDByCher8i8+LL8EBa9sKUJc7Rf1 Fn4TLVQy30vaBh/M3kdNqHAAb1N7jgfTSpWjt1QKzQQ0bClsbycl6s4+oTnKI2nAD0J3 +rUrNcBuasoBGpEP9aQjMDYKAhkAUtGj0i0/Ri0fDDAuaT9gr4lW7jy7etarReP3NmI8 VnXB5R6dGO1FRu0353GTs+x4vNJ/7C0L1SRvXzUxzw8h8Yb7P7a9RTBm05/aNCqOEG+R 6ZRw== X-Forwarded-Encrypted: i=1; AJvYcCWx9MnqJe/6WeMdL1sY+FgJwJWTM/KWUfAJwdqpYlPE8N8TNfavRgLXSvs1vun1/Apu/ius5O6MRdX9Wkwc0jzXh9y9muxjYAwWrV0= X-Gm-Message-State: AOJu0Yy/6rTpfnpw/RxDLZOkxBDELFdXHAlAl0juSO1lpSxk4w5M3GmN KwRfVvd8R7hMppJDfWD8bxeYXtyOusg/owalUwFVDvOngf8tg+jZ1vn33zJxXBQ= X-Google-Smtp-Source: AGHT+IHlxvNbcraq11Ixwrgn9+7FOq4UV97HdVb/zuWGIY6ttwfEZ/vmoA47sHnSaW2/GqaMsDY1CQ== X-Received: by 2002:a0d:d554:0:b0:615:800d:67b2 with SMTP id x81-20020a0dd554000000b00615800d67b2mr2246292ywd.29.1712346984422; Fri, 05 Apr 2024 12:56:24 -0700 (PDT) Received: from localhost (076-182-020-124.res.spectrum.com. [76.182.20.124]) by smtp.gmail.com with ESMTPSA id fb17-20020a05622a481100b00434383f2518sm1049910qtb.87.2024.04.05.12.56.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Apr 2024 12:56:23 -0700 (PDT) From: Josef Bacik To: fstests@vger.kernel.org, linux-btrfs@vger.kernel.org, kernel-team@fb.com Subject: [PATCH v2 1/3] fstests: change btrfs/197 and btrfs/198 golden output Date: Fri, 5 Apr 2024 15:56:12 -0400 Message-ID: <88b11129c00fb9b07e36569b4b5fe823c0a98c39.1712346845.git.josef@toxicpanda.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-btrfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Both btrfs/197 and btrfs/198 check several raid types. We may not have support for raid5/6 for our available profiles, but we'd like to be able to test the other profiles. In order to enable this, update the golden output to have no output, and simply have the test check for the device we removed to see if it still exists in the device list output. This will allow us to add a check to skip unsupported raid configurations in our config. Signed-off-by: Josef Bacik Reviewed-by: Anand Jain --- tests/btrfs/197 | 7 +++++-- tests/btrfs/197.out | 25 +------------------------ tests/btrfs/198 | 7 +++++-- tests/btrfs/198.out | 25 +------------------------ 4 files changed, 12 insertions(+), 52 deletions(-) diff --git a/tests/btrfs/197 b/tests/btrfs/197 index d259fd99..2ce41b32 100755 --- a/tests/btrfs/197 +++ b/tests/btrfs/197 @@ -38,7 +38,7 @@ workout() raid=$1 device_nr=$2 - echo $raid + echo $raid >> $seqres.full _scratch_dev_pool_get $device_nr _spare_dev_get @@ -62,7 +62,9 @@ workout() _mount -o degraded $device_2 $SCRATCH_MNT # Check if missing device is reported as in the .out $BTRFS_UTIL_PROG filesystem show -m $SCRATCH_MNT | \ - _filter_btrfs_filesystem_show + _filter_btrfs_filesystem_show > $tmp.output 2>&1 + cat $tmp.output >> $seqres.full + grep -q "$device_1" $tmp.output && _fail "found stale device" $BTRFS_UTIL_PROG device remove "$device_1" "$TEST_DIR/$seq.mnt" $UMOUNT_PROG $TEST_DIR/$seq.mnt @@ -77,5 +79,6 @@ workout "raid6" "4" workout "raid10" "4" # success, all done +echo "Silence is golden" status=0 exit diff --git a/tests/btrfs/197.out b/tests/btrfs/197.out index 79237b85..3bbd3143 100644 --- a/tests/btrfs/197.out +++ b/tests/btrfs/197.out @@ -1,25 +1,2 @@ QA output created by 197 -raid1 -Label: none uuid: - Total devices FS bytes used - devid size used path SCRATCH_DEV - *** Some devices missing - -raid5 -Label: none uuid: - Total devices FS bytes used - devid size used path SCRATCH_DEV - *** Some devices missing - -raid6 -Label: none uuid: - Total devices FS bytes used - devid size used path SCRATCH_DEV - *** Some devices missing - -raid10 -Label: none uuid: - Total devices FS bytes used - devid size used path SCRATCH_DEV - *** Some devices missing - +Silence is golden diff --git a/tests/btrfs/198 b/tests/btrfs/198 index 7d23ffce..a326a8ca 100755 --- a/tests/btrfs/198 +++ b/tests/btrfs/198 @@ -28,7 +28,7 @@ workout() raid=$1 device_nr=$2 - echo $raid + echo $raid >> $seqres.full _scratch_dev_pool_get $device_nr _scratch_pool_mkfs "-d$raid -m$raid" >> $seqres.full 2>&1 || \ @@ -46,7 +46,9 @@ workout() _mount -o degraded $device_2 $SCRATCH_MNT # Check if missing device is reported as in the 196.out $BTRFS_UTIL_PROG filesystem show -m $SCRATCH_MNT | \ - _filter_btrfs_filesystem_show + _filter_btrfs_filesystem_show > $tmp.output 2>&1 + cat $tmp.output >> $seqres.full + grep -q "$device_1" $tmp.output && _fail "found stale device" _scratch_unmount _scratch_dev_pool_put @@ -58,5 +60,6 @@ workout "raid6" "4" workout "raid10" "4" # success, all done +echo "Silence is golden" status=0 exit diff --git a/tests/btrfs/198.out b/tests/btrfs/198.out index af904a39..cb4c7854 100644 --- a/tests/btrfs/198.out +++ b/tests/btrfs/198.out @@ -1,25 +1,2 @@ QA output created by 198 -raid1 -Label: none uuid: - Total devices FS bytes used - devid size used path SCRATCH_DEV - *** Some devices missing - -raid5 -Label: none uuid: - Total devices FS bytes used - devid size used path SCRATCH_DEV - *** Some devices missing - -raid6 -Label: none uuid: - Total devices FS bytes used - devid size used path SCRATCH_DEV - *** Some devices missing - -raid10 -Label: none uuid: - Total devices FS bytes used - devid size used path SCRATCH_DEV - *** Some devices missing - +Silence is golden From patchwork Fri Apr 5 19:56:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 13619374 Received: from mail-qt1-f176.google.com (mail-qt1-f176.google.com [209.85.160.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 037E717335B for ; Fri, 5 Apr 2024 19:56:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712346989; cv=none; b=X46RpS3MeduUMh86QgabifUuWXDs6sapINuNF6yBHlvq4Xin7QMFG2DMii+ST0XUK6+uw1mSf4g1ly7DbE432f5YbDzDMqY6PxoCg6rs5q8toZsJaByfOLSA5yerngdC2Ec+gg7O0pUmfVnxGqe898ssL0czAmBEsgsg6g5Gj9g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712346989; c=relaxed/simple; bh=HYUW+z//x5mv5zjQLHy4xGBk1J7vq2b4pb+HyyJmcIo=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=CxadIj0NOnRdJPGLzJEGxbHUFpG5X3s1vREnoxKaGolBRBrrly7U0enJft118yXJ8Qli/givMkpmU7PL1vg/w8BrKuBeRC+gNrz+4EfYKZdLOV+E4M03R8wXJ2C2qrYiOMRpFiwD0X6qpQSxp4RTpRbojYGSisXrl4iLLhE/i4c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=toxicpanda.com; spf=none smtp.mailfrom=toxicpanda.com; dkim=pass (2048-bit key) header.d=toxicpanda-com.20230601.gappssmtp.com header.i=@toxicpanda-com.20230601.gappssmtp.com header.b=gd/TQ7Yo; arc=none smtp.client-ip=209.85.160.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=toxicpanda.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=toxicpanda.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=toxicpanda-com.20230601.gappssmtp.com header.i=@toxicpanda-com.20230601.gappssmtp.com header.b="gd/TQ7Yo" Received: by mail-qt1-f176.google.com with SMTP id d75a77b69052e-432bfaf533eso13075261cf.2 for ; Fri, 05 Apr 2024 12:56:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toxicpanda-com.20230601.gappssmtp.com; s=20230601; t=1712346986; x=1712951786; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=YuucR5tQ+uVPIm11Y7vgLKHErtjkCXmOFvH2OaG8/wM=; b=gd/TQ7YovO86gecjqQCM8nLLndKJo9f+8FSrJMskKew0GYIWltP5igHfb1olaJR9bw kIflbhQ/UmoX4UaUm8eEug+zkACGoHxAmTXzLWdb7oPpMl5bT6mytHsZRY7JnKtegTHt xVevIg4ddJJFuSZ9/QgtWh4TeYNLNISaBa3E1IUy9rnChFAdwUOm/bw2oVufCL6hh5em BHatAhEJ6aoyix3PEuLOKGPCvaXW1+VRF89dL5z7oSRXI/PIhRVF9b4KgZy+X/6v/PJo o0HlryTlY/QAtC6fPpNgDB/oj4DA84MHweSz5Dy5Gna5A8U46VenxnFKqng1Fuz1Tl5G Joeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712346986; x=1712951786; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YuucR5tQ+uVPIm11Y7vgLKHErtjkCXmOFvH2OaG8/wM=; b=cpK6250b7DDU/9RFfE75z7qQTCmp/i5TMs3OwNC4318ooEF/p91xuWNqksUtyXcuhN 1QqamLDMcPz47rFIXwsMZwpaGCteUXpMibrb++HB2ScQWQjoq8/KSurZteVs7kS8Iy5i BX6d3lAMS1h9MyssPiqSSGbL3W17Xof3H9lalm3xR5JtQAYmRkbHWz2p1t5Gu61XYlaJ GmvxdNGePlEpA+vv4zNdQpfNHynIPDYDVsE48DGF3OCxwavmTDd5sin4bFEPNYA+XsF5 apZf0e3D/A5/cwAm704uJp5jBy9LqaQV8HggEO3sh/6McpfqJQC5DY8t22ehyJFkBIVG kp8A== X-Forwarded-Encrypted: i=1; AJvYcCW1uCPvl37ZZ/b2SKZmLyzFLSNncJ6sgrdzO7PlxZ4ps3mVYq4DA9QfczNyHK+qHAUGZ2rzCTLsGxaFCy1zychQWk2snHXfDQDgkLY= X-Gm-Message-State: AOJu0Yw6pg2GaHcLtN2ha9TNbuAaQ4GhMMKVqB0IyxHLxqfRAvuzJizW 8qSIvFmDnL2UNAgMf2abwgDhkGclnMwSS13myEdIUxXbYIx/raC+Z7njzbWceWk= X-Google-Smtp-Source: AGHT+IEA7M+xKsCKiADYz/4Mi1mQQPa7Fbz8fuenzFobxaGYdovn4Bpb6fC2H0wihjc+UTxGuJ0HnQ== X-Received: by 2002:ac8:574f:0:b0:434:4a16:609c with SMTP id 15-20020ac8574f000000b004344a16609cmr2324082qtx.39.1712346985929; Fri, 05 Apr 2024 12:56:25 -0700 (PDT) Received: from localhost (076-182-020-124.res.spectrum.com. [76.182.20.124]) by smtp.gmail.com with ESMTPSA id er7-20020a05622a5e8700b004317485a4e9sm1042020qtb.66.2024.04.05.12.56.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Apr 2024 12:56:25 -0700 (PDT) From: Josef Bacik To: fstests@vger.kernel.org, linux-btrfs@vger.kernel.org, kernel-team@fb.com Subject: [PATCH v2 2/3] fstests: change how we test for supported raid configs Date: Fri, 5 Apr 2024 15:56:13 -0400 Message-ID: <86703e27bdb8c49950be6ea65ac228ece3ecc315.1712346845.git.josef@toxicpanda.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-btrfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In btrfs there's a few ways we limit the RAID profiles we'll use. We have the raid56 feature that can be compiled out, zoned devices don't support certain raid configurations, and you can manually set BTRFS_PROFILE_CONFIGS to limit what you're testing. To handle all of these different scenarios in the same way, update _btrfs_get_profile_configs() to check for RAID56 support and remove it if it is not there, and then add _require_btrfs_raid_type and _check_btrfs_raid_type to get all the settings and then check if the requested raid type is available. From there I've updated all of the existing tests that use _require_btrfs_fs_feature raid56 to use _require_btrfs_raid_type where appropriate. Signed-off-by: Josef Bacik Reviewed-by: Anand Jain --- common/btrfs | 29 ++++++++++++++++++++++++----- tests/btrfs/125 | 2 +- tests/btrfs/148 | 3 ++- tests/btrfs/157 | 2 +- tests/btrfs/158 | 2 +- 5 files changed, 29 insertions(+), 9 deletions(-) diff --git a/common/btrfs b/common/btrfs index e1b29c61..845d01ea 100644 --- a/common/btrfs +++ b/common/btrfs @@ -98,11 +98,6 @@ _require_btrfs_fs_feature() modprobe btrfs > /dev/null 2>&1 [ -e /sys/fs/btrfs/features/$feat ] || \ _notrun "Feature $feat not supported by the available btrfs version" - - if [ $feat = "raid56" ]; then - # Zoned btrfs only supports SINGLE profile - _require_non_zoned_device "${SCRATCH_DEV}" - fi } _require_btrfs_fs_sysfs() @@ -218,6 +213,8 @@ _btrfs_get_profile_configs() return fi + modprobe btrfs > /dev/null 2>&1 + local unsupported=() if [ "$1" == "replace" ]; then # We can't do replace with these profiles because they @@ -237,6 +234,14 @@ _btrfs_get_profile_configs() ) fi + if [ ! -e /sys/fs/btrfs/features/raid56 ]; then + # We don't have raid56 compiled in, remove them + unsupported+=( + "raid5" + "raid6" + ) + fi + if _scratch_btrfs_is_zoned; then # Zoned btrfs only supports SINGLE profile unsupported+=( @@ -792,3 +797,17 @@ _has_btrfs_sysfs_feature_attr() test -e /sys/fs/btrfs/features/$feature_attr } + +_check_btrfs_raid_type() +{ + _btrfs_get_profile_configs + if [[ ! "${_btrfs_profile_configs[@]}" =~ "$1" ]]; then + return 1 + fi + return 0 +} + +_require_btrfs_raid_type() +{ + _check_btrfs_raid_type $1 || _notrun "$1 isn't supported by the profile config" +} diff --git a/tests/btrfs/125 b/tests/btrfs/125 index 1b6e5d78..d957c139 100755 --- a/tests/btrfs/125 +++ b/tests/btrfs/125 @@ -41,7 +41,7 @@ _supported_fs btrfs _require_scratch_dev_pool 3 _test_unmount _require_btrfs_forget_or_module_loadable -_require_btrfs_fs_feature raid56 +_require_btrfs_raid_type raid5 _scratch_dev_pool_get 3 diff --git a/tests/btrfs/148 b/tests/btrfs/148 index 65a26292..9bbcd8e9 100755 --- a/tests/btrfs/148 +++ b/tests/btrfs/148 @@ -17,7 +17,8 @@ _supported_fs btrfs _require_scratch _require_scratch_dev_pool 4 _require_odirect -_require_btrfs_fs_feature raid56 +_require_btrfs_raid_type raid5 +_require_btrfs_raid_type raid6 _scratch_dev_pool_get 4 diff --git a/tests/btrfs/157 b/tests/btrfs/157 index 022db511..8441a786 100755 --- a/tests/btrfs/157 +++ b/tests/btrfs/157 @@ -32,7 +32,7 @@ _begin_fstest auto quick raid read_repair _supported_fs btrfs _require_scratch_dev_pool 4 _require_btrfs_command inspect-internal dump-tree -_require_btrfs_fs_feature raid56 +_require_btrfs_raid_type raid6 get_physical() { diff --git a/tests/btrfs/158 b/tests/btrfs/158 index aa85835a..cd4f604c 100755 --- a/tests/btrfs/158 +++ b/tests/btrfs/158 @@ -24,7 +24,7 @@ _begin_fstest auto quick raid scrub _supported_fs btrfs _require_scratch_dev_pool 4 _require_btrfs_command inspect-internal dump-tree -_require_btrfs_fs_feature raid56 +_require_btrfs_raid_type raid5 get_physical() { From patchwork Fri Apr 5 19:56:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 13619375 Received: from mail-qv1-f53.google.com (mail-qv1-f53.google.com [209.85.219.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8A00A17334D for ; Fri, 5 Apr 2024 19:56:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712346990; cv=none; b=ufgIU5PNB3NCSyI1oamISHCG5XCqvPcUzmfFrk/c68if6nTLPJO6xosNXKHZLt+TCgeYMz56L0T2z3UIMC2tonUXgPWplLbacBntgZF0dzqEjGrDArnAAxOOcsNFHkJFKFOiOupF1uDjPEyRazver9hR1aMYUr0LzlEB//ivTug= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712346990; c=relaxed/simple; bh=aPbMiZOwI+NGFueUpLxHWqQ6gUxj9pl36zsDIuOZjOE=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GA8AKfA4tnRC/MUN2rJkpuC+0lNS+P9ttMfNLyQ9KZI8S1kukekaDIC4GbT+GWEOnOHlh1ZBWG6SF4J9fD2Z/w93X3lnJj4wVmx8IRWI5j071s4SvjEpYg0m2Ndv/xF+50AKne3WRUiIJ3RFMfWSpwTuW7XOVr4CC06Bzq8Wbos= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=toxicpanda.com; spf=none smtp.mailfrom=toxicpanda.com; dkim=pass (2048-bit key) header.d=toxicpanda-com.20230601.gappssmtp.com header.i=@toxicpanda-com.20230601.gappssmtp.com header.b=I9RP21k1; arc=none smtp.client-ip=209.85.219.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=toxicpanda.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=toxicpanda.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=toxicpanda-com.20230601.gappssmtp.com header.i=@toxicpanda-com.20230601.gappssmtp.com header.b="I9RP21k1" Received: by mail-qv1-f53.google.com with SMTP id 6a1803df08f44-69938e2b71dso9072946d6.0 for ; Fri, 05 Apr 2024 12:56:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toxicpanda-com.20230601.gappssmtp.com; s=20230601; t=1712346987; x=1712951787; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=zBF7VbLO1AdTYvcpdTi26pAOfpXqNacAoJuOltaVhbM=; b=I9RP21k10SpPo10TiRLq7Bp1TTUrkQ8VFVOuUf5iNrgdExx2ewESSOXPYyacY6dOFR xbj4gg+mqUfhcc+boSb25AvixZBfnlx2OeYYYankpcMmNTQq0LGb8dYSLf7faAoTPmpq 79fFLNwvgI4J4yWUBJq4Wg+m9eJcMbSdJP28Cpg38Ns1Qj9Hky2vOFDgl2kCzudolEyY VnWQJAUHR9fQ2/RJxMkLzm7yxLbCDgQSeKn+bdzgqNBzcPPyF1gMMSGKR4+X4YkBO8eN uMR1D2Dv6pznHjCNpuko+txPxgr6n0b9VFGMHUcS8W/BcPIZOs+VHNC0+3feJvWx3uk2 9qiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712346987; x=1712951787; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zBF7VbLO1AdTYvcpdTi26pAOfpXqNacAoJuOltaVhbM=; b=WCEOnhy7JfKrnKbAXWZr9VzXV5vWkZRF5VYgVfPj7Be6V4KqC6nD9SWkzF7L/hV7zS ArqcJoPpCjR1OoJwUtzqoCRx5VWYu9+3JaZZkoFgsyhtfRh5lOhbiHsGT7+CJlUlJGzX FabUhYs97q2j5R5uAu7G6W1pcMWqfdw3gYTma1nncMy4BXKxS25J0ZZ1LYYJMUI4hfVH QbYoHWvGvfYHMsmuufVwr20RIr8WW7e0gIuwb0MEQK+7+zPDVfI3usagSTCsleaf5Bmn mZngpF2KPW1WHDzRJksqomORsNNHGW/hKyxALccCcNBXoN9lKJJViR3PTZLXISnBn0kR m+zg== X-Forwarded-Encrypted: i=1; AJvYcCWBgBTDESDLm7Dsm+5Bx9NyejFjUawUyJgS3JCJjrAdq1KZ5cMBfzTmaoiFAq1d0lGQYhMH7NjdnRIcHWIg3RTqpM5guXXi6M4Qlko= X-Gm-Message-State: AOJu0Ywi0R9VcFPwxluj98IJsE2H6GrfJLOq4xgDsjWF9z1esRk7ZdEN iYR9O+lLoJsOUpWoAIb0LWcAGYDwK02Q5AB3EVq+4nLNm9A5OAft5ovQLkrE0cA= X-Google-Smtp-Source: AGHT+IFxrZf584DI1C/A2wc+WeyJwP9UAfKJp/q2R1/IghLX6g5qayzXZseqwvI/TbiooPIjePreRw== X-Received: by 2002:a05:6214:c6b:b0:699:322a:e54f with SMTP id t11-20020a0562140c6b00b00699322ae54fmr1819839qvj.59.1712346987229; Fri, 05 Apr 2024 12:56:27 -0700 (PDT) Received: from localhost (076-182-020-124.res.spectrum.com. [76.182.20.124]) by smtp.gmail.com with ESMTPSA id mx9-20020a0562142e0900b00699b99cc0ffsm24774qvb.25.2024.04.05.12.56.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Apr 2024 12:56:26 -0700 (PDT) From: Josef Bacik To: fstests@vger.kernel.org, linux-btrfs@vger.kernel.org, kernel-team@fb.com Subject: [PATCH v2 3/3] fstests: update tests to skip unsupported raid profile types Date: Fri, 5 Apr 2024 15:56:14 -0400 Message-ID: <7111bf50942e0b72a43ceed010d8bab00c712a75.1712346845.git.josef@toxicpanda.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-btrfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Tests btrfs/197, btrfs/198, and btrfs/297 test multiple raid types in their workout() function. We may not support some of the raid types, so add a check in the workout() function to skip any incompatible raid profiles. Signed-off-by: Josef Bacik Reviewed-by: Anand Jain --- tests/btrfs/197 | 10 ++++++++-- tests/btrfs/198 | 10 ++++++++-- tests/btrfs/297 | 10 ++++++++++ 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/tests/btrfs/197 b/tests/btrfs/197 index 2ce41b32..9ec4e9f0 100755 --- a/tests/btrfs/197 +++ b/tests/btrfs/197 @@ -30,14 +30,20 @@ _supported_fs btrfs _require_test _require_scratch _require_scratch_dev_pool 5 -# Zoned btrfs only supports SINGLE profile -_require_non_zoned_device ${SCRATCH_DEV} +# We require at least one raid setup, raid1 is the easiest, use this to gate on +# wether or not we run this test +_require_btrfs_raid_type raid1 workout() { raid=$1 device_nr=$2 + if ! _check_btrfs_raid_type $raid; then + echo "$raid isn't supported, skipping" >> $seqres.full + return + fi + echo $raid >> $seqres.full _scratch_dev_pool_get $device_nr _spare_dev_get diff --git a/tests/btrfs/198 b/tests/btrfs/198 index a326a8ca..c5a8f392 100755 --- a/tests/btrfs/198 +++ b/tests/btrfs/198 @@ -18,8 +18,9 @@ _supported_fs btrfs _require_command "$WIPEFS_PROG" wipefs _require_scratch _require_scratch_dev_pool 4 -# Zoned btrfs only supports SINGLE profile -_require_non_zoned_device ${SCRATCH_DEV} +# We require at least one raid setup, raid1 is the easiest, use this to gate on +# wether or not we run this test +_require_btrfs_raid_type raid1 _fixed_by_kernel_commit 96c2e067ed3e3e \ "btrfs: skip devices without magic signature when mounting" @@ -28,6 +29,11 @@ workout() raid=$1 device_nr=$2 + if ! _check_btrfs_raid_type $raid; then + echo "$raid isn't supported, skipping" >> $seqres.full + return + fi + echo $raid >> $seqres.full _scratch_dev_pool_get $device_nr diff --git a/tests/btrfs/297 b/tests/btrfs/297 index a0023861..7afe854d 100755 --- a/tests/btrfs/297 +++ b/tests/btrfs/297 @@ -18,11 +18,21 @@ _require_scratch_dev_pool 3 _fixed_by_kernel_commit 486c737f7fdc \ "btrfs: raid56: always verify the P/Q contents for scrub" +# If neither raid5 or raid6 are supported do _notrun +if ! _check_btrfs_raid_type raid5 && ! _check_btrfs_raid_type raid6; then + _notrun "requires either raid5 or raid6 support" +fi + workload() { local profile=$1 local nr_devs=$2 + if ! _check_btrfs_raid_type $profile; then + echo "$profile isn't supported, skipping" >> $seqres.full + return + fi + echo "=== Testing $nr_devs devices $profile ===" >> $seqres.full _scratch_dev_pool_get $nr_devs