* [PATCH] xfstests: 259: convert to use the _math() function
@ 2011-09-26 21:59 Alex Elder
2011-09-26 22:04 ` Alex Elder
0 siblings, 1 reply; 2+ messages in thread
From: Alex Elder @ 2011-09-26 21:59 UTC (permalink / raw)
To: xfs
Make test 259 a bit more readable by using the new _math() function.
Signed-off-by: Alex Elder <aelder@sgi.com>
---
259 | 17 ++++++-----------
259.out | 12 ++++++------
2 files changed, 12 insertions(+), 17 deletions(-)
Index: b/259
===================================================================
--- a/259
+++ b/259
@@ -43,20 +43,15 @@ trap "_cleanup ; exit \$status" 0 1 2 3
_supported_fs xfs
_supported_os Linux
+_require_math
+
testfile=$TEST_DIR/259.image
# Test various sizes slightly less than 4 TB
-# 4398046511103 = 2^42 - 1
-# 4398046510592 = 2^42 - 512
-# 4398046510080 = 2^42 - 1024
-# 4398046510079 = 2^42 - 1025
-# 4398046509056 = 2^42 - 2048
-# 4398046507008 = 2^42 - 4096
-
-for ddseek in 4398046511103 4398046510592 4398046510080 \
- 4398046510079 4398046509056 4398046507008;
-do
- echo "Trying to make $ddseek B long xfs fs image"
+four_TB=$(_math "2^42")
+for del in 1 512 1024 1025 2048 4096; do
+ ddseek=$(_math "$four_TB - $del")
+ echo "Trying to make (2 TB - $del) B long xfs fs image"
rm -f "$testfile"
dd if=/dev/zero "of=$testfile" bs=1 count=0 seek=$ddseek \
>/dev/null 2>&1 || echo "dd failed"
Index: b/259.out
===================================================================
--- a/259.out
+++ b/259.out
@@ -1,7 +1,7 @@
QA output created by 259
-Trying to make 4398046511103 B long xfs fs image
-Trying to make 4398046510592 B long xfs fs image
-Trying to make 4398046510080 B long xfs fs image
-Trying to make 4398046510079 B long xfs fs image
-Trying to make 4398046509056 B long xfs fs image
-Trying to make 4398046507008 B long xfs fs image
+Trying to make (2 TB - 1) B long xfs fs image
+Trying to make (2 TB - 512) B long xfs fs image
+Trying to make (2 TB - 1024) B long xfs fs image
+Trying to make (2 TB - 1025) B long xfs fs image
+Trying to make (2 TB - 2048) B long xfs fs image
+Trying to make (2 TB - 4096) B long xfs fs image
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] xfstests: 259: convert to use the _math() function
2011-09-26 21:59 [PATCH] xfstests: 259: convert to use the _math() function Alex Elder
@ 2011-09-26 22:04 ` Alex Elder
0 siblings, 0 replies; 2+ messages in thread
From: Alex Elder @ 2011-09-26 22:04 UTC (permalink / raw)
To: xfs
On Mon, 2011-09-26 at 16:59 -0500, Alex Elder wrote:
> Make test 259 a bit more readable by using the new _math() function.
>
> Signed-off-by: Alex Elder <aelder@sgi.com>
Whoops, substitute "4 TB" for "2 TB" everwhere appropriate... -Alex
> ---
> 259 | 17 ++++++-----------
> 259.out | 12 ++++++------
> 2 files changed, 12 insertions(+), 17 deletions(-)
>
> Index: b/259
> ===================================================================
> --- a/259
> +++ b/259
> @@ -43,20 +43,15 @@ trap "_cleanup ; exit \$status" 0 1 2 3
> _supported_fs xfs
> _supported_os Linux
>
> +_require_math
> +
> testfile=$TEST_DIR/259.image
>
> # Test various sizes slightly less than 4 TB
> -# 4398046511103 = 2^42 - 1
> -# 4398046510592 = 2^42 - 512
> -# 4398046510080 = 2^42 - 1024
> -# 4398046510079 = 2^42 - 1025
> -# 4398046509056 = 2^42 - 2048
> -# 4398046507008 = 2^42 - 4096
> -
> -for ddseek in 4398046511103 4398046510592 4398046510080 \
> - 4398046510079 4398046509056 4398046507008;
> -do
> - echo "Trying to make $ddseek B long xfs fs image"
> +four_TB=$(_math "2^42")
> +for del in 1 512 1024 1025 2048 4096; do
> + ddseek=$(_math "$four_TB - $del")
> + echo "Trying to make (2 TB - $del) B long xfs fs image"
> rm -f "$testfile"
> dd if=/dev/zero "of=$testfile" bs=1 count=0 seek=$ddseek \
> >/dev/null 2>&1 || echo "dd failed"
> Index: b/259.out
> ===================================================================
> --- a/259.out
> +++ b/259.out
> @@ -1,7 +1,7 @@
> QA output created by 259
> -Trying to make 4398046511103 B long xfs fs image
> -Trying to make 4398046510592 B long xfs fs image
> -Trying to make 4398046510080 B long xfs fs image
> -Trying to make 4398046510079 B long xfs fs image
> -Trying to make 4398046509056 B long xfs fs image
> -Trying to make 4398046507008 B long xfs fs image
> +Trying to make (2 TB - 1) B long xfs fs image
> +Trying to make (2 TB - 512) B long xfs fs image
> +Trying to make (2 TB - 1024) B long xfs fs image
> +Trying to make (2 TB - 1025) B long xfs fs image
> +Trying to make (2 TB - 2048) B long xfs fs image
> +Trying to make (2 TB - 4096) B long xfs fs image
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-09-26 22:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-26 21:59 [PATCH] xfstests: 259: convert to use the _math() function Alex Elder
2011-09-26 22:04 ` Alex Elder
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox