Paul Sokolovsky | 69bdd3b | 2023-04-04 12:26:30 +0300 | [diff] [blame] | 1 | #!/bin/sh -x |
| 2 | # This script is to workaround an apparent LAVA race condition, when it |
| 3 | # detects "EOF" (i.e. app termination) before it reads out all the stdout |
| 4 | # from the app (FVP in this case). The wrapper explicitly runs a command |
| 5 | # in line-buffered mode, that helps a little (LAVA reads more output), |
| 6 | # but not completely, so we just give LAVA more time with some sleep after |
| 7 | # command termination. |
| 8 | |
Paul Sokolovsky | c3319e6 | 2023-04-04 18:11:02 +0300 | [diff] [blame] | 9 | if [ "$1" = "--version" ]; then |
Paul Sokolovsky | c51c920 | 2023-04-04 16:42:07 +0300 | [diff] [blame] | 10 | echo "$0 1.0" |
| 11 | exit |
| 12 | fi |
| 13 | |
Paul Sokolovsky | dfe531f | 2023-04-04 15:34:15 +0300 | [diff] [blame] | 14 | delay="$1" |
| 15 | shift |
Paul Sokolovsky | 69bdd3b | 2023-04-04 12:26:30 +0300 | [diff] [blame] | 16 | cmd="$1" |
| 17 | shift |
| 18 | stdbuf -oL "$cmd" "$@" |
Paul Sokolovsky | dfe531f | 2023-04-04 15:34:15 +0300 | [diff] [blame] | 19 | sleep $delay |