| @@ -1,117 +1,118 @@ | | | @@ -1,117 +1,118 @@ |
1 | # $NetBSD: t_high_ino_big_file.sh,v 1.1 2014/05/10 14:15:25 martin Exp $ | | 1 | # $NetBSD: t_high_ino_big_file.sh,v 1.2 2014/05/15 14:53:05 martin Exp $ |
2 | # | | 2 | # |
3 | # Copyright (c) 2014 The NetBSD Foundation, Inc. | | 3 | # Copyright (c) 2014 The NetBSD Foundation, Inc. |
4 | # All rights reserved. | | 4 | # All rights reserved. |
5 | # | | 5 | # |
6 | # Redistribution and use in source and binary forms, with or without | | 6 | # Redistribution and use in source and binary forms, with or without |
7 | # modification, are permitted provided that the following conditions | | 7 | # modification, are permitted provided that the following conditions |
8 | # are met: | | 8 | # are met: |
9 | # 1. Redistributions of source code must retain the above copyright | | 9 | # 1. Redistributions of source code must retain the above copyright |
10 | # notice, this list of conditions and the following disclaimer. | | 10 | # notice, this list of conditions and the following disclaimer. |
11 | # 2. Redistributions in binary form must reproduce the above copyright | | 11 | # 2. Redistributions in binary form must reproduce the above copyright |
12 | # notice, this list of conditions and the following disclaimer in the | | 12 | # notice, this list of conditions and the following disclaimer in the |
13 | # documentation and/or other materials provided with the distribution. | | 13 | # documentation and/or other materials provided with the distribution. |
14 | # | | 14 | # |
15 | # THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS | | 15 | # THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS |
16 | # ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | | 16 | # ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED |
17 | # TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | | 17 | # TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
18 | # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | | 18 | # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS |
19 | # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | | 19 | # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
20 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | | 20 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
21 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | | 21 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
22 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | | 22 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
23 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | | 23 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
24 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | | 24 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
25 | # POSSIBILITY OF SUCH DAMAGE. | | 25 | # POSSIBILITY OF SUCH DAMAGE. |
26 | # | | 26 | # |
27 | | | 27 | |
28 | # The image used in these tests has been provided by Thomas Schmitt under | | 28 | # The image used in these tests has been provided by Thomas Schmitt under |
29 | # the following license (see PR kern/48787 for details how to recreate it): | | 29 | # the following license (see PR kern/48787 for details how to recreate it): |
30 | # | | 30 | # |
31 | # Copyright (c) 1999 - 2008, Thomas Schmitt (scdbackup@gmx.net) | | 31 | # Copyright (c) 1999 - 2008, Thomas Schmitt (scdbackup@gmx.net) |
32 | # | | 32 | # |
33 | # Redistribution and use in source and binary forms, with or without | | 33 | # Redistribution and use in source and binary forms, with or without |
34 | # modification, are permitted provided that the following conditions are met: | | 34 | # modification, are permitted provided that the following conditions are met: |
35 | # | | 35 | # |
36 | # Redistributions of source code must retain the above copyright notice, | | 36 | # Redistributions of source code must retain the above copyright notice, |
37 | # this list of conditions and the following disclaimer. | | 37 | # this list of conditions and the following disclaimer. |
38 | # | | 38 | # |
39 | # Redistributions in binary form must reproduce the above copyright notice, | | 39 | # Redistributions in binary form must reproduce the above copyright notice, |
40 | # this list of conditions and the following disclaimer in the documentation | | 40 | # this list of conditions and the following disclaimer in the documentation |
41 | # and/or other materials provided with the distribution. | | 41 | # and/or other materials provided with the distribution. |
42 | # | | 42 | # |
43 | # Neither the name of Thomas Schmitt nor the names of his contributors | | 43 | # Neither the name of Thomas Schmitt nor the names of his contributors |
44 | # may be used to endorse or promote products derived from this software without | | 44 | # may be used to endorse or promote products derived from this software without |
45 | # specific prior written permission. | | 45 | # specific prior written permission. |
46 | # | | 46 | # |
47 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND | | 47 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND |
48 | # CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, | | 48 | # CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, |
49 | # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | | 49 | # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
50 | # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | | 50 | # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
51 | # DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE | | 51 | # DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE |
52 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | | 52 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
53 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | | 53 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
54 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | | 54 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
55 | # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | | 55 | # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
56 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | | 56 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
57 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE | | 57 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE |
58 | # USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH | | 58 | # USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH |
59 | # DAMAGE. | | 59 | # DAMAGE. |
60 | # | | 60 | # |
61 | # ------------------------------------------------------------------------ | | 61 | # ------------------------------------------------------------------------ |
62 | # This is the BSD license as stated July 22 1999 with | | 62 | # This is the BSD license as stated July 22 1999 with |
63 | # <OWNER>="Thomas Schmitt (scdbackup@gmx.net)", | | 63 | # <OWNER>="Thomas Schmitt (scdbackup@gmx.net)", |
64 | # <ORGANIZATION>="Thomas Schmitt" and <YEAR>="1999" | | 64 | # <ORGANIZATION>="Thomas Schmitt" and <YEAR>="1999" |
65 | # an Open Source license approved by opensource.org | | 65 | # an Open Source license approved by opensource.org |
66 | # | | 66 | # |
67 | | | 67 | |
68 | mntpnt="" | | 68 | mntpnt="" |
69 | | | 69 | |
70 | atf_test_case pr_kern_48787 cleanup | | 70 | atf_test_case pr_kern_48787 cleanup |
71 | pr_kern_48787_head() { | | 71 | pr_kern_48787_head() { |
72 | atf_set "descr" "Verifies 32bit overflow isssues from PR kern/48787 are fixed" | | 72 | atf_set "descr" "Verifies 32bit overflow isssues from PR kern/48787 are fixed" |
73 | atf_set "require.user" "root" | | 73 | atf_set "require.user" "root" |
74 | atf_set "require.progs" "rump_cd9660 bunzip2 stat" | | 74 | atf_set "require.progs" "rump_cd9660 bunzip2 stat" |
| | | 75 | atf_set "timeout" 6000 |
75 | } | | 76 | } |
76 | | | 77 | |
77 | pr_kern_48787_body() { | | 78 | pr_kern_48787_body() { |
78 | avail=$( df -P . | awk '{if (NR==2) print $4}' ) | | 79 | avail=$( df -P . | awk '{if (NR==2) print $4}' ) |
79 | if [ $avail -lt 4500000 ]; then | | 80 | if [ $avail -lt 4500000 ]; then |
80 | atf_skip "not enough free disk space, have ${avail}, need ~ 4500000 bytes" | | 81 | atf_skip "not enough free disk space, have ${avail}, need ~ 4500000 bytes" |
81 | fi | | 82 | fi |
82 | bunzip2 < $(atf_get_srcdir)/pr_48787.image.bz2 > pr_48787.image | | 83 | bunzip2 < $(atf_get_srcdir)/pr_48787.image.bz2 > pr_48787.image |
83 | mntpnt=$(pwd)/mnt | | 84 | mntpnt=$(pwd)/mnt |
84 | mkdir ${mntpnt} | | 85 | mkdir ${mntpnt} |
85 | rump_cd9660 -o norrip ./pr_48787.image ${mntpnt} | | 86 | rump_cd9660 -o norrip ./pr_48787.image ${mntpnt} |
86 | if [ ! -r ${mntpnt}/small_file ]; then | | 87 | if [ ! -r ${mntpnt}/small_file ]; then |
87 | atf_fail "${mntpnt}/small_file does not exist" | | 88 | atf_fail "${mntpnt}/small_file does not exist" |
88 | fi | | 89 | fi |
89 | if [ ! -r ${mntpnt}/my/large_file ]; then | | 90 | if [ ! -r ${mntpnt}/my/large_file ]; then |
90 | atf_fail "${mntpnt}/my/large_file does not exist" | | 91 | atf_fail "${mntpnt}/my/large_file does not exist" |
91 | fi | | 92 | fi |
92 | umount ${mntpnt} | | 93 | umount ${mntpnt} |
93 | rump_cd9660 ./pr_48787.image ${mntpnt} | | 94 | rump_cd9660 ./pr_48787.image ${mntpnt} |
94 | if [ ! -r ${mntpnt}/small_file ]; then | | 95 | if [ ! -r ${mntpnt}/small_file ]; then |
95 | atf_fail "${mntpnt}/small_file does not exist" | | 96 | atf_fail "${mntpnt}/small_file does not exist" |
96 | fi | | 97 | fi |
97 | if [ ! -r ${mntpnt}/my/large_file ]; then | | 98 | if [ ! -r ${mntpnt}/my/large_file ]; then |
98 | atf_fail "${mntpnt}/my/large_file does not exist" | | 99 | atf_fail "${mntpnt}/my/large_file does not exist" |
99 | fi | | 100 | fi |
100 | echo "this assumes current cd9660 inode encoding - adapt on changes" | | 101 | echo "this assumes current cd9660 inode encoding - adapt on changes" |
101 | atf_check -o match:"^4329541966$" stat -f "%i" ${mntpnt}/small_file | | 102 | atf_check -o match:"^4329541966$" stat -f "%i" ${mntpnt}/small_file |
102 | atf_check -o match:"^4329545920$" stat -f "%i" ${mntpnt}/my/large_file | | 103 | atf_check -o match:"^4329545920$" stat -f "%i" ${mntpnt}/my/large_file |
103 | umount ${mntpnt} | | 104 | umount ${mntpnt} |
104 | touch "done" | | 105 | touch "done" |
105 | } | | 106 | } |
106 | | | 107 | |
107 | pr_kern_48787_cleanup() { | | 108 | pr_kern_48787_cleanup() { |
108 | if [ ! -f done ]; then | | 109 | if [ ! -f done ]; then |
109 | if [ "x${mntpnt}" != "x" ]; then | | 110 | if [ "x${mntpnt}" != "x" ]; then |
110 | umount -f ${mntpnt} || true | | 111 | umount -f ${mntpnt} || true |
111 | fi | | 112 | fi |
112 | fi | | 113 | fi |
113 | } | | 114 | } |
114 | | | 115 | |
115 | atf_init_test_cases() { | | 116 | atf_init_test_cases() { |
116 | atf_add_test_case pr_kern_48787 | | 117 | atf_add_test_case pr_kern_48787 |
117 | } | | 118 | } |