diff mbox

btrfs-progs: tests: Use --no-same-owner option for tar

Message ID 11005b0b3385117fa772b223513cea16920ec7b9.1441101154.git.zhaolei@cn.fujitsu.com (mailing list archive)
State Accepted
Headers show

Commit Message

Zhaolei Sept. 1, 2015, 10:03 a.m. UTC
Some test failed in my nfs dir:
  ...
    [TEST]   006-bad-root-items
  tar: test.img: Cannot change ownership to uid 1000, gid 1000: Invalid argument
  tar: Exiting with failure status due to previous errors
  failed to extract default_case.tar.xz
  test failed for case 006-bad-root-items

It is because the image file's owner is:
 # tar tvf default_case.tar.xz
 -rw-r--r-- fdmanana/fdmanana 2147483648 2014-10-17 17:59 test.img

And make tar failed in chown in nfs.

It is not a big issue because we don't use nfs commonly, but extract
the image file with ownership of current user will be a better choice.

Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
---
 tests/fsck-tests/006-bad-root-items/test.sh  | 4 ++--
 tests/fsck-tests/012-leaf-corruption/test.sh | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

Comments

David Sterba Sept. 1, 2015, 12:32 p.m. UTC | #1
On Tue, Sep 01, 2015 at 06:03:14PM +0800, Zhao Lei wrote:
> Some test failed in my nfs dir:
>   ...
>     [TEST]   006-bad-root-items
>   tar: test.img: Cannot change ownership to uid 1000, gid 1000: Invalid argument
>   tar: Exiting with failure status due to previous errors
>   failed to extract default_case.tar.xz
>   test failed for case 006-bad-root-items
> 
> It is because the image file's owner is:
>  # tar tvf default_case.tar.xz
>  -rw-r--r-- fdmanana/fdmanana 2147483648 2014-10-17 17:59 test.img
> 
> And make tar failed in chown in nfs.
> 
> It is not a big issue because we don't use nfs commonly, but extract
> the image file with ownership of current user will be a better choice.
> 
> Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>

Applied, thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/tests/fsck-tests/006-bad-root-items/test.sh b/tests/fsck-tests/006-bad-root-items/test.sh
index bfbfcfc..421e225 100755
--- a/tests/fsck-tests/006-bad-root-items/test.sh
+++ b/tests/fsck-tests/006-bad-root-items/test.sh
@@ -3,12 +3,12 @@ 
 source $TOP/tests/common
 
 echo "extracting image default_case.tar.xz" >> $RESULTS
-tar xJf default_case.tar.xz || \
+tar --no-same-owner -xJf default_case.tar.xz || \
 	_fail "failed to extract default_case.tar.xz"
 check_image test.img
 
 echo "extracting image skinny_case.tar.xz" >> $RESULTS
-tar xJf skinny_case.tar.xz || \
+tar --no-same-owner -xJf skinny_case.tar.xz || \
 	_fail "failed to extract skinny_case.tar.xz"
 check_image test.img
 
diff --git a/tests/fsck-tests/012-leaf-corruption/test.sh b/tests/fsck-tests/012-leaf-corruption/test.sh
index a37ceda..6e23145 100755
--- a/tests/fsck-tests/012-leaf-corruption/test.sh
+++ b/tests/fsck-tests/012-leaf-corruption/test.sh
@@ -35,7 +35,7 @@  generate_leaf_corrupt_no_data_ext()
 {
 	dest=$1
 	echo "generating leaf_corrupt_no_data_ext.btrfs-image" >> $RESULTS
-	tar xJf ./no_data_extent.tar.xz || \
+	tar --no-same-owner -xJf ./no_data_extent.tar.xz || \
 		_fail "failed to extract leaf_corrupt_no_data_ext.btrfs-image"
 	$TOP/btrfs-image -r test.img.btrfs-image $dest || \
 		_fail "failed to extract leaf_corrupt_no_data_ext.btrfs-image"