File: example

package info (click to toggle)
pyagentx 0.4.1-6
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 200 kB
  • sloc: python: 818; sh: 14; makefile: 3
file content (24 lines) | stat: -rwxr-xr-x 480 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
#!/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 '/^rocommunity\s\+public/ i\
rocommunity public localhost' /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