Revert "Revert "and added files""
[bcm963xx.git] / userapps / opensource / net-snmp / testing / tests / T030snmpv3usercreation
1 #!/bin/sh
2
3 . ../eval_tools.sh
4
5 HEADER SNMPv3 user creation and usage using snmpusm
6 SKIPIFNOT USE_OPENSSL
7
8 #
9 # Begin test
10 #
11
12 # standard V3 configuration for initial user
13 . ./Sv3config
14
15 STARTAGENT
16
17 CAPTURE "snmpusm $SNMP_FLAGS -v 3 -a MD5 -A initial_test_pass_auth -l anp -u initial udp:localhost:$SNMP_SNMPD_PORT create newtestuser templateMD5"
18 CHECKORDIE "User successfully created"
19
20 CAPTURE "snmpusm $SNMP_FLAGS -Cx -v 3 -a MD5 -A templateMD5_test_pass_auth -l anp -u newtestuser udp:localhost:$SNMP_SNMPD_PORT passwd templateMD5_test_pass_auth newtestpass"
21 CHECKORDIE "SNMPv3 Key(s) successfully changed"
22
23 CAPTURE "snmpusm $SNMP_FLAGS -Ca -v 3 -a MD5 -A templateMD5_test_pass_auth -l anp -u newtestuser udp:localhost:$SNMP_SNMPD_PORT passwd templateMD5_test_pass_auth newtestpass"
24 CHECKORDIE "SNMPv3 Key(s) successfully changed"
25
26 CAPTURE "snmpget -On $SNMP_FLAGS -v 3 -a MD5 -A newtestpass -l anp -u newtestuser udp:localhost:$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.3.0"
27 CHECKORDIE ".1.3.6.1.2.1.1.3.0 = Timeticks:"
28
29 # auth
30 CAPTURE "snmpget -On $SNMP_FLAGS -v 3 -a MD5 -A newtestpass -l anp -u newtestuser udp:localhost:$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.3.0"
31 CHECKORDIE ".1.3.6.1.2.1.1.3.0 = Timeticks:"
32
33 # auth & encr
34 CAPTURE "snmpget -On $SNMP_FLAGS -v 3 -a MD5 -A newtestpass -x DES -X newtestpass -l ap -u newtestuser udp:localhost:$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.3.0"
35 CHECKORDIE ".1.3.6.1.2.1.1.3.0 = Timeticks:"
36
37 # change both keys at once
38 CAPTURE "snmpusm $SNMP_FLAGS -v 3 -a MD5 -A newtestpass -l anp -u newtestuser udp:localhost:$SNMP_SNMPD_PORT passwd newtestpass myotherpass"
39 CHECKORDIE "SNMPv3 Key(s) successfully changed"
40
41 # auth & encr
42 CAPTURE "snmpget -On $SNMP_FLAGS -v 3 -a MD5 -A myotherpass -x DES -X myotherpass -l ap -u newtestuser udp:localhost:$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.3.0"
43 CHECKORDIE ".1.3.6.1.2.1.1.3.0 = Timeticks:"
44
45 STOPAGENT
46
47
48 FINISHED