]>
Commit | Line | Data |
---|---|---|
6bb24f4d BB |
1 | #!/bin/ksh -p |
2 | # | |
3 | # CDDL HEADER START | |
4 | # | |
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. | |
8 | # | |
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. | |
13 | # | |
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] | |
19 | # | |
20 | # CDDL HEADER END | |
21 | # | |
22 | ||
23 | # | |
24 | # Copyright 2007 Sun Microsystems, Inc. All rights reserved. | |
25 | # Use is subject to license terms. | |
26 | # | |
27 | ||
28 | # | |
c1d9abf9 | 29 | # Copyright (c) 2013, 2016 by Delphix. All rights reserved. |
6bb24f4d BB |
30 | # |
31 | ||
32 | . $STF_SUITE/include/libtest.shlib | |
7050a65d | 33 | . $STF_SUITE/tests/functional/write_dirs/write_dirs.cfg |
6bb24f4d BB |
34 | |
35 | # | |
36 | # DESCRIPTION: | |
37 | # Create as many directories with 5000 files each until the file system | |
38 | # is full. The zfs file system should be work well and stable. | |
39 | # | |
40 | # STRATEGY: | |
41 | # 1. Create a pool & dateset | |
42 | # 2. Make directories in the zfs file system | |
43 | # 3. Create 5000 files in each directories | |
44 | # 4. Test case exit when the disk is full | |
45 | # | |
46 | ||
47 | verify_runnable "both" | |
48 | ||
829aaf28 GDN |
49 | if is_32bit; then |
50 | log_unsupported "Test case runs slowly on 32 bit" | |
51 | fi | |
52 | ||
6bb24f4d BB |
53 | function cleanup |
54 | { | |
c1d9abf9 JWK |
55 | for file in `find $TESTDIR -type f`; do |
56 | cat /dev/null > $file | |
6bb24f4d | 57 | done |
c1d9abf9 JWK |
58 | log_must sync |
59 | log_must rm -rf $TESTDIR/* | |
6bb24f4d BB |
60 | } |
61 | ||
62 | typeset -i retval=0 | |
63 | ||
64 | log_assert "Creating directories with 5000 files in each, until file system " \ | |
65 | "is full." | |
66 | ||
67 | log_onexit cleanup | |
68 | ||
69 | typeset -i bytes=8192 | |
70 | typeset -i num_writes=20 | |
71 | typeset -i dirnum=50 | |
72 | typeset -i filenum=5000 | |
73 | ||
74 | fill_fs "" $dirnum $filenum $bytes $num_writes | |
75 | retval=$? | |
76 | if (( retval == 28 )); then | |
77 | log_note "No space left on device." | |
78 | elif (( retval != 0 )); then | |
79 | log_fail "Unexpected exit: $retval" | |
80 | fi | |
81 | ||
82 | log_pass "Create many files in a directory succeeded." |