From 887b4e35081259b02fe1c374d4f9cf4db44cedb1 Mon Sep 17 00:00:00 2001 From: Theodore Tso Date: Wed, 11 Sep 1996 21:06:38 +0000 Subject: [PATCH] Remove kadmin/import and kadmin/export since they are subsumed by kdb5_util git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@9083 dc483132-0cff-0310-8789-dd5450dbe970 --- src/kadmin/export/unit-test/ChangeLog | 5 - src/kadmin/export/unit-test/Makefile.ov | 19 ---- src/kadmin/export/unit-test/add-to-db.sh | 55 ---------- src/kadmin/export/unit-test/dotest.sh | 75 -------------- src/kadmin/export/unit-test/helpers.exp | 126 ----------------------- 5 files changed, 280 deletions(-) delete mode 100644 src/kadmin/export/unit-test/ChangeLog delete mode 100644 src/kadmin/export/unit-test/Makefile.ov delete mode 100644 src/kadmin/export/unit-test/add-to-db.sh delete mode 100644 src/kadmin/export/unit-test/dotest.sh delete mode 100644 src/kadmin/export/unit-test/helpers.exp diff --git a/src/kadmin/export/unit-test/ChangeLog b/src/kadmin/export/unit-test/ChangeLog deleted file mode 100644 index 5db33c7c5..000000000 --- a/src/kadmin/export/unit-test/ChangeLog +++ /dev/null @@ -1,5 +0,0 @@ -Mon Jul 15 16:55:03 1996 Marc Horowitz - - * Makefile.ov (unit-test-body), dotest.sh: ovsec_adm_*port is now - kadm5_*port - diff --git a/src/kadmin/export/unit-test/Makefile.ov b/src/kadmin/export/unit-test/Makefile.ov deleted file mode 100644 index 25b1bf6c7..000000000 --- a/src/kadmin/export/unit-test/Makefile.ov +++ /dev/null @@ -1,19 +0,0 @@ -# -# $Id$ -# - -TOP = ../.. -include $(TOP)/config.mk/template - -unit-test:: unit-test-setup unit-test-body unit-test-cleanup - -unit-test-setup:: - $(SAVE_FILES) - $(FIX_CONF_FILES) - $(INITDB) - -unit-test-body:: - $(RUNTEST) EXPORT=../kadm5_export --tool export - -unit-test-cleanup:: - $(RESTORE_FILES) diff --git a/src/kadmin/export/unit-test/add-to-db.sh b/src/kadmin/export/unit-test/add-to-db.sh deleted file mode 100644 index c50541546..000000000 --- a/src/kadmin/export/unit-test/add-to-db.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/sh - -REALM=SECURE-TEST.OV.COM; export REALM -DUMMY=${TESTDIR=$TOP/testing}; export TESTDIR -DUMMY=${SRVTCL=$TESTDIR/util/ovsec_kadm_srv_tcl}; export SRVTCL -DUMMY=${TCLUTIL=$TESTDIR/tcl/util.t}; export TCLUTIL - -$SRVTCL <<'EOF' -global r - -source $env(TCLUTIL) -set r $env(REALM) - -proc newpol { pname } { - puts stdout [ovsec_kadm_create_policy $server_handle [simple_policy "$pname"] {OVSEC_KADM_POLICY}] -} - -proc newprinc { name } { - global r - puts stdout [ovsec_kadm_create_principal $server_handle [simple_principal "$name@$r"] {OVSEC_KADM_PRINCIPAL} $name] -} - -proc chpass { princ pass } { - global server_handle - puts stdout [ovsec_kadm_chpass_principal $server_handle "$princ" "$pass"] -} - -puts stdout [ovsec_kadm_init $env(SRVTCL) mrroot null $r $OVSEC_KADM_STRUCT_VERSION $OVSEC_KADM_API_VERSION_1 server_handle] - -puts stdout [ovsec_kadm_create_policy $server_handle "export_pwhist 0 0 0 0 10 0" {OVSEC_KADM_POLICY OVSEC_KADM_PW_HISTORY_NUM}] - -### Commented out since this isn't going to work for the december beta -#newprinc "export_with space" -#newprinc "export_with\"dquote" -#newprinc "export_with\nnewline" - -puts stdout [ovsec_kadm_create_principal $server_handle [princ_w_pol export_hist1@$r export_pwhist] {OVSEC_KADM_PRINCIPAL OVSEC_KADM_POLICY} hist1] - -chpass export_hist1@$r hist1_a - -puts stdout [ovsec_kadm_create_principal $server_handle [princ_w_pol export_hist10@$r export_pwhist] {OVSEC_KADM_PRINCIPAL OVSEC_KADM_POLICY} hist10] - -chpass export_hist10@$r hist10_a -chpass export_hist10@$r hist10_b -chpass export_hist10@$r hist10_c -chpass export_hist10@$r hist10_d -chpass export_hist10@$r hist10_e -chpass export_hist10@$r hist10_f -chpass export_hist10@$r hist10_g -chpass export_hist10@$r hist10_h -chpass export_hist10@$r hist10_i - -puts stdout [ovsec_kadm_destroy $server_handle] - -EOF diff --git a/src/kadmin/export/unit-test/dotest.sh b/src/kadmin/export/unit-test/dotest.sh deleted file mode 100644 index 53d4fe0ab..000000000 --- a/src/kadmin/export/unit-test/dotest.sh +++ /dev/null @@ -1,75 +0,0 @@ -#!/bin/sh - -DUMMY=${TESTDIR=$TOP/testing} -DUMMY=${BSDDB_DUMP=$TESTDIR/util/bsddb_dump} -DUMMY=${KDB5_EDIT=$TOP/../admin/edit/kdb5_edit} - -DPRINC=/tmp/dbdump.princ -DPOL=/tmp/dbdump.policy - -DPRINC1=$DPRINC.1 -DPRINC2=$DPRINC.2 - -DPOL1=$DPOL.1 -DPOL2=$DPOL.2 - -DEXPORT=/tmp/dbexport - -./add-to-db.sh - -rm -f $DEXPORT -../kadm5_export > $DEXPORT - -if $KDB5_EDIT -R ddb | sort > $DPRINC1; then - : -else - echo "error dumping princ.1" -fi -if $BSDDB_DUMP /krb5/kadb5 | sort > $DPOL1; then - : -else - echo "error dumping policy.1" -fi - -rm -f /krb5/kadb5* -touch /krb5/ovsec_adm.lock - -../../import/kadm5_import < $DEXPORT - -if $KDB5_EDIT -R ddb | sort > $DPRINC2; then - : -else - echo "error dumping princ.2" -fi -if $BSDDB_DUMP /krb5/kadb5 | sort > $DPOL2; then - : -else - echo "error dumping policy.2" -fi - - -status=0 - -if test -s $DPRINC1 && \ - test -s $DPRINC2 && \ - cmp -s $DPRINC1 $DPRINC2; then - echo "export/import principal db succeeded" -else - echo "export/import principal db failed" - status=1 -fi - -if test -s $DPOL1 && \ - test -s $DPOL2 && \ - cmp -s $DPOL1 $DPOL2; then - echo "export/import policy db succeeded" -else - echo "export/import policy db failed" - status=1 -fi - -if [ $status -eq 0 ]; then - rm -f $DPRINC* $DPOL* $DEXPORT -fi - -exit $status diff --git a/src/kadmin/export/unit-test/helpers.exp b/src/kadmin/export/unit-test/helpers.exp deleted file mode 100644 index c53630f4b..000000000 --- a/src/kadmin/export/unit-test/helpers.exp +++ /dev/null @@ -1,126 +0,0 @@ -# -# $Id$ -# - -if {[info commands exp_version] != {}} { - set exp_version_4 [regexp {^4} [exp_version]] -} else { - set exp_version_4 [regexp {^4} [expect_version]] -} - -# Backward compatibility until we're using expect 5 everywhere -if {$exp_version_4} { - global wait_error_index wait_errno_index wait_status_index - set wait_error_index 0 - set wait_errno_index 1 - set wait_status_index 1 -} else { - set wait_error_index 2 - set wait_errno_index 3 - set wait_status_index 3 -} - -proc myfail { comment } { - global mytest_name - global mytest_status - wait - fail "$mytest_name: $comment" - set mytest_status 1 -} - -proc mypass {} { -} - -## -## When you expect on an id, and eof is detected, the spawn_id is closed. -## It may be waited for, but calling expect or close on this id is an ERROR! -## - -proc mytest { name kpargs status args } { - global spawn_id - global timeout - global mytest_name - global mytest_status - global wait_error_index wait_errno_index wait_status_index - - verbose "starting test: $name" - - set mytest_name "$name" - - eval export_start $kpargs - - # at the end, eof is success - - lappend args { eof { if {[regexp "\[\r\n\]$" $expect_out(buffer)] == 0} { myfail "final status message not newline-terminated" } } } - - # for each test argument.... - # rep invariant: when this foreach ends, the id is close'd, but - # not wait'ed. - - foreach test $args { - set mytest_status 0 - - # treat the arg as an expect parameter - # if failure, the process will be closed and waited. - - uplevel 1 "expect { - $test - timeout { close; myfail \"timeout\"} - eof { myfail \"eof read before expected message string\" } - }" - - if {$mytest_status == 1} { return } - } - - # at this point, the id is closed and we can wait on it. - - set ret [wait] - verbose "% Exit $ret" 1 - if {[lindex $ret $wait_error_index] == -1} { - fail "$name: wait returned error [lindex $ret $wait_errno_index]" - } else { - if { ((![string compare $status zero]) && - ([lindex $ret $wait_status_index] == 0)) || - ((![string compare $status nonzero]) && - ([lindex $ret $wait_status_index] != 0)) } { - pass "$name" - } else { - fail "$name: unexpected return status [lindex $ret $wait_status_index], should be $status" - } - } -} - -proc export_win { name args } { - mytest "$name" "$args" zero { - -re "Database export complete, \[0-9\]+ records processed." - { mypass } - eof - { myfail "error: $expect_out(buffer)" } - } -} - -proc export_lose { name args error } { - mytest "$name" "$args" nonzero { - -re "Database export complete, \[0-9\]+ records processed." - { close; myfail "unexpected success" } - -re "ovsec_adm_export: .*$error" - { mypass } - eof - { myfail "error: $expect_out(buffer)" } - } -} - -proc check_mode { test file mode } { - if {[catch "file stat $file stats" output]} { - unresolved "$test: can't stat $file: $output" - } else { - set stats(mode) [format "%o" [expr $stats(mode) & 07777]] - set mode [format "%o" [expr $mode]] - if {$stats(mode) != $mode} { - fail "$test: wrong mode ($stats(mode) should be $mode)" - } else { - verbose "$test: file $file has mode $mode" - pass $test - } - } -} -- 2.26.2