File: net-snmp-run-python-tests

package info (click to toggle)
net-snmp 5.9+dfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 36,760 kB
  • sloc: ansic: 283,039; perl: 17,712; sh: 11,887; makefile: 2,705; xml: 663; python: 623; pascal: 62; sql: 47
file content (19 lines) | stat: -rwxr-xr-x 610 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/sh

set -x
killall snmpd
export LD_LIBRARY_PATH="$PWD/snmplib/.libs:$PWD/agent/.libs:$PWD/agent/helpers/.libs:"
export MIBDIRS=$PWD/mibs
export SNMP_PERSISTENT_DIR=/tmp/net-snmp
export SNMP_SNMPD_PORT=1161
export PYTHONPATH=$PWD/python/netsnmp
mkdir -p "$SNMP_PERSISTENT_DIR" || exit $?
agent/snmpd -I-smux -r -f -Lo -c python/netsnmp/tests/snmpd.conf localhost:${SNMP_SNMPD_PORT} &
pid=$!
PYTHONPROG=$(sed -n 's/^S\["PYTHONPROG"\]="\(.*\)"$/\1/p' config.status) ||
    exit $?
[ -n "$PYTHONPROG" ] || exit $?
cd python || exit $?
$PYTHONPROG setup.py --basedir="$PWD/.." test || exit $?
kill $pid
wait