File: fallocate.rc

package info (click to toggle)
glusterfs 11.2-2
  • links: PTS
  • area: main
  • in suites: sid
  • size: 28,244 kB
  • sloc: ansic: 471,238; sh: 45,610; python: 16,893; perl: 3,328; makefile: 2,014; yacc: 487; ruby: 171; lisp: 124; xml: 75; lex: 61
file content (19 lines) | stat: -rw-r--r-- 620 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/bash

# Helper to verify a given fallocate command is supported and skip a test
# otherwise. Older versions of the fallocate utility might not support all modes
# (i.e., discard) and older versions of fuse might not support the associated
# fallocate requests.

function require_fallocate()
{
        output=`fallocate $* 2>&1`
        ret=$?
        if [ ! $ret -eq 0 ] && ([[ $output == *unsupported* ]] ||
                                [[ $output == *invalid* ]] ||
                                [[ $output == *"not supported"* ]])
        then
                SKIP_TESTS
                exit
        fi
}