public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] progs: tests: Avoid multidevice test on 32bit platforms
@ 2020-02-15 23:28 Marcos Paulo de Souza
  2020-02-24  5:52 ` Qu Wenruo
  0 siblings, 1 reply; 2+ messages in thread
From: Marcos Paulo de Souza @ 2020-02-15 23:28 UTC (permalink / raw)
  To: linux-btrfs, dsterba; +Cc: Marcos Paulo de Souza

From: Marcos Paulo de Souza <mpdesouza@suse.com>

This test uses truncate utility to create a 6E file but this fails
currently fails for PPC32[1], but it will also fail to other 32bit
platforms, so skip this test in these platforms.

[1]: https://github.com/kdave/btrfs-progs/issues/192

Signed-off-by: Marcos Paulo de Souza <mpdesouza@suse.com>
---

 I couldn't find a way to make truncate to use O_LARGEFILE option. I though even
 to write a helper to open the file using this flag and later on call ftruncate,
 but isn't it one more helper to maintain?

 If there are better ideas to avoid skipping this test, please let me know!

 tests/common                                      | 15 +++++++++++++++
 tests/mkfs-tests/018-multidevice-overflow/test.sh |  1 +
 2 files changed, 16 insertions(+)

diff --git a/tests/common b/tests/common
index 605cf72c..9aa69a1a 100644
--- a/tests/common
+++ b/tests/common
@@ -580,6 +580,21 @@ check_min_kernel_version()
 	return 0
 }
 
+check_32bit_machine()
+{
+	local msg
+
+	msg="$1"
+	if [ -z "$msg" ]; then
+		msg="Skipping test on 32bit machines"
+	fi
+
+	long_bit=$(getconf LONG_BIT)
+	if [ $long_bit -eq 32 ]; then
+		_not_run "$msg"
+	fi
+}
+
 # how many files to create.
 DATASET_SIZE=50
 
diff --git a/tests/mkfs-tests/018-multidevice-overflow/test.sh b/tests/mkfs-tests/018-multidevice-overflow/test.sh
index 6c2f4dba..8bb3d5a9 100755
--- a/tests/mkfs-tests/018-multidevice-overflow/test.sh
+++ b/tests/mkfs-tests/018-multidevice-overflow/test.sh
@@ -5,6 +5,7 @@ source "$TEST_TOP/common"
 
 check_prereq mkfs.btrfs
 check_prereq btrfs
+check_32bit_machine "32bit machines can't handle 6E file sizes"
 
 setup_root_helper
 prepare_test_dev
-- 
2.24.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] progs: tests: Avoid multidevice test on 32bit platforms
  2020-02-15 23:28 [PATCH] progs: tests: Avoid multidevice test on 32bit platforms Marcos Paulo de Souza
@ 2020-02-24  5:52 ` Qu Wenruo
  0 siblings, 0 replies; 2+ messages in thread
From: Qu Wenruo @ 2020-02-24  5:52 UTC (permalink / raw)
  To: Marcos Paulo de Souza, linux-btrfs, dsterba; +Cc: Marcos Paulo de Souza


[-- Attachment #1.1: Type: text/plain, Size: 2148 bytes --]



On 2020/2/16 上午7:28, Marcos Paulo de Souza wrote:
> From: Marcos Paulo de Souza <mpdesouza@suse.com>
> 
> This test uses truncate utility to create a 6E file but this fails
> currently fails for PPC32[1], but it will also fail to other 32bit
> platforms, so skip this test in these platforms.
> 
> [1]: https://github.com/kdave/btrfs-progs/issues/192
> 
> Signed-off-by: Marcos Paulo de Souza <mpdesouza@suse.com>
> ---
> 
>  I couldn't find a way to make truncate to use O_LARGEFILE option. I though even
>  to write a helper to open the file using this flag and later on call ftruncate,
>  but isn't it one more helper to maintain?
> 
>  If there are better ideas to avoid skipping this test, please let me know!

What about testing the first 6E file allocation?

If the first failed, then it means the system can't handle, and we skip
the test.

Skipping the whole 32bit systems looks overkilled to me.

Thanks,
Qu

> 
>  tests/common                                      | 15 +++++++++++++++
>  tests/mkfs-tests/018-multidevice-overflow/test.sh |  1 +
>  2 files changed, 16 insertions(+)
> 
> diff --git a/tests/common b/tests/common
> index 605cf72c..9aa69a1a 100644
> --- a/tests/common
> +++ b/tests/common
> @@ -580,6 +580,21 @@ check_min_kernel_version()
>  	return 0
>  }
>  
> +check_32bit_machine()
> +{
> +	local msg
> +
> +	msg="$1"
> +	if [ -z "$msg" ]; then
> +		msg="Skipping test on 32bit machines"
> +	fi
> +
> +	long_bit=$(getconf LONG_BIT)
> +	if [ $long_bit -eq 32 ]; then
> +		_not_run "$msg"
> +	fi
> +}
> +
>  # how many files to create.
>  DATASET_SIZE=50
>  
> diff --git a/tests/mkfs-tests/018-multidevice-overflow/test.sh b/tests/mkfs-tests/018-multidevice-overflow/test.sh
> index 6c2f4dba..8bb3d5a9 100755
> --- a/tests/mkfs-tests/018-multidevice-overflow/test.sh
> +++ b/tests/mkfs-tests/018-multidevice-overflow/test.sh
> @@ -5,6 +5,7 @@ source "$TEST_TOP/common"
>  
>  check_prereq mkfs.btrfs
>  check_prereq btrfs
> +check_32bit_machine "32bit machines can't handle 6E file sizes"
>  
>  setup_root_helper
>  prepare_test_dev
> 


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-02-24  5:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-02-15 23:28 [PATCH] progs: tests: Avoid multidevice test on 32bit platforms Marcos Paulo de Souza
2020-02-24  5:52 ` Qu Wenruo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox