3 # This script performs additional setup for the RPC unit test. It
4 # assumes that gmake has put TOP and RPC_TEST_SRVTAB into the
10 DUMMY=${TESTDIR=$TOP/testing}
11 DUMMY=${CLNTTCL=$TESTDIR/util/kadm5_clnt_tcl}
12 DUMMY=${TCLUTIL=$TESTDIR/tcl/util.t}; export TCLUTIL
13 DUMMY=${MAKE_KEYTAB=$TESTDIR/scripts/make-host-keytab.pl}
21 PATH=$TOP/install/admin:$PATH; export PATH
23 CANON_HOST=`$QUALNAME`
26 cat - > /tmp/rpc_test_setup$$ <<\EOF
28 set h $env(CANON_HOST)
29 puts stdout [kadm5_init admin admin $KADM5_ADMIN_SERVICE null $KADM5_STRUCT_VERSION $KADM5_API_VERSION_2 server_handle]
30 if ![info exists server_handle] { exit 1 }
31 puts stdout [kadm5_create_principal $server_handle [simple_principal server/$h] {KADM5_PRINCIPAL} admin]
32 puts stdout [kadm5_randkey_principal $server_handle server/$h key null]
33 puts stdout [kadm5_create_principal $server_handle [simple_principal notserver/$h] {KADM5_PRINCIPAL} admin]
34 puts stdout [kadm5_randkey_principal $server_handle notserver/$h key null]
35 puts stdout [kadm5_destroy $server_handle]
37 eval "$CLNTTCL $REDIRECT < /tmp/rpc_test_setup$$"
38 if test $? != 0 ; then
39 rm /tmp/rpc_test_setup$$
40 echo 1>&2 error setting up database for tests
43 rm /tmp/rpc_test_setup$$
45 rm -f $RPC_TEST_SRVTAB
47 eval $MAKE_KEYTAB -princ server/$CANON_HOST $RPC_TEST_SRVTAB $REDIRECT
49 # grep -s "$CANON_HOST SECURE-TEST.OV.COM" /etc/krb.realms
50 # if [ $? != 0 ]; then
51 # eval echo \"Adding \$CANON_HOST SECURE-TEST.OV.COM to /etc/krb.realms\" $REDIRECT
52 # ed /etc/krb.realms <<EOF >/dev/null
54 # $CANON_HOST SECURE-TEST.OV.COM