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