* [PATCH 0/3] Adapt some tests to ChromeOS
@ 2018-11-27 21:43 Gwendal Grignou
2018-11-27 21:43 ` [PATCH 1/3] generic: workaround device where glibc is not installed Gwendal Grignou
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: Gwendal Grignou @ 2018-11-27 21:43 UTC (permalink / raw)
To: guaneryu; +Cc: fstests
When running xfstests on ChromeOS, some were failing for spurious
reasons:
- getconf not present on the test system because glibc is not installed.
- ftruncate want to allocate a file bigger than the partition.
- Attribute selinux.security in the way of testing xattr.
Gwendal Grignou (3):
generic: workaround device where glibc is not installed
ext4: 032: fail nicely if the test partition is not big enough for the
test
generic: exclude selinux xattr form being considered
common/config | 18 ++++++++++++++++++
common/filter | 1 +
common/rc | 6 ------
tests/btrfs/053 | 2 +-
tests/ext4/032 | 11 ++++++++++-
tests/generic/062 | 2 +-
tests/generic/205 | 2 +-
tests/generic/206 | 2 +-
tests/generic/216 | 2 +-
tests/generic/217 | 2 +-
tests/generic/218 | 2 +-
tests/generic/220 | 2 +-
tests/generic/222 | 2 +-
tests/generic/227 | 2 +-
tests/generic/229 | 2 +-
tests/generic/238 | 2 +-
tests/generic/349 | 6 +++---
tests/generic/350 | 6 +++---
tests/generic/351 | 6 +++---
tests/generic/377 | 2 +-
20 files changed, 51 insertions(+), 29 deletions(-)
--
2.18.1
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 1/3] generic: workaround device where glibc is not installed
2018-11-27 21:43 [PATCH 0/3] Adapt some tests to ChromeOS Gwendal Grignou
@ 2018-11-27 21:43 ` Gwendal Grignou
2018-11-28 3:30 ` Eryu Guan
2018-11-27 21:43 ` [PATCH 2/3] ext4: 032: fail nicely if the test partition is not big enough for the test Gwendal Grignou
2018-11-27 21:43 ` [PATCH 3/3] generic: exclude selinux xattr form being considered Gwendal Grignou
2 siblings, 1 reply; 9+ messages in thread
From: Gwendal Grignou @ 2018-11-27 21:43 UTC (permalink / raw)
To: guaneryu; +Cc: fstests
Some tests needs page size and long size, provided by getconf.
On systems where getconf is not installed, guess with default values.
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
---
common/config | 18 ++++++++++++++++++
common/rc | 6 ------
tests/btrfs/053 | 2 +-
tests/generic/205 | 2 +-
tests/generic/206 | 2 +-
tests/generic/216 | 2 +-
tests/generic/217 | 2 +-
tests/generic/218 | 2 +-
tests/generic/220 | 2 +-
tests/generic/222 | 2 +-
tests/generic/227 | 2 +-
tests/generic/229 | 2 +-
tests/generic/238 | 2 +-
tests/generic/349 | 6 +++---
tests/generic/350 | 6 +++---
tests/generic/351 | 6 +++---
16 files changed, 38 insertions(+), 26 deletions(-)
diff --git a/common/config b/common/config
index 8a5a6e08..e7a83c3c 100644
--- a/common/config
+++ b/common/config
@@ -718,6 +718,24 @@ get_next_config() {
fi
}
+# Workaround systems where glibc is not installed.
+GETCONF=$(which getconf 2> /dev/null) || GETCONF=
+get_page_size() {
+ if [ -z "$GETCONF" ]; then
+ echo "4096"
+ else
+ "$GETCONF" PAGE_SIZE
+ fi
+}
+
+get_long_bit() {
+ if [ -z "$GETCONF" ]; then
+ echo "64"
+ else
+ "$GETCONF" LONG_BIT
+ fi
+}
+
if [ -z "$CONFIG_INCLUDED" ]; then
get_next_config `echo $HOST_OPTIONS_SECTIONS | cut -f1 -d" "`
export CONFIG_INCLUDED=true
diff --git a/common/rc b/common/rc
index be1ed68c..992cb3cc 100644
--- a/common/rc
+++ b/common/rc
@@ -3686,12 +3686,6 @@ _get_block_size()
stat -f -c %S $1
}
-get_page_size()
-{
- echo $(getconf PAGE_SIZE)
-}
-
-
run_fsx()
{
echo fsx $@
diff --git a/tests/btrfs/053 b/tests/btrfs/053
index 16656fa8..2c206e2a 100755
--- a/tests/btrfs/053
+++ b/tests/btrfs/053
@@ -43,7 +43,7 @@ _require_attrs
# max(16384, PAGE_SIZE) is the default leaf/node size on btrfs-progs v3.12+.
# Older versions just use max(4096, PAGE_SIZE).
# mkfs.btrfs can't create an fs with a leaf/node size smaller than PAGE_SIZE.
-leaf_size=$(echo -e "16384\n`getconf PAGE_SIZE`" | sort -nr | head -1)
+leaf_size=$(echo -e "16384\n`get_page_size`" | sort -nr | head -1)
send_files_dir=$TEST_DIR/btrfs-test-$seq
diff --git a/tests/generic/205 b/tests/generic/205
index 53aa1abb..3acd3a28 100755
--- a/tests/generic/205
+++ b/tests/generic/205
@@ -36,7 +36,7 @@ _require_scratch_reflink
rm -f $seqres.full
-pagesz=$(getconf PAGE_SIZE)
+pagesz=$(get_page_size)
blksz=$((pagesz / 4))
echo "Format and mount"
diff --git a/tests/generic/206 b/tests/generic/206
index 9c933657..431e3320 100755
--- a/tests/generic/206
+++ b/tests/generic/206
@@ -37,7 +37,7 @@ _require_odirect
rm -f $seqres.full
-pagesz=$(getconf PAGE_SIZE)
+pagesz=$(get_page_size)
blksz=$((pagesz / 4))
echo "Format and mount"
diff --git a/tests/generic/216 b/tests/generic/216
index abf664d6..16a48aa3 100755
--- a/tests/generic/216
+++ b/tests/generic/216
@@ -37,7 +37,7 @@ _require_xfs_io_command "falloc"
rm -f $seqres.full
-pagesz=$(getconf PAGE_SIZE)
+pagesz=$(get_page_size)
blksz=$((pagesz / 4))
echo "Format and mount"
diff --git a/tests/generic/217 b/tests/generic/217
index dda6ec7a..fc07c8ea 100755
--- a/tests/generic/217
+++ b/tests/generic/217
@@ -38,7 +38,7 @@ _require_odirect
rm -f $seqres.full
-pagesz=$(getconf PAGE_SIZE)
+pagesz=$(get_page_size)
blksz=$((pagesz / 4))
echo "Format and mount"
diff --git a/tests/generic/218 b/tests/generic/218
index 7ed74724..fbba706b 100755
--- a/tests/generic/218
+++ b/tests/generic/218
@@ -37,7 +37,7 @@ _require_xfs_io_command "falloc"
rm -f $seqres.full
-pagesz=$(getconf PAGE_SIZE)
+pagesz=$(get_page_size)
blksz=$((pagesz / 4))
echo "Format and mount"
diff --git a/tests/generic/220 b/tests/generic/220
index fdee86d8..f6a35290 100755
--- a/tests/generic/220
+++ b/tests/generic/220
@@ -38,7 +38,7 @@ _require_odirect
rm -f $seqres.full
-pagesz=$(getconf PAGE_SIZE)
+pagesz=$(get_page_size)
blksz=$((pagesz / 4))
echo "Format and mount"
diff --git a/tests/generic/222 b/tests/generic/222
index 06d88ff5..357f453a 100755
--- a/tests/generic/222
+++ b/tests/generic/222
@@ -37,7 +37,7 @@ _require_xfs_io_command "falloc"
rm -f $seqres.full
-pagesz=$(getconf PAGE_SIZE)
+pagesz=$(get_page_size)
blksz=$((pagesz / 4))
echo "Format and mount"
diff --git a/tests/generic/227 b/tests/generic/227
index 457b5a48..52b41ba2 100755
--- a/tests/generic/227
+++ b/tests/generic/227
@@ -38,7 +38,7 @@ _require_odirect
rm -f $seqres.full
-pagesz=$(getconf PAGE_SIZE)
+pagesz=$(get_page_size)
blksz=$((pagesz / 4))
echo "Format and mount"
diff --git a/tests/generic/229 b/tests/generic/229
index 9872b295..2b099bdf 100755
--- a/tests/generic/229
+++ b/tests/generic/229
@@ -37,7 +37,7 @@ _require_xfs_io_command "falloc"
rm -f $seqres.full
-pagesz=$(getconf PAGE_SIZE)
+pagesz=$(get_page_size)
blksz=$((pagesz / 4))
echo "Format and mount"
diff --git a/tests/generic/238 b/tests/generic/238
index e8276cc5..fc5d3f49 100755
--- a/tests/generic/238
+++ b/tests/generic/238
@@ -38,7 +38,7 @@ _require_odirect
rm -f $seqres.full
-pagesz=$(getconf PAGE_SIZE)
+pagesz=$(get_page_size)
blksz=$((pagesz / 4))
echo "Format and mount"
diff --git a/tests/generic/349 b/tests/generic/349
index f01f817d..9084bf56 100755
--- a/tests/generic/349
+++ b/tests/generic/349
@@ -50,15 +50,15 @@ md5sum $dev | sed -e "s|$dev|SCSI_DEBUG_DEV|g"
echo "Zero range to MAX_LFS_FILESIZE"
# zod = MAX_LFS_FILESIZE
-case "$(getconf LONG_BIT)" in
+case "$(get_long_bit)" in
"32")
- zod=$(( ($(getconf PAGE_SIZE) << ($(getconf LONG_BIT) - 1) ) - 1))
+ zod=$(( ($(get_page_size) << ($(get_long_bit) - 1) ) - 1))
;;
"64")
zod=9223372036854775807
;;
*)
- _fail "sizeof(long) == $(getconf LONG_BIT)?"
+ _fail "sizeof(long) == $(get_long_bit)?"
;;
esac
$XFS_IO_PROG -c "fzero -k 0 $zod" $dev
diff --git a/tests/generic/350 b/tests/generic/350
index 0aea4c09..b4d30a57 100755
--- a/tests/generic/350
+++ b/tests/generic/350
@@ -47,15 +47,15 @@ md5sum $dev | sed -e "s|$dev|SCSI_DEBUG_DEV|g"
echo "Punch to MAX_LFS_FILESIZE"
# zod = MAX_LFS_FILESIZE
-case "$(getconf LONG_BIT)" in
+case "$(get_long_bit)" in
"32")
- zod=$(( ($(getconf PAGE_SIZE) << ($(getconf LONG_BIT) - 1) ) - 1))
+ zod=$(( ($(get_page_size) << ($(get_long_bit) - 1) ) - 1))
;;
"64")
zod=9223372036854775807
;;
*)
- _fail "sizeof(long) == $(getconf LONG_BIT)?"
+ _fail "sizeof(long) == $(get_long_bit)?"
;;
esac
$XFS_IO_PROG -c "fpunch 0 $zod" $dev
diff --git a/tests/generic/351 b/tests/generic/351
index e326dca1..b86b4d58 100755
--- a/tests/generic/351
+++ b/tests/generic/351
@@ -62,15 +62,15 @@ $XFS_IO_PROG -c "fpunch 512 512" $dev
echo "Zero range past MAX_LFS_FILESIZE keep size"
# zod = MAX_LFS_FILESIZE
-case "$(getconf LONG_BIT)" in
+case "$(get_long_bit)" in
"32")
- zod=$(( ($(getconf PAGE_SIZE) << ($(getconf LONG_BIT) - 1) ) - 1))
+ zod=$(( ($(get_page_size) << ($(get_long_bit) - 1) ) - 1))
;;
"64")
zod=9223372036854775807
;;
*)
- _fail "sizeof(long) == $(getconf LONG_BIT)?"
+ _fail "sizeof(long) == $(get_long_bit)?"
;;
esac
$XFS_IO_PROG -c "fzero -k 512k $zod" $dev
--
2.18.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 2/3] ext4: 032: fail nicely if the test partition is not big enough for the test
2018-11-27 21:43 [PATCH 0/3] Adapt some tests to ChromeOS Gwendal Grignou
2018-11-27 21:43 ` [PATCH 1/3] generic: workaround device where glibc is not installed Gwendal Grignou
@ 2018-11-27 21:43 ` Gwendal Grignou
2018-11-28 3:36 ` Eryu Guan
2018-11-27 21:43 ` [PATCH 3/3] generic: exclude selinux xattr form being considered Gwendal Grignou
2 siblings, 1 reply; 9+ messages in thread
From: Gwendal Grignou @ 2018-11-27 21:43 UTC (permalink / raw)
To: guaneryu; +Cc: fstests
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
---
tests/ext4/032 | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/tests/ext4/032 b/tests/ext4/032
index 8534ddd6..7d8c6da7 100755
--- a/tests/ext4/032
+++ b/tests/ext4/032
@@ -35,12 +35,21 @@ ext4_online_resize()
local original_size=$1
local final_size=$2
local check_if_supported=${3:-0}
+ local avail=`df -P $SCRATCH_DIR | awk 'END {print $4}'`
+ local requested=$(($final_size * $BLK_SIZ))
+
+ if [ $avail -lt $requested ]; then
+ echo "+++ not enough space on $SCRATCH_DIR: " \
+ "requested $requested only $avail left" | \
+ tee -a $seqres.full
+ _notrun "incomplete test due to storage space constraint"
+ fi
## Start with a clean image file.
echo "" > ${IMG_FILE}
echo "+++ truncate image file to $final_size" | \
tee -a $seqres.full
- $XFS_IO_PROG -f -c "truncate $(($final_size * $BLK_SIZ))" ${IMG_FILE}
+ $XFS_IO_PROG -f -c "truncate $requested" ${IMG_FILE}
LOOP_DEVICE=`_create_loop_device $IMG_FILE`
echo "+++ create fs on image file $original_size" | \
--
2.18.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 3/3] generic: exclude selinux xattr form being considered
2018-11-27 21:43 [PATCH 0/3] Adapt some tests to ChromeOS Gwendal Grignou
2018-11-27 21:43 ` [PATCH 1/3] generic: workaround device where glibc is not installed Gwendal Grignou
2018-11-27 21:43 ` [PATCH 2/3] ext4: 032: fail nicely if the test partition is not big enough for the test Gwendal Grignou
@ 2018-11-27 21:43 ` Gwendal Grignou
2018-11-28 4:37 ` Eryu Guan
2 siblings, 1 reply; 9+ messages in thread
From: Gwendal Grignou @ 2018-11-27 21:43 UTC (permalink / raw)
To: guaneryu; +Cc: fstests
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
---
common/filter | 1 +
tests/generic/062 | 2 +-
tests/generic/377 | 2 +-
3 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/common/filter b/common/filter
index ed082d24..3ca40431 100644
--- a/common/filter
+++ b/common/filter
@@ -290,6 +290,7 @@ _filter_scratch()
# so substitute SCRATCH_MNT first
sed -e "s,\B$SCRATCH_MNT,SCRATCH_MNT,g" \
-e "s,\B$SCRATCH_DEV,SCRATCH_DEV,g" \
+ -e "/security\.selinux/d" \
-e "/.use_space/d"
}
diff --git a/tests/generic/062 b/tests/generic/062
index 9024af2e..7e79a2dd 100755
--- a/tests/generic/062
+++ b/tests/generic/062
@@ -120,7 +120,7 @@ for nsp in $ATTR_MODES; do
getfattr -m $nsp -e hex -n $nsp.name2 $SCRATCH_MNT/$inode 2>&1 | invalid_attribute_filter
echo "*** final list (strings, type=$inode, nsp=$nsp)"
- getfattr -m '.' -e hex $SCRATCH_MNT/$inode
+ getfattr -m '.' -e hex $SCRATCH_MNT/$inode | grep -ve "security\.selinux"
done
done
diff --git a/tests/generic/377 b/tests/generic/377
index f7835ee8..0ce2cb4b 100755
--- a/tests/generic/377
+++ b/tests/generic/377
@@ -66,7 +66,7 @@ $listxattr $testfile 9
$listxattr $testfile 11
# 6. Calling listxattr with buffersize bigger than needed should succeed.
-$listxattr $testfile 500 | sort
+$listxattr $testfile 500 | grep -ve "security\.selinux" | sort
status=0
exit
--
2.18.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 1/3] generic: workaround device where glibc is not installed
2018-11-27 21:43 ` [PATCH 1/3] generic: workaround device where glibc is not installed Gwendal Grignou
@ 2018-11-28 3:30 ` Eryu Guan
2018-11-29 2:10 ` Dave Chinner
0 siblings, 1 reply; 9+ messages in thread
From: Eryu Guan @ 2018-11-28 3:30 UTC (permalink / raw)
To: Gwendal Grignou; +Cc: fstests
On Tue, Nov 27, 2018 at 01:43:06PM -0800, Gwendal Grignou wrote:
> Some tests needs page size and long size, provided by getconf.
> On systems where getconf is not installed, guess with default values.
>
> Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
> ---
> common/config | 18 ++++++++++++++++++
> common/rc | 6 ------
> tests/btrfs/053 | 2 +-
> tests/generic/205 | 2 +-
> tests/generic/206 | 2 +-
> tests/generic/216 | 2 +-
> tests/generic/217 | 2 +-
> tests/generic/218 | 2 +-
> tests/generic/220 | 2 +-
> tests/generic/222 | 2 +-
> tests/generic/227 | 2 +-
> tests/generic/229 | 2 +-
> tests/generic/238 | 2 +-
> tests/generic/349 | 6 +++---
> tests/generic/350 | 6 +++---
> tests/generic/351 | 6 +++---
> 16 files changed, 38 insertions(+), 26 deletions(-)
>
> diff --git a/common/config b/common/config
> index 8a5a6e08..e7a83c3c 100644
> --- a/common/config
> +++ b/common/config
> @@ -718,6 +718,24 @@ get_next_config() {
> fi
> }
>
> +# Workaround systems where glibc is not installed.
> +GETCONF=$(which getconf 2> /dev/null) || GETCONF=
The GETCONF (or GETCONF_PROG is prefered) definition belongs to
common/config along with other FOO_PROG definitions.
> +get_page_size() {
> + if [ -z "$GETCONF" ]; then
> + echo "4096"
> + else
> + "$GETCONF" PAGE_SIZE
> + fi
> +}
> +
> +get_long_bit() {
> + if [ -z "$GETCONF" ]; then
> + echo "64"
> + else
> + "$GETCONF" LONG_BIT
> + fi
> +}
> +
The functions should go to common/rc file.
> if [ -z "$CONFIG_INCLUDED" ]; then
> get_next_config `echo $HOST_OPTIONS_SECTIONS | cut -f1 -d" "`
> export CONFIG_INCLUDED=true
> diff --git a/common/rc b/common/rc
> index be1ed68c..992cb3cc 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -3686,12 +3686,6 @@ _get_block_size()
> stat -f -c %S $1
> }
>
> -get_page_size()
> -{
> - echo $(getconf PAGE_SIZE)
> -}
> -
> -
But I think we could just use "$here/src/feature -s" to get page size in
get_page_size() and "$here/src/feature -w" to get bits per long. But we
need to add
_require_test_program "feature"
to all tests that call get_page_size()/get_long_bit().
And maybe we could rename get_page_size to _get_page_size while we're at
it (perhaps in a separate patch), as it's a global helper function not a
local one.
Thanks,
Eryu
> run_fsx()
> {
> echo fsx $@
> diff --git a/tests/btrfs/053 b/tests/btrfs/053
> index 16656fa8..2c206e2a 100755
> --- a/tests/btrfs/053
> +++ b/tests/btrfs/053
> @@ -43,7 +43,7 @@ _require_attrs
> # max(16384, PAGE_SIZE) is the default leaf/node size on btrfs-progs v3.12+.
> # Older versions just use max(4096, PAGE_SIZE).
> # mkfs.btrfs can't create an fs with a leaf/node size smaller than PAGE_SIZE.
> -leaf_size=$(echo -e "16384\n`getconf PAGE_SIZE`" | sort -nr | head -1)
> +leaf_size=$(echo -e "16384\n`get_page_size`" | sort -nr | head -1)
>
> send_files_dir=$TEST_DIR/btrfs-test-$seq
>
> diff --git a/tests/generic/205 b/tests/generic/205
> index 53aa1abb..3acd3a28 100755
> --- a/tests/generic/205
> +++ b/tests/generic/205
> @@ -36,7 +36,7 @@ _require_scratch_reflink
>
> rm -f $seqres.full
>
> -pagesz=$(getconf PAGE_SIZE)
> +pagesz=$(get_page_size)
> blksz=$((pagesz / 4))
>
> echo "Format and mount"
> diff --git a/tests/generic/206 b/tests/generic/206
> index 9c933657..431e3320 100755
> --- a/tests/generic/206
> +++ b/tests/generic/206
> @@ -37,7 +37,7 @@ _require_odirect
>
> rm -f $seqres.full
>
> -pagesz=$(getconf PAGE_SIZE)
> +pagesz=$(get_page_size)
> blksz=$((pagesz / 4))
>
> echo "Format and mount"
> diff --git a/tests/generic/216 b/tests/generic/216
> index abf664d6..16a48aa3 100755
> --- a/tests/generic/216
> +++ b/tests/generic/216
> @@ -37,7 +37,7 @@ _require_xfs_io_command "falloc"
>
> rm -f $seqres.full
>
> -pagesz=$(getconf PAGE_SIZE)
> +pagesz=$(get_page_size)
> blksz=$((pagesz / 4))
>
> echo "Format and mount"
> diff --git a/tests/generic/217 b/tests/generic/217
> index dda6ec7a..fc07c8ea 100755
> --- a/tests/generic/217
> +++ b/tests/generic/217
> @@ -38,7 +38,7 @@ _require_odirect
>
> rm -f $seqres.full
>
> -pagesz=$(getconf PAGE_SIZE)
> +pagesz=$(get_page_size)
> blksz=$((pagesz / 4))
>
> echo "Format and mount"
> diff --git a/tests/generic/218 b/tests/generic/218
> index 7ed74724..fbba706b 100755
> --- a/tests/generic/218
> +++ b/tests/generic/218
> @@ -37,7 +37,7 @@ _require_xfs_io_command "falloc"
>
> rm -f $seqres.full
>
> -pagesz=$(getconf PAGE_SIZE)
> +pagesz=$(get_page_size)
> blksz=$((pagesz / 4))
>
> echo "Format and mount"
> diff --git a/tests/generic/220 b/tests/generic/220
> index fdee86d8..f6a35290 100755
> --- a/tests/generic/220
> +++ b/tests/generic/220
> @@ -38,7 +38,7 @@ _require_odirect
>
> rm -f $seqres.full
>
> -pagesz=$(getconf PAGE_SIZE)
> +pagesz=$(get_page_size)
> blksz=$((pagesz / 4))
>
> echo "Format and mount"
> diff --git a/tests/generic/222 b/tests/generic/222
> index 06d88ff5..357f453a 100755
> --- a/tests/generic/222
> +++ b/tests/generic/222
> @@ -37,7 +37,7 @@ _require_xfs_io_command "falloc"
>
> rm -f $seqres.full
>
> -pagesz=$(getconf PAGE_SIZE)
> +pagesz=$(get_page_size)
> blksz=$((pagesz / 4))
>
> echo "Format and mount"
> diff --git a/tests/generic/227 b/tests/generic/227
> index 457b5a48..52b41ba2 100755
> --- a/tests/generic/227
> +++ b/tests/generic/227
> @@ -38,7 +38,7 @@ _require_odirect
>
> rm -f $seqres.full
>
> -pagesz=$(getconf PAGE_SIZE)
> +pagesz=$(get_page_size)
> blksz=$((pagesz / 4))
>
> echo "Format and mount"
> diff --git a/tests/generic/229 b/tests/generic/229
> index 9872b295..2b099bdf 100755
> --- a/tests/generic/229
> +++ b/tests/generic/229
> @@ -37,7 +37,7 @@ _require_xfs_io_command "falloc"
>
> rm -f $seqres.full
>
> -pagesz=$(getconf PAGE_SIZE)
> +pagesz=$(get_page_size)
> blksz=$((pagesz / 4))
>
> echo "Format and mount"
> diff --git a/tests/generic/238 b/tests/generic/238
> index e8276cc5..fc5d3f49 100755
> --- a/tests/generic/238
> +++ b/tests/generic/238
> @@ -38,7 +38,7 @@ _require_odirect
>
> rm -f $seqres.full
>
> -pagesz=$(getconf PAGE_SIZE)
> +pagesz=$(get_page_size)
> blksz=$((pagesz / 4))
>
> echo "Format and mount"
> diff --git a/tests/generic/349 b/tests/generic/349
> index f01f817d..9084bf56 100755
> --- a/tests/generic/349
> +++ b/tests/generic/349
> @@ -50,15 +50,15 @@ md5sum $dev | sed -e "s|$dev|SCSI_DEBUG_DEV|g"
>
> echo "Zero range to MAX_LFS_FILESIZE"
> # zod = MAX_LFS_FILESIZE
> -case "$(getconf LONG_BIT)" in
> +case "$(get_long_bit)" in
> "32")
> - zod=$(( ($(getconf PAGE_SIZE) << ($(getconf LONG_BIT) - 1) ) - 1))
> + zod=$(( ($(get_page_size) << ($(get_long_bit) - 1) ) - 1))
> ;;
> "64")
> zod=9223372036854775807
> ;;
> *)
> - _fail "sizeof(long) == $(getconf LONG_BIT)?"
> + _fail "sizeof(long) == $(get_long_bit)?"
> ;;
> esac
> $XFS_IO_PROG -c "fzero -k 0 $zod" $dev
> diff --git a/tests/generic/350 b/tests/generic/350
> index 0aea4c09..b4d30a57 100755
> --- a/tests/generic/350
> +++ b/tests/generic/350
> @@ -47,15 +47,15 @@ md5sum $dev | sed -e "s|$dev|SCSI_DEBUG_DEV|g"
>
> echo "Punch to MAX_LFS_FILESIZE"
> # zod = MAX_LFS_FILESIZE
> -case "$(getconf LONG_BIT)" in
> +case "$(get_long_bit)" in
> "32")
> - zod=$(( ($(getconf PAGE_SIZE) << ($(getconf LONG_BIT) - 1) ) - 1))
> + zod=$(( ($(get_page_size) << ($(get_long_bit) - 1) ) - 1))
> ;;
> "64")
> zod=9223372036854775807
> ;;
> *)
> - _fail "sizeof(long) == $(getconf LONG_BIT)?"
> + _fail "sizeof(long) == $(get_long_bit)?"
> ;;
> esac
> $XFS_IO_PROG -c "fpunch 0 $zod" $dev
> diff --git a/tests/generic/351 b/tests/generic/351
> index e326dca1..b86b4d58 100755
> --- a/tests/generic/351
> +++ b/tests/generic/351
> @@ -62,15 +62,15 @@ $XFS_IO_PROG -c "fpunch 512 512" $dev
>
> echo "Zero range past MAX_LFS_FILESIZE keep size"
> # zod = MAX_LFS_FILESIZE
> -case "$(getconf LONG_BIT)" in
> +case "$(get_long_bit)" in
> "32")
> - zod=$(( ($(getconf PAGE_SIZE) << ($(getconf LONG_BIT) - 1) ) - 1))
> + zod=$(( ($(get_page_size) << ($(get_long_bit) - 1) ) - 1))
> ;;
> "64")
> zod=9223372036854775807
> ;;
> *)
> - _fail "sizeof(long) == $(getconf LONG_BIT)?"
> + _fail "sizeof(long) == $(get_long_bit)?"
> ;;
> esac
> $XFS_IO_PROG -c "fzero -k 512k $zod" $dev
> --
> 2.18.1
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 2/3] ext4: 032: fail nicely if the test partition is not big enough for the test
2018-11-27 21:43 ` [PATCH 2/3] ext4: 032: fail nicely if the test partition is not big enough for the test Gwendal Grignou
@ 2018-11-28 3:36 ` Eryu Guan
0 siblings, 0 replies; 9+ messages in thread
From: Eryu Guan @ 2018-11-28 3:36 UTC (permalink / raw)
To: Gwendal Grignou; +Cc: fstests
On Tue, Nov 27, 2018 at 01:43:07PM -0800, Gwendal Grignou wrote:
> Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
> ---
> tests/ext4/032 | 11 ++++++++++-
> 1 file changed, 10 insertions(+), 1 deletion(-)
>
> diff --git a/tests/ext4/032 b/tests/ext4/032
> index 8534ddd6..7d8c6da7 100755
> --- a/tests/ext4/032
> +++ b/tests/ext4/032
> @@ -35,12 +35,21 @@ ext4_online_resize()
> local original_size=$1
> local final_size=$2
> local check_if_supported=${3:-0}
> + local avail=`df -P $SCRATCH_DIR | awk 'END {print $4}'`
> + local requested=$(($final_size * $BLK_SIZ))
> +
> + if [ $avail -lt $requested ]; then
> + echo "+++ not enough space on $SCRATCH_DIR: " \
> + "requested $requested only $avail left" | \
> + tee -a $seqres.full
> + _notrun "incomplete test due to storage space constraint"
> + fi
This doesn't look right to me. We can safely truncate to a very large
file size even if the size is bigger than the free space, it's just a
typical sparse file.
I guess the problem is that your SCRATCH_DEV is too small to hold the
post-resize fs image.
Thanks,
Eryu
>
> ## Start with a clean image file.
> echo "" > ${IMG_FILE}
> echo "+++ truncate image file to $final_size" | \
> tee -a $seqres.full
> - $XFS_IO_PROG -f -c "truncate $(($final_size * $BLK_SIZ))" ${IMG_FILE}
> + $XFS_IO_PROG -f -c "truncate $requested" ${IMG_FILE}
> LOOP_DEVICE=`_create_loop_device $IMG_FILE`
>
> echo "+++ create fs on image file $original_size" | \
> --
> 2.18.1
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 3/3] generic: exclude selinux xattr form being considered
2018-11-27 21:43 ` [PATCH 3/3] generic: exclude selinux xattr form being considered Gwendal Grignou
@ 2018-11-28 4:37 ` Eryu Guan
0 siblings, 0 replies; 9+ messages in thread
From: Eryu Guan @ 2018-11-28 4:37 UTC (permalink / raw)
To: Gwendal Grignou; +Cc: fstests
On Tue, Nov 27, 2018 at 01:43:08PM -0800, Gwendal Grignou wrote:
> Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
I didn't see such failures before, could you please provide more info in
the commit log about the problem? So I can try to reproduce the failure.
> ---
> common/filter | 1 +
> tests/generic/062 | 2 +-
> tests/generic/377 | 2 +-
> 3 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/common/filter b/common/filter
> index ed082d24..3ca40431 100644
> --- a/common/filter
> +++ b/common/filter
> @@ -290,6 +290,7 @@ _filter_scratch()
> # so substitute SCRATCH_MNT first
> sed -e "s,\B$SCRATCH_MNT,SCRATCH_MNT,g" \
> -e "s,\B$SCRATCH_DEV,SCRATCH_DEV,g" \
> + -e "/security\.selinux/d" \
> -e "/.use_space/d"
This doesn't belong to _filter_scratch but to filters that filter xattr.
I want to understand & reproduce the problem so I know where the failure
comes from and think about what the best fix would be.
Thanks,
Eryu
> }
>
> diff --git a/tests/generic/062 b/tests/generic/062
> index 9024af2e..7e79a2dd 100755
> --- a/tests/generic/062
> +++ b/tests/generic/062
> @@ -120,7 +120,7 @@ for nsp in $ATTR_MODES; do
> getfattr -m $nsp -e hex -n $nsp.name2 $SCRATCH_MNT/$inode 2>&1 | invalid_attribute_filter
>
> echo "*** final list (strings, type=$inode, nsp=$nsp)"
> - getfattr -m '.' -e hex $SCRATCH_MNT/$inode
> + getfattr -m '.' -e hex $SCRATCH_MNT/$inode | grep -ve "security\.selinux"
>
> done
> done
> diff --git a/tests/generic/377 b/tests/generic/377
> index f7835ee8..0ce2cb4b 100755
> --- a/tests/generic/377
> +++ b/tests/generic/377
> @@ -66,7 +66,7 @@ $listxattr $testfile 9
> $listxattr $testfile 11
>
> # 6. Calling listxattr with buffersize bigger than needed should succeed.
> -$listxattr $testfile 500 | sort
> +$listxattr $testfile 500 | grep -ve "security\.selinux" | sort
>
> status=0
> exit
> --
> 2.18.1
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/3] generic: workaround device where glibc is not installed
2018-11-28 3:30 ` Eryu Guan
@ 2018-11-29 2:10 ` Dave Chinner
2018-11-30 6:37 ` Eryu Guan
0 siblings, 1 reply; 9+ messages in thread
From: Dave Chinner @ 2018-11-29 2:10 UTC (permalink / raw)
To: Eryu Guan; +Cc: Gwendal Grignou, fstests
On Wed, Nov 28, 2018 at 11:30:39AM +0800, Eryu Guan wrote:
> > export CONFIG_INCLUDED=true
> > diff --git a/common/rc b/common/rc
> > index be1ed68c..992cb3cc 100644
> > --- a/common/rc
> > +++ b/common/rc
> > @@ -3686,12 +3686,6 @@ _get_block_size()
> > stat -f -c %S $1
> > }
> >
> > -get_page_size()
> > -{
> > - echo $(getconf PAGE_SIZE)
> > -}
> > -
> > -
>
> But I think we could just use "$here/src/feature -s" to get page size in
> get_page_size() and "$here/src/feature -w" to get bits per long. But we
> need to add
>
> _require_test_program "feature"
IMO, that is unnecessary. `feature` is test harness infrastructure,
like common/rc and check. If the feature binary does not build then
the test harness is running on a broken platform. IOWs, we shouldn't
be requiring functionality tests for core infrastructure - if the
core infrastructure didn't build, then there's bigger problems that
need to be fixed...
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/3] generic: workaround device where glibc is not installed
2018-11-29 2:10 ` Dave Chinner
@ 2018-11-30 6:37 ` Eryu Guan
0 siblings, 0 replies; 9+ messages in thread
From: Eryu Guan @ 2018-11-30 6:37 UTC (permalink / raw)
To: Dave Chinner; +Cc: Gwendal Grignou, fstests
On Thu, Nov 29, 2018 at 01:10:03PM +1100, Dave Chinner wrote:
> On Wed, Nov 28, 2018 at 11:30:39AM +0800, Eryu Guan wrote:
> > > export CONFIG_INCLUDED=true
> > > diff --git a/common/rc b/common/rc
> > > index be1ed68c..992cb3cc 100644
> > > --- a/common/rc
> > > +++ b/common/rc
> > > @@ -3686,12 +3686,6 @@ _get_block_size()
> > > stat -f -c %S $1
> > > }
> > >
> > > -get_page_size()
> > > -{
> > > - echo $(getconf PAGE_SIZE)
> > > -}
> > > -
> > > -
> >
> > But I think we could just use "$here/src/feature -s" to get page size in
> > get_page_size() and "$here/src/feature -w" to get bits per long. But we
> > need to add
> >
> > _require_test_program "feature"
>
> IMO, that is unnecessary. `feature` is test harness infrastructure,
> like common/rc and check. If the feature binary does not build then
> the test harness is running on a broken platform. IOWs, we shouldn't
> be requiring functionality tests for core infrastructure - if the
> core infrastructure didn't build, then there's bigger problems that
> need to be fixed...
Makes sense. Then it'd be better to require it explicitly in
common/config as what we did to fsstress and xfs_io etc.
Thanks,
Eryu
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2018-11-30 17:46 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-27 21:43 [PATCH 0/3] Adapt some tests to ChromeOS Gwendal Grignou
2018-11-27 21:43 ` [PATCH 1/3] generic: workaround device where glibc is not installed Gwendal Grignou
2018-11-28 3:30 ` Eryu Guan
2018-11-29 2:10 ` Dave Chinner
2018-11-30 6:37 ` Eryu Guan
2018-11-27 21:43 ` [PATCH 2/3] ext4: 032: fail nicely if the test partition is not big enough for the test Gwendal Grignou
2018-11-28 3:36 ` Eryu Guan
2018-11-27 21:43 ` [PATCH 3/3] generic: exclude selinux xattr form being considered Gwendal Grignou
2018-11-28 4:37 ` Eryu Guan
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.