File: example

package info (click to toggle)
pyagentx 0.4.1-10
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 200 kB
  • sloc: python: 818; sh: 14; makefile: 3
file content (26 lines) | stat: -rwxr-xr-x 525 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
23
24
25
26
#!/bin/sh

set -e

OUTPUT=$AUTOPKGTEST_TMP/walk.out

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

trap "cleanup" 0 2 3 15

# enable localhost access to full snmp data
sed -i 's/^#\(rocommunity \+public \+localhost.*\)/\1/' /etc/snmp/snmpd.conf
service snmpd restart

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

# Give the test agent time to register fully:
sleep 5

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

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