File: example

package info (click to toggle)
pyagentx 0.4.1-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 200 kB
  • sloc: python: 818; sh: 13; makefile: 3
file content (22 lines) | stat: -rwxr-xr-x 423 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh

set -e

OUTPUT=$AUTOPKGTEST_TMP/walk.out

cleanup () {
  [ "$AGENT_PID" ] && kill $AGENT_PID
  rm -f $OUTPUT
}

trap "cleanup" 0 2 3 15

sed -i 's/^#\(rocommunity public  localhost.*\)/\1/' /etc/snmp/snmpd.conf
service snmpd restart

python3 debian/tests/example-agent.py 2>&1 &
AGENT_PID=$!

snmpwalk -v 2c -c public localhost 1.3.6.1.4.1.8072.9999.9999 | tee $OUTPUT

grep -q '\.1\.0 = INTEGER: 1000$' $OUTPUT