]> git.proxmox.com Git - mirror_zfs-debian.git/blob - tests/zfs-tests/tests/functional/mmap/mmap_libaio_001_pos.ksh
New upstream version 0.7.9
[mirror_zfs-debian.git] / tests / zfs-tests / tests / functional / mmap / mmap_libaio_001_pos.ksh
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 2018 Canonical. All rights reserved.
25 #
26
27 . $STF_SUITE/include/libtest.shlib
28 . $STF_SUITE/tests/functional/mmap/mmap.cfg
29
30 #
31 # DESCRIPTION:
32 # Verify libaio functions correctly with mmap()'d files.
33 #
34 # STRATEGY:
35 # 1. Call mmap_libaio binary
36 # 2. Verify the file exists and is the expected size
37 # 3. Verify the filesystem is intact and not hung in any way
38 #
39
40 verify_runnable "global"
41
42 log_assert "verify mmap'd pages work with libaio"
43
44 # mmap_libaio is built when the libaio-devel package is installed.
45 if ! which mmap_libaio; then
46 log_unsupported "This test requires mmap_libaio."
47 fi
48
49 log_must chmod 777 $TESTDIR
50
51 for size in 512 4096 8192; do
52 log_mustnot stat $TESTDIR/test-libaio-file
53 log_must mmap_libaio $TESTDIR/test-libaio-file $size
54 log_must verify_eq $(stat --format=%s $TESTDIR/test-libaio-file) $size
55 log_must rm $TESTDIR/test-libaio-file
56 done
57
58 typeset dir=$(get_device_dir $DISKS)
59 verify_filesys "$TESTPOOL" "$TESTPOOL/$TESTFS" "$dir"
60
61 log_pass "mmap'd pages work with libaio"