Detect failure to register with rpcbind/portmap due to security
authorEzra Peisach <epeisach@mit.edu>
Thu, 5 Feb 2009 19:02:29 +0000 (19:02 +0000)
committerEzra Peisach <epeisach@mit.edu>
Thu, 5 Feb 2009 19:02:29 +0000 (19:02 +0000)
restrictons and not bomb out in tests.

ticket: 6349

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21895 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/rpc/unit-test/config/unix.exp
src/lib/rpc/unit-test/rpc_test.0/expire.exp
src/lib/rpc/unit-test/rpc_test.0/fullrun.exp
src/lib/rpc/unit-test/rpc_test.0/gsserr.exp

index 824d4634177cd44311473861dae4e9104162cbb6..f02116e1dafcb3652a99c2849839d62d5e95b3b0 100644 (file)
@@ -112,6 +112,10 @@ proc rpc_test_exit {} {
        global server_started
        global kill
 
+        if { [info exists server_started] && $server_started == 0 } { 
+           return 
+       }
+
        if {[catch {
                expect {
                        -i $server_id
@@ -143,6 +147,7 @@ proc rpc_test_start { } {
        verbose "% $SERVER" 1
        set server_pid [spawn $SERVER $PROT]
        set server_id $spawn_id
+        set server_started 1
 
        unset env(KRB5_KTNAME)
 
@@ -150,6 +155,18 @@ proc rpc_test_start { } {
 
        expect {
                "running" { }
+               "Cannot register service" {
+                       send_error "Server cannot register with portmap/rpcbind!!\n"
+                       note "+++"
+                       note "+++ These tests require the ability to register with portmap/rpcbind"
+                       note "+++ Either the server is not running or it does not"
+                       note "+++  allow registration using a loopback connection"
+                       note "+++"
+                       verbose $expect_out(buffer) 1
+                       set server_started 0
+                       unsupported "Server registration"
+                       return
+               }
                eof { 
                        send_error "server exited!"
                        verbose $expect_out(buffer) 1
index f5841011f85954e263298b8f73d24490eeaf731a..ab3796554e93eb9fe4c4518583da58591e7cbe52 100644 (file)
@@ -2,7 +2,7 @@ set timeout 40
 
 load_lib "helpers.exp"
 
-global spawn_id
+global server_started
 
 proc expired {} {
     global spawn_id server_id
@@ -18,7 +18,9 @@ proc expired {} {
 
     flush_server
 }
-expired
+
+#if { [info exists server_pid] && ($server_pid >= 0) } { expired }
+if { $server_started } {expired } 
 
 proc overlap {} {
     global spawn_id
@@ -41,6 +43,6 @@ proc overlap {} {
 
     flush_server
 }
-overlap
+if { $server_started } {overlap} 
 
 
index 2b2d205201a95a6206471a9e706803acbafcf6db..73083de1f14d9f2750a8f9c73f90adc36b9498d9 100644 (file)
@@ -4,6 +4,9 @@ load_lib "helpers.exp"
 
 global spawn_id
 global server_id
+global server_started
+
+if { !$server_started } {return} 
 
 # Start the client and do a full run
 start_client "full run" fullrun testuser notathena 8h 1026
index 2bb936ab51f8b4e5db8d2cdf78819b51406cf7c0..c3e78b1a4777a82c0e820575338b5156937d96a1 100644 (file)
@@ -4,8 +4,11 @@ load_lib "helpers.exp"
 
 global spawn_id
 global server_id
+global server_started
 global hostname
 
+if { !$server_started } {return} 
+
 start_client "gss err" gsserr testuser notathena 8h 1026 notserver@$hostname
 
 eof_client "gss err" gsserr $spawn_id 2