#!/bin/sh

# XXX: auto-switch to a supported protocol instead.
if test "x$DEFAUTHTYPE" = "x"; then
    if grep '^#define USE_OPENSSL 1' $SNMP_UPDIR/include/net-snmp/net-snmp-config.h $SNMP_UPDIR/include/net-snmp/agent/mib_module_config.h > /dev/null ; then
	DEFAUTHTYPE="SHA"
    else
	    DEFAUTHTYPE="MD5"
    fi
fi

if test "x$DEFPRIVTYPE" = "x"; then
    if grep '^#define HAVE_AES 1' $SNMP_UPDIR/include/net-snmp/net-snmp-config.h $SNMP_UPDIR/include/net-snmp/agent/mib_module_config.h > /dev/null ; then
      DEFPRIVTYPE="AES"
    else
      DEFPRIVTYPE="DES"
    fi
fi

CONFIGAGENT createUser initial $DEFAUTHTYPE initial_test_pass_auth $DEFPRIVTYPE
CONFIGAGENT createUser template $DEFAUTHTYPE template_test_pass_auth $DEFPRIVTYPE
CONFIGAGENT rwuser initial noauth
CONFIGAGENT rwuser newtestuser

NOAUTHTESTARGS="-l nanp -u initial -v 3"
AUTHTESTARGS="-l anp -u initial -v 3 -a $DEFAUTHTYPE -A initial_test_pass_auth"
PRIVTESTARGS="-l ap -u initial -v 3 -a $DEFAUTHTYPE -A initial_test_pass_auth -x $DEFPRIVTYPE -X initial_test_pass_auth"

AUTHNOPASSTESTARGS="-l anp -u initial -v 3 -a $DEFAUTHTYPE"
PRIVNOPASSTESTARGS="-l ap -u initial -v 3 -a $DEFAUTHTYPE -x $DEFPRIVTYPE"
