Debian Codegraph @

testing/fulltests/default/T058agentauthtrap_simple

raw
1 #!/bin/sh
2
3 . ../support/simple_eval_tools.sh
4
5 HEADER authentication failure traps are sent by snmpd
6
7 SKIPIF NETSNMP_DISABLE_SNMPV1
8
9 #
10 # Begin test
11 #
12
13 # standard V1 configuration: testcommunity
14 . ./Sv1config
15 # add in a v1 trap sink
16 CONFIGAGENT trapsink $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPTRAPD_PORT public
17 CONFIGAGENT authtrapenable 1
18 CONFIGTRAPD authcommunity log public
19 CONFIGTRAPD agentxsocket /dev/null
20
21 STARTTRAPD
22
23 STARTAGENT
24
25 # give the agent more time to start up. We only want to fire one
26 # request (retries = 0) to make sure only one trap is sent.
27 #DELAY
28 CAPTURE "snmpget -On -r 0 -t 5 $SNMP_FLAGS -v 1 -c wrongcommunity $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.3.0"
29
30 STOPAGENT
31
32 STOPTRAPD
33
34 CHECKTRAPD "Authentication Failure Trap"
35
36 FINISHED