. "${CTDB_BASE}/functions"
+if [ $# -ne 4 ] ; then
+ die "usage: $0 <pid> { DB | RECORD } <tdb_path> { FCNTL | MUTEX }"
+fi
+
+lock_helper_pid="$1"
+# lock_scope is unused for now
+# shellcheck disable=SC2034
+lock_scope="$2"
+tdb_path="$3"
+lock_type="$4"
+
# type is at least mentioned in POSIX and more is portable than which(1)
# shellcheck disable=SC2039
if ! type gstack >/dev/null 2>&1 ; then
_holder_state="$2"
_helper_scope="$3"
+ _lock_helper_pid="4132032"
+
FAKE_PS_MAP=$(cat <<EOF
1234567 ctdbd S
2345678 smbd S
4131931 smbd ${_holder_state}
-4132032 ctdb_lock_helpe S+
+${_lock_helper_pid} ctdb_lock_helpe S+
EOF
)
export FAKE_PS_MAP
_helper_lock=""
if [ "$_helper_scope" = "DB" ] ; then
_helper_lock=$(cat <<EOF
--> POSIX ADVISORY WRITE 4132032 ${_locking_tdb_id} 168 170
+-> POSIX ADVISORY WRITE ${_lock_helper_pid} ${_locking_tdb_id} 168 170
EOF
)
elif [ "$_helper_scope" = "RECORD" ] ; then
_helper_lock=$(cat <<EOF
--> POSIX ADVISORY WRITE 4132032 ${_locking_tdb_id} 112736 112736
+-> POSIX ADVISORY WRITE ${_lock_helper_pid} ${_locking_tdb_id} 112736 112736
EOF
)
fi
===== End of debug locks PID=PID =====
EOF
- script_test "${script_dir}/${script}"
+ script_test "${script_dir}/${script}" \
+ "$_lock_helper_pid" \
+ "$_helper_scope" \
+ "$_path" \
+ "fcntl"
+
}