AT_BANNER([Use case checks])
AT_SETUP([Use case #1])
AT_DATA([expout],
[[ 2 locking for 2 seconds
1 locking for 1 seconds
2 ending
1 ending
]])
AT_CHECK([flom_test_exec1.sh 1 1 1 & flom_test_exec1.sh 2 0 2 ; flom_test_exec1.sh 3 0 0 >/dev/null], [0], [expout], [ignore])
AT_CLEANUP
AT_SETUP([Use case #2])
AT_DATA([expout],
[[ 1 locking for 5 seconds
3 locking for 3 seconds
2 locking for 2 seconds
4 locking for 2 seconds
3 ending
1 ending
4 ending
2 ending
]])
AT_CHECK([flom_test_exec2.sh 1 1 5 R1 & flom_test_exec2.sh 2 3 2 R1 & flom_test_exec2.sh 3 2 3 R2 & flom_test_exec2.sh 4 4 2 R2 ; flom_test_exec2.sh 5 0 0 R1 >/dev/null ; flom_test_exec2.sh 6 0 0 R2 >/dev/null], [0], [expout], [ignore])
AT_CLEANUP
AT_SETUP([Use case #3])
AT_DATA([expout],
[[ 2 locking for 2 seconds
1 locking for 1 seconds
Resource already locked, the lock cannot be obtained
1 ending
2 ending
]])
AT_CHECK([flom_test_exec3.sh 1 1 1 "-w n" & flom_test_exec1.sh 2 0 2 ; flom_test_exec1.sh 3 0 0 >/dev/null], [0], [expout], [ignore])
AT_CLEANUP
AT_SETUP([Use case #4 (1/2)])
AT_DATA([expout],
[[ 2 locking for 3 seconds
1 locking for 1 seconds
Resource already locked, the lock was not obtained because timeout (1000 milliseconds) expired
1 ending
2 ending
]])
AT_CHECK([flom_test_exec3.sh 1 1 1 "-o 1000" & flom_test_exec1.sh 2 0 3 ; flom_test_exec1.sh 3 0 0 >/dev/null], [0], [expout], [ignore])
AT_CLEANUP
AT_SETUP([Use case #4 (2/2)])
AT_DATA([expout],
[[ 1 locking for 0 seconds
1 ending
]])
AT_CHECK([flom_test_exec3.sh 1 0 0 "-o 1000" ; flom_test_exec1.sh 2 0 0 >/dev/null], [0], [expout], [ignore])
AT_CLEANUP
AT_SETUP([Use case #5 (1/9)])
AT_DATA([expout],
[[ 1 locking for 4 seconds
3 locking for 1 seconds
2 locking for 1 seconds
2 ending
1 ending
3 ending
]])
AT_CHECK([flom_test_exec3.sh 1 0 4 "-l PR" & flom_test_exec3.sh 2 2 1 "-l PR" & flom_test_exec3.sh 3 1 1 "-l PW" ; flom_test_exec1.sh 4 0 0 >/dev/null], [0], [expout], [ignore])
AT_CLEANUP
AT_SETUP([Use case #5 (2/9)])
AT_DATA([expout],
[[ 1 locking for 2 seconds
2 locking for 1 seconds
Resource already locked, the lock cannot be obtained
2 ending
1 ending
]])
AT_CHECK([flom_test_exec3.sh 1 0 2 "-l CR" & flom_test_exec3.sh 2 1 1 "-l EX -w n" ; flom_test_exec1.sh 3 0 0 >/dev/null ], [0], [expout], [ignore])
AT_CLEANUP
AT_SETUP([Use case #5 (3/9)])
AT_DATA([expout],
[[ 1 locking for 2 seconds
2 locking for 1 seconds
Resource already locked, the lock cannot be obtained
2 ending
1 ending
]])
AT_CHECK([flom_test_exec3.sh 1 0 2 "-l CW" & flom_test_exec3.sh 2 1 1 "-l PR -w n" ; flom_test_exec1.sh 3 0 0 >/dev/null ], [0], [expout], [ignore])
AT_CHECK([flom_test_exec3.sh 1 0 2 "-l CW" & flom_test_exec3.sh 2 1 1 "-l PW -w n" ; flom_test_exec1.sh 3 0 0 >/dev/null ], [0], [expout], [ignore])
AT_CHECK([flom_test_exec3.sh 1 0 2 "-l CW" & flom_test_exec3.sh 2 1 1 "-l EX -w n" ; flom_test_exec1.sh 3 0 0 >/dev/null ], [0], [expout], [ignore])
AT_CLEANUP
AT_SETUP([Use case #5 (4/9)])
AT_DATA([expout],
[[ 1 locking for 2 seconds
2 locking for 1 seconds
Resource already locked, the lock cannot be obtained
2 ending
1 ending
]])
AT_CHECK([flom_test_exec3.sh 1 0 2 "-l PR" & flom_test_exec3.sh 2 1 1 "-l CW -w n" ; flom_test_exec1.sh 3 0 0 >/dev/null ], [0], [expout], [ignore])
AT_CHECK([flom_test_exec3.sh 1 0 2 "-l PR" & flom_test_exec3.sh 2 1 1 "-l PW -w n" ; flom_test_exec1.sh 3 0 0 >/dev/null ], [0], [expout], [ignore])
AT_CHECK([flom_test_exec3.sh 1 0 2 "-l PR" & flom_test_exec3.sh 2 1 1 "-l EX -w n" ; flom_test_exec1.sh 3 0 0 >/dev/null ], [0], [expout], [ignore])
AT_CLEANUP
AT_SETUP([Use case #5 (5/9)])
AT_DATA([expout],
[[ 1 locking for 2 seconds
2 locking for 1 seconds
Resource already locked, the lock cannot be obtained
2 ending
1 ending
]])
AT_CHECK([flom_test_exec3.sh 1 0 2 "-l PW" & flom_test_exec3.sh 2 1 1 "-l CW -w n" ; flom_test_exec1.sh 3 0 0 >/dev/null ], [0], [expout], [ignore])
AT_CHECK([flom_test_exec3.sh 1 0 2 "-l PW" & flom_test_exec3.sh 2 1 1 "-l PR -w n" ; flom_test_exec1.sh 3 0 0 >/dev/null ], [0], [expout], [ignore])
AT_CHECK([flom_test_exec3.sh 1 0 2 "-l PW" & flom_test_exec3.sh 2 1 1 "-l PW -w n" ; flom_test_exec1.sh 3 0 0 >/dev/null ], [0], [expout], [ignore])
AT_CHECK([flom_test_exec3.sh 1 0 2 "-l PW" & flom_test_exec3.sh 2 1 1 "-l EX -w n" ; flom_test_exec1.sh 3 0 0 >/dev/null ], [0], [expout], [ignore])
AT_CLEANUP
AT_SETUP([Use case #5 (6/9)])
AT_DATA([expout],
[[ 1 locking for 2 seconds
2 locking for 1 seconds
Resource already locked, the lock cannot be obtained
2 ending
1 ending
]])
AT_CHECK([flom_test_exec3.sh 1 0 2 "-l EX" & flom_test_exec3.sh 2 1 1 "-l CR -w n" ; flom_test_exec1.sh 3 0 0 >/dev/null ], [0], [expout], [ignore])
AT_CHECK([flom_test_exec3.sh 1 0 2 "-l EX" & flom_test_exec3.sh 2 1 1 "-l CW -w n" ; flom_test_exec1.sh 3 0 0 >/dev/null ], [0], [expout], [ignore])
AT_CHECK([flom_test_exec3.sh 1 0 2 "-l EX" & flom_test_exec3.sh 2 1 1 "-l PR -w n" ; flom_test_exec1.sh 3 0 0 >/dev/null ], [0], [expout], [ignore])
AT_CHECK([flom_test_exec3.sh 1 0 2 "-l EX" & flom_test_exec3.sh 2 1 1 "-l PW -w n" ; flom_test_exec1.sh 3 0 0 >/dev/null ], [0], [expout], [ignore])
AT_CHECK([flom_test_exec3.sh 1 0 2 "-l EX" & flom_test_exec3.sh 2 1 1 "-l EX -w n" ; flom_test_exec1.sh 3 0 0 >/dev/null ], [0], [expout], [ignore])
AT_CLEANUP
AT_SETUP([Use case #5 (7/9)])
AT_DATA([expout],
[[ 1 locking for 2 seconds
2 locking for 0 seconds
2 ending
1 ending
]])
AT_CHECK([flom_test_exec3.sh 1 0 2 "-l NL" & flom_test_exec3.sh 2 1 0 "-l NL" ; flom_test_exec1.sh 3 0 3 >/dev/null ], [0], [expout], [ignore])
AT_CHECK([flom_test_exec3.sh 1 0 2 "-l NL" & flom_test_exec3.sh 2 1 0 "-l CR" ; flom_test_exec1.sh 3 0 3 >/dev/null ], [0], [expout], [ignore])
AT_CHECK([flom_test_exec3.sh 1 0 2 "-l NL" & flom_test_exec3.sh 2 1 0 "-l CW" ; flom_test_exec1.sh 3 0 3 >/dev/null ], [0], [expout], [ignore])
AT_CHECK([flom_test_exec3.sh 1 0 2 "-l NL" & flom_test_exec3.sh 2 1 0 "-l PR" ; flom_test_exec1.sh 3 0 3 >/dev/null ], [0], [expout], [ignore])
AT_CHECK([flom_test_exec3.sh 1 0 2 "-l NL" & flom_test_exec3.sh 2 1 0 "-l PW" ; flom_test_exec1.sh 3 0 3 >/dev/null ], [0], [expout], [ignore])
AT_CHECK([flom_test_exec3.sh 1 0 2 "-l NL" & flom_test_exec3.sh 2 1 0 "-l EX" ; flom_test_exec1.sh 3 0 3 >/dev/null ], [0], [expout], [ignore])
AT_CLEANUP
AT_SETUP([Use case #5 (8/9)])
AT_DATA([expout],
[[ 1 locking for 2 seconds
2 locking for 0 seconds
2 ending
1 ending
]])
AT_CHECK([flom_test_exec3.sh 1 0 2 "-l CR" & flom_test_exec3.sh 2 1 0 "-l CR" ; flom_test_exec1.sh 3 0 3 >/dev/null ], [0], [expout], [ignore])
AT_CHECK([flom_test_exec3.sh 1 0 2 "-l CR" & flom_test_exec3.sh 2 1 0 "-l CW" ; flom_test_exec1.sh 3 0 3 >/dev/null ], [0], [expout], [ignore])
AT_CHECK([flom_test_exec3.sh 1 0 2 "-l CR" & flom_test_exec3.sh 2 1 0 "-l PR" ; flom_test_exec1.sh 3 0 3 >/dev/null ], [0], [expout], [ignore])
AT_CHECK([flom_test_exec3.sh 1 0 2 "-l CR" & flom_test_exec3.sh 2 1 0 "-l PW" ; flom_test_exec1.sh 3 0 3 >/dev/null ], [0], [expout], [ignore])
AT_CLEANUP
AT_SETUP([Use case #5 (9/9)])
AT_DATA([expout],
[[ 1 locking for 2 seconds
2 locking for 0 seconds
2 ending
1 ending
]])
AT_CHECK([flom_test_exec3.sh 1 0 2 "-l CW" & flom_test_exec3.sh 2 1 0 "-l CW" ; flom_test_exec1.sh 3 0 3 >/dev/null ], [0], [expout], [ignore])
AT_CHECK([flom_test_exec3.sh 1 0 2 "-l PR" & flom_test_exec3.sh 2 1 0 "-l PR" ; flom_test_exec1.sh 3 0 3 >/dev/null ], [0], [expout], [ignore])
AT_CLEANUP