Skip to content
This repository was archived by the owner on Nov 7, 2019. It is now read-only.

Commit fafe9b2

Browse files
jwk404Prakash Surya
authored andcommitted
9004 Some ZFS tests used files removed with 32 bit kernel
Reviewed by: Igor Kozhukhov <igor@dilos.org> Reviewed by: Matthew Ahrens <mahrens@delphix.com> Closes #532
1 parent cb1204e commit fafe9b2

File tree

5 files changed

+19
-15
lines changed

5 files changed

+19
-15
lines changed

usr/src/test/zfs-tests/include/commands.cfg

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#
1111

1212
#
13-
# Copyright (c) 2016 by Delphix. All rights reserved.
13+
# Copyright (c) 2016, 2018 by Delphix. All rights reserved.
1414
#
1515

1616
#
@@ -22,6 +22,7 @@
2222
# and maintenance.
2323
#
2424
export USR_BIN_FILES='awk
25+
base64
2526
basename
2627
bc
2728
bunzip2

usr/src/test/zfs-tests/tests/functional/acl/nontrivial/zfs_acl_cp_002_pos.ksh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#
2727

2828
#
29-
# Copyright (c) 2016 by Delphix. All rights reserved.
29+
# Copyright (c) 2016, 2018 by Delphix. All rights reserved.
3030
#
3131

3232
. $STF_SUITE/tests/functional/acl/acl_common.kshlib
@@ -53,8 +53,7 @@ function cleanup
5353
if datasetexists $TESTPOOL/$TESTFS1; then
5454
log_must zfs destroy -f $TESTPOOL/$TESTFS1
5555
fi
56-
[[ -d $TESTDIR1 ]] && log_must rm -rf $TESTDIR1
57-
[[ -d $TESTDIR ]] && log_must rm -rf $TESTDIR/*
56+
log_must rm -rf $TESTDIR1 $TESTDIR/* $mytestfile
5857
}
5958

6059
log_assert "Verify that 'cp [-p]' supports ZFS ACLs."
@@ -68,7 +67,9 @@ log_must chmod 777 $TESTDIR1
6867

6968
# Define target directory.
7069
dstdir=$TESTDIR1/dstdir.$$
71-
mytestfile=/kernel/drv/zfs
70+
mytestfile=$(mktemp -t file.XXXX)
71+
log_must dd if=/dev/urandom of=$mytestfile bs=1024k count=1
72+
log_must chmod 644 $mytestfile
7273

7374
for user in root $ZFS_ACL_STAFF1; do
7475
# Set the current user

usr/src/test/zfs-tests/tests/functional/acl/nontrivial/zfs_acl_cpio_002_pos.ksh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
#
2929

3030
#
31-
# Copyright (c) 2016 by Delphix. All rights reserved.
31+
# Copyright (c) 2016, 2018 by Delphix. All rights reserved.
3232
#
3333

3434
. $STF_SUITE/tests/functional/acl/acl_common.kshlib
@@ -57,8 +57,7 @@ function cleanup
5757
if (( ${#orig_dir} != 0 )); then
5858
cd $orig_dir
5959
fi
60-
[[ -d $TESTDIR1 ]] && log_must rm -rf $TESTDIR1
61-
[[ -d $TESTDIR ]] && log_must rm -rf $TESTDIR/*
60+
log_must rm -rf $TESTDIR1 $TESTDIR/* $mytestfile
6261
}
6362

6463
log_assert "Verify that 'cpio' command supports to archive ZFS ACLs & xattrs."
@@ -81,7 +80,9 @@ CPIOFILE=cpiofile.$$
8180
file=$TESTFILE0
8281
dir=dir.$$
8382
orig_dir=$PWD
84-
mytestfile=/kernel/drv/zfs
83+
mytestfile=$(mktemp -t file.XXXX)
84+
log_must dd if=/dev/urandom of=$mytestfile bs=1024k count=1
85+
log_must chmod 644 $mytestfile
8586

8687
typeset user
8788
for user in root $ZFS_ACL_STAFF1; do

usr/src/test/zfs-tests/tests/functional/acl/nontrivial/zfs_acl_tar_002_pos.ksh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
#
2929

3030
#
31-
# Copyright (c) 2016 by Delphix. All rights reserved.
31+
# Copyright (c) 2016, 2018 by Delphix. All rights reserved.
3232
#
3333

3434
. $STF_SUITE/tests/functional/acl/acl_common.kshlib
@@ -57,8 +57,7 @@ function cleanup
5757
fi
5858

5959
(( ${#cwd} != 0 )) && cd $cwd
60-
[[ -d $TESTDIR1 ]] && log_must rm -rf $TESTDIR1
61-
[[ -d $TESTDIR/ ]] && log_must rm -rf $TESTDIR/*
60+
log_must rm -rf $TESTDIR1 $TESTDIR/* $mytestfile
6261
}
6362

6463
log_assert "Verify that 'tar' command supports to archive ZFS ACLs & xattrs."
@@ -67,7 +66,9 @@ log_onexit cleanup
6766

6867
set -A ops " A+user:other1:add_file:allow" "A+everyone@:execute:allow" "a-x" \
6968
"777"
70-
mytestfile=/kernel/drv/zfs
69+
mytestfile=$(mktemp -t file.XXXX)
70+
log_must dd if=/dev/urandom of=$mytestfile bs=1024k count=1
71+
log_must chmod 644 $mytestfile
7172

7273
TARFILE=tarfile.$$.tar
7374
cwd=$PWD

usr/src/test/zfs-tests/tests/functional/rsend/send-cD.ksh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#
1313

1414
#
15-
# Copyright (c) 2015 by Delphix. All rights reserved.
15+
# Copyright (c) 2015, 2018 by Delphix. All rights reserved.
1616
#
1717

1818
. $STF_SUITE/tests/functional/rsend/rsend.kshlib
@@ -46,7 +46,7 @@ log_must zfs create -o compress=lz4 $sendfs
4646
log_must zfs create -o compress=lz4 $recvfs
4747
typeset dir=$(get_prop mountpoint $sendfs)
4848
# Don't use write_compressible: we want compressible but undedupable data here.
49-
log_must cp /kernel/genunix $dir/file
49+
log_must eval "dd if=/dev/urandom bs=1024k count=4 | base64 >$dir/file"
5050
log_must zfs snapshot $sendfs@snap0
5151
log_must eval "zfs send -D -c $sendfs@snap0 >$stream0"
5252

0 commit comments

Comments
 (0)