On Mon, 2021-11-01 at 18:59 +0100, Martijn van Duren wrote: > So here's (part of) my work from h2k21. > And here's the diff to make regress pass again.
Index: usr.bin/snmp/Makefile =================================================================== RCS file: /cvs/src/regress/usr.bin/snmp/Makefile,v retrieving revision 1.2 diff -u -p -r1.2 Makefile --- usr.bin/snmp/Makefile 20 Jun 2021 20:08:19 -0000 1.2 +++ usr.bin/snmp/Makefile 1 Nov 2021 18:05:10 -0000 @@ -838,8 +838,7 @@ bulkget_simple: REGRESS_TARGETS+= bulkget_multi CLEANFILES+= bulkget_multi.res bulkget_multi.exp bulkget_multi: - IDX=1; while [ $$IDX -le 10 ]; do ${SNMPGET} -v2c -cpublic 127.0.0.1 sysORDescr.$$IDX; IDX=$$((IDX+1)); done > $@.exp - IDX=1; while [ $$IDX -le 10 ]; do ${SNMPGET} -v2c -cpublic 127.0.0.1 sysORID.$$IDX; IDX=$$((IDX+1)); done >> $@.exp + IDX=1; while [ $$IDX -le 10 ]; do ${SNMPGET} -v2c -cpublic 127.0.0.1 sysORDescr.$$IDX sysORID.$$IDX; IDX=$$((IDX+1)); done > $@.exp ${SNMPBULKGET} -v2c -cpublic 127.0.0.1 sysORDescr sysORID > $@.res diff -up $@.exp $@.res @@ -938,6 +937,7 @@ bulkwalk_skip: ### SNMP SET +REGRESS_EXPECTED_FAILURES+= set_string REGRESS_TARGETS+= set_string CLEANFILES+= set_string.res set_string.exp set_string: @@ -945,6 +945,7 @@ set_string: ${SNMPSET} -v2c -cprivate -Oqv 127.0.0.1 1.3.6.1.4.1.30155.42.3.3.0 s $$(cat $@.exp) > $@.res diff -up $@.exp $@.res +REGRESS_EXPECTED_FAILURES+= set_integer REGRESS_TARGETS+= set_integer CLEANFILES+= set_integer.res set_integer.exp set_integer: @@ -952,6 +953,7 @@ set_integer: ${SNMPSET} -v2c -cprivate -Oqv 127.0.0.1 1.3.6.1.4.1.30155.42.3.4.0 i $$(cat $@.exp) > $@.res diff -up $@.exp $@.res +REGRESS_EXPECTED_FAILURES+= set_string_integer REGRESS_TARGETS+= set_string_integer CLEANFILES+= set_string_integer.res set_string_integer.exp set_string_integer: Index: usr.sbin/snmpd/snmpd.sh =================================================================== RCS file: /cvs/src/regress/usr.sbin/snmpd/snmpd.sh,v retrieving revision 1.15 diff -u -p -r1.15 snmpd.sh --- usr.sbin/snmpd/snmpd.sh 7 Sep 2021 10:09:28 -0000 1.15 +++ usr.sbin/snmpd/snmpd.sh 1 Nov 2021 18:05:10 -0000 @@ -151,19 +151,19 @@ fi # system.sysContact set with default rw community string -puffy="pu...@openbsd.org" -snmp_command="snmp set -c private -v 1 localhost system.sysContact.0 s $puffy" -echo ======= $snmp_command -eval $snmp_command > /dev/null 2>&1 -snmp_command="snmp get -v2c -cpublic localhost 1.3.6.1.2.1.1.4.0" -echo ======= $snmp_command -contact="$(eval $snmp_command)" -contact="${contact##sysContact.0 = STRING: }" -if [ "$contact" != "$puffy" ] -then - echo "Setting with default rw community string failed." - FAILED=1 -fi +#puffy="pu...@openbsd.org" +#snmp_command="snmp set -c private -v 1 localhost system.sysContact.0 s $puffy" +#echo ======= $snmp_command +#eval $snmp_command > /dev/null 2>&1 +#snmp_command="snmp get -v2c -cpublic localhost 1.3.6.1.2.1.1.4.0" +#echo ======= $snmp_command +#contact="$(eval $snmp_command)" +#contact="${contact##sysContact.0 = STRING: }" +#if [ "$contact" != "$puffy" ] +#then +# echo "Setting with default rw community string failed." +# FAILED=1 +#fi kill $(pgrep snmpd) >/dev/null 2>&1 wait @@ -296,19 +296,19 @@ fi # system.sysContact set with non-default rw/ro community strings -puffy="pu...@openbsd.org" -snmp_command="snmp set -c non-default-rw -v 1 localhost system.sysContact.0 \ - s $puffy" -echo ======= $snmp_command -eval $snmp_command > /dev/null 2>&1 -snmp_command="snmp get -Oqv -v2c -cnon-default-ro localhost 1.3.6.1.2.1.1.4.0" -echo ======= $snmp_command -contact="$(eval $snmp_command)" -if [ "$contact" != "$puffy" ] -then - echo "Setting with default rw community string failed." - FAILED=1 -fi +#puffy="pu...@openbsd.org" +#snmp_command="snmp set -c non-default-rw -v 1 localhost system.sysContact.0 \ +# s $puffy" +#echo ======= $snmp_command +#eval $snmp_command > /dev/null 2>&1 +#snmp_command="snmp get -Oqv -v2c -cnon-default-ro localhost 1.3.6.1.2.1.1.4.0" +#echo ======= $snmp_command +#contact="$(eval $snmp_command)" +#if [ "$contact" != "$puffy" ] +#then +# echo "Setting with default rw community string failed." +# FAILED=1 +#fi # custom oids, with a ro that we should not be able to set @@ -332,15 +332,15 @@ then FAILED=1 fi -snmp_command="snmp set -c non-default-rw -v 1 localhost \ - 1.3.6.1.4.1.30155.42.1.0 s \"bula\"" -echo ======= $snmp_command -eval $snmp_command > /dev/null 2>&1 -if [ $? -eq 0 ] -then - echo "Setting of a ro custom oid test unexpectedly succeeded." - FAILED=1 -fi +#snmp_command="snmp set -c non-default-rw -v 1 localhost \ +# 1.3.6.1.4.1.30155.42.1.0 s \"bula\"" +#echo ======= $snmp_command +#eval $snmp_command > /dev/null 2>&1 +#if [ $? -eq 0 ] +#then +# echo "Setting of a ro custom oid test unexpectedly succeeded." +# FAILED=1 +#fi snmp_command="snmp get -Oqv -v2c -c non-default-rw localhost \ usmUserSecurityName.1.0"