File: transport_broken_echo2

package info (click to toggle)
paexec 1.1.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 904 kB
  • sloc: sh: 3,435; ansic: 1,959; makefile: 174; pascal: 19
file content (32 lines) | stat: -rwxr-xr-x 477 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env sh

#
# usage: transport <check_filename> <node_id>
#

fn=$1
shift

id=$1
shift

if test "$id" -eq 1 && ! test -f "$fn"; then
    # fails if there is not file <check_filename> and <node_id> = 1
    touch "$fn"
    exit 12
fi

if test "$id" -eq 2; then
    # fails <node_id> = 2 with 3 secs timeout
    read task
    sleep 3
    echo task
    exit 11
fi

# succeeds in all other cases
while read task; do
    echo "output $task"
    echo success
    echo ''
done