]>
git.proxmox.com Git - mirror_zfs-debian.git/blob - tests/zfs-tests/tests/functional/cp_files/cp_files_001_pos.ksh
5 # The contents of this file are subject to the terms of the
6 # Common Development and Distribution License (the "License").
7 # You may not use this file except in compliance with the License.
9 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 # or http://www.opensolaris.org/os/licensing.
11 # See the License for the specific language governing permissions
12 # and limitations under the License.
14 # When distributing Covered Code, include this CDDL HEADER in each
15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 # If applicable, add the following below this CDDL HEADER, with the
17 # fields enclosed by brackets "[]" replaced with your own identifying
18 # information: Portions Copyright [yyyy] [name of copyright owner]
24 # Copyright (c) 2018 by Nutanix. All rights reserved.
27 .
$STF_SUITE/include
/libtest.shlib
31 # Copy a large number of files between 2 directories
32 # within a zfs filesystem works without errors.
33 # This make sure zap upgrading and expanding works.
37 # 1. Create NR_FILES files in directory src
38 # 2. Check the number of files is correct
39 # 3. Copy files from src to dst in readdir order
40 # 4. Check the number of files is correct
43 verify_runnable
"global"
47 rm -rf $TESTDIR/src
$TESTDIR/dst
50 log_assert
"Copy a large number of files between 2 directories" \
51 "within a zfs filesystem works without errors"
58 log_must mkdir
$TESTDIR/src
59 log_must mkdir
$TESTDIR/dst
63 # create NR_FILES in BATCH at a time to prevent overflowing argument buffer
64 for i
in $
(seq $
(($NR_FILES/$BATCH))); do touch $
(seq $
((($i-1)*$BATCH+1)) $
(($i*$BATCH))); done
67 log_must
test $NR_FILES -eq $
(ls -U $TESTDIR/src |
wc -l)
69 # copy files from src to dst, use cp_files to make sure we copy in readdir order
70 log_must
$STF_SUITE/tests
/functional
/cp_files
/cp_files
$TESTDIR/src
$TESTDIR/dst
72 log_must
test $NR_FILES -eq $
(ls -U $TESTDIR/dst |
wc -l)