2 # Copyright (c) 2021 Proofpoint, Inc. and its suppliers.
5 # By using this file, you agree to the terms and conditions set
6 # forth in the LICENSE file which can be found at the top level of
7 # the sendmail distribution.
9 # ----------------------------------------
11 # Note: this is mostly for systems which use fcntl().
12 # just invoke it from the obj.*/libsmutil/ directory;
13 # otherwise use the -l and -m options to specify the paths.
14 # ----------------------------------------
36 $0: test basic makemap locking;
37 requires `basename ${CHKL}` and `basename ${M}`.
41 -l locktest path to `basename ${CHKL}` [default: ${CHKL}]
42 -m makemap path to `basename ${M}` [default: $M]
48 while getopts l:m:t: FLAG
53 t) tries="${OPTARG}";;
59 shift `expr ${OPTIND} - 1`
61 [ -x $M ] || fail "missing $M"
62 [ -x ${CHKL} ] || fail "missing ${CHKL}"
64 MAPTX=`$M -x | egrep 'hash|cdb'`
68 (echo "l1 l2"; sleep 5; echo "e1 e2") |
69 $M -v $MT $F >> $O 2>&1
74 ${CHKL} -Rrc -f $F >> $O 2>&1
80 MT=`echo $XT | cut -d: -f1`
81 EXT=`echo $XT | cut -d: -f2`
92 while [ $tries -gt 0 ]
95 tries=`expr $tries - 1 `
101 if grep "status=unknown" $O >/dev/null
105 # get the makemap pid, not the "mm" pid, for checks?
106 grep "status=locked pid=" $O || err "$MT map not locked"