1102166Stjr#!/bin/sh 2102166Stjr# 3102166Stjr# Copyright 2014 EMC Corp. 4102166Stjr# All rights reserved. 5102166Stjr# 6102166Stjr# Redistribution and use in source and binary forms, with or without 7102166Stjr# modification, are permitted provided that the following conditions are 8102166Stjr# met: 9102166Stjr# 10102166Stjr# * Redistributions of source code must retain the above copyright 11102166Stjr# notice, this list of conditions and the following disclaimer. 12102166Stjr# * Redistributions in binary form must reproduce the above copyright 13102166Stjr# notice, this list of conditions and the following disclaimer in the 14102166Stjr# documentation and/or other materials provided with the distribution. 15102166Stjr# * Neither the name of Google Inc. nor the names of its contributors 16102166Stjr# may be used to endorse or promote products derived from this software 17102166Stjr# without specific prior written permission. 18102166Stjr# 19102166Stjr# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20102166Stjr# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21102166Stjr# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22102166Stjr# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23102166Stjr# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24102166Stjr# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25102166Stjr# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26107706Sru# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27107706Sru# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28102166Stjr# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29102166Stjr# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30102166Stjr# 31102166Stjr# $FreeBSD: stable/11/tests/sys/file/flock_test.sh 324404 2017-10-07 23:10:16Z ngie $ 32102166Stjr 33102166Stjr# Testcase # 11 is racy; uses an undocumented kernel interface for testing 34102166Stjr# locking 35102166Stjrlast_testcase=16 36102166Stjr 37102166Stjrecho "1..$last_testcase" 38102166Stjr 39102166Stjrfor n in `seq 1 $last_testcase`; do 40102166Stjr todomsg="" 41102166Stjr 42102166Stjr if [ $n -eq 11 ]; then 43102166Stjr todomsg=" # TODO: racy testcase" 44102166Stjr fi 45102166Stjr 46102166Stjr output=$($(dirname $0)/flock_helper . $n) 47102166Stjr if echo "$output" | grep -q SUCCEED; then 48102166Stjr echo "ok $n$todomsg" 49102166Stjr else 50102166Stjr echo "not ok $n$todomsg" 51102166Stjr echo "$output" >&2 52102166Stjr fi 53107706Srudone 54102166Stjr