Commit 3e125e20 authored by Per Cederqvist's avatar Per Cederqvist

(assert_0): New proc. Use it to simplify the code.

parent 7adbd1cb
......@@ -31,6 +31,19 @@
# Conferences:
# 8 (secret) members: 7 creator: 7
proc assert_0 {conf msg} {
# Fail if $conf is non-zero.
# For now, we expect all these tests to fail. Remove the next
# line once the bugs are fixed.
setup_xfail "*"
if {$conf == 0} {
pass "$msg"
} else {
fail "$msg"
}
}
lyskomd_start
# Establish the sessions, create persons, and log in.
......@@ -68,9 +81,8 @@ talk_to client 0
# Should this even be sent? Seen from the view-point of person 6,
# person 7 goes from conference 0 to conference 0.
extracting_expect ":5 6 7 (\[08\]) 2 0H [holl "foo@localhost"]" conf 1
if {$conf == 8} {
fail "async-i-am-on leaks secret info"
}
assert_0 $conf "async-i-am-on leaks secret info"
# Person 6 tries to get information.
......@@ -80,39 +92,27 @@ simple_expect "%1003 9 8"
send "1004 39\n"
extracting_expect "=1004 2 { 7 (\[08\]) 0H 6 0 0H }" conf 1
if {$conf == 8} {
fail "who-is-on-old leaks secret info"
}
assert_0 $conf "who-is-on-old leaks secret info"
send "1005 51\n"
extracting_expect "=1005 2 { 7 (\[08\]) 2 0H [holl "foo@localhost"] 6 0 1 0H [holl "foo@localhost"] }" conf 1
if {$conf == 8} {
fail "who-is-on leaks secret info"
}
assert_0 $conf "who-is-on leaks secret info"
send "1007 54 2\n"
extracting_expect "=1007 7 (\[08\]) 2 0H [holl "foo@localhost"] $any_num $any_time" conf 1
if {$conf == 8} {
fail "get-session-info leaks secret info"
}
assert_0 $conf "get-session-info leaks secret info"
send "1006 63\n"
extracting_expect "=1006 2 { 7 (\[08\]) 2 0H 3Hfoo [holl "localhost"] [holl "unknown"] 6 0 1 0H 3Hfoo [holl "localhost"] [holl "unknown"] }" conf 1
if {$conf == 8} {
fail "who-is-on-ident leaks secret info"
}
assert_0 $conf "who-is-on-ident leaks secret info"
send "1007 64 2\n"
extracting_expect "=1007 7 (\[08\]) 2 0H 3Hfoo [holl "localhost"] [holl "unknown"] $any_num $any_time" conf 1
if {$conf == 8} {
fail "get-session-info-ident leaks secret info"
}
assert_0 $conf "get-session-info-ident leaks secret info"
send "1 83 1 1 0\n"
extracting_expect "=1 2 { 2 7 (\[08\]) $any_num 00000000 0H 1 6 0 $any_num 00000000 0H }" conf 1
if {$conf == 8} {
fail "who-is-on-dynamic leaks secret info"
}
assert_0 $conf "who-is-on-dynamic leaks secret info"
# Shut down the server.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment