blob: e0a73267ca8b6c7669419272b10c6bdaa945b689 (
plain)
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
33
34
35
36
37
38
39
40
41
42
|
#!/bin/sh
# shellcheck shell=busybox
# tcpreplay and tcpreplay-edit probe a network interface's link state while
# parsing their options, so under the QEMU runtime running any of these tools
# with --version is unreliable: tcpreplay/tcpreplay-edit either abort
# ("eth0: SIOCETHTOOL(ETHTOOL_GLINK) ioctl failed: Not a tty") or hang forever
# (observed on big-endian mips). Do not execute the binaries here at all;
# assert the version string compiled into each one instead. Actually running
# the file-processing tools is covered by test.sh. The presence of this script
# also disables the generic per-executable probe, which would otherwise run
# the same hanging --version.
version="$2"
check() {
bin="/usr/bin/$1"
[ -x "$bin" ] || {
echo "missing executable: $bin" >&2
return 1
}
grep -qaF "$version" "$bin" || {
echo "version $version not found in $bin" >&2
return 1
}
}
case "$1" in
tcpbridge | tcpcapinfo | tcpliveplay | tcpprep | tcpreplay | tcpreplay-edit | tcprewrite)
check "$1"
;;
tcpreplay-all)
# Meta-package: ships no binary of its own, the modules arrive as
# dependencies. Validate a representative always-present module.
check tcprewrite
;;
*)
echo "Untested package: $1" >&2
exit 1
;;
esac
|