Commit 908b8595 authored by Per Cederqvist's avatar Per Cederqvist
Browse files

Commit of work in progress. Still needs more work.

parent d3d2cc44
......@@ -25,7 +25,12 @@
# async-new-text-old, async-add-recipient and async-sub-recipient to
# recipients of texts that are linked to the text.
lyskomd_start
# We want to be able to set broken aux-items, so we start by
# creating our own aux-item.conf which lack all validate lines.
system "grep -v validate $aux_item_default_conf_file > 35-aux.conf"
lyskomd_start 35-aux.conf
client_start 0
talk_to client 0
......@@ -200,12 +205,273 @@ simple_expect "=1030"
talk_to client 1
simple_expect ":18 14 8 $any_time 5 0 6 0 3 { 0 3 6 6 3 1 } 0 \\*"
# FIXME (bug 59): Test for texts linked via aux items:
# - cross-reference
# - aux-mx-mime-belongs-to
# - aux-mx-mime-part-in
# - aux-faq-for-conf
# Also test for broken references in those aux-items.
if {0} {
set cross_mirror 1
} else {
set cross_mirror 0
setup_xfail "*-*-*" "Bug 23"
fail "There is no mirroring aux-item for cross-references"
}
# Text 9: linked via a cross-reference.
talk_to client 0
send "1031 86 [holl "text 9"] 1 { 0 3 } 1 { 3 00000000 1 [holl "T1"] }\n"
simple_expect "=1031 9"
talk_to client 1
if {$cross_mirror} {
simple_expect ":16 0 9 $any_time 5 0 6 0 2 { 0 3 6 7 }"
simple_expect ":18 15 9 $any_time 5 0 6 0 2 { 0 3 6 7 } 1 { 1 3 5 $any_time 00000000 1 [holl "T1"] }"
}
# Add conference 4 as recipient of text 9.
talk_to client 0
send "1032 30 9 4 0\n"
simple_expect "=1032"
talk_to client 1
if {$cross_mirror} {
simple_expect ":3 16 9 4 0"
}
# Remove conference 4 as recipient of text 9.
talk_to client 0
send "1033 31 9 4\n"
simple_expect "=1033"
talk_to client 1
if {$cross_mirror} {
simple_expect ":3 17 9 4 0"
}
# Delete text 9.
talk_to client 0
send "1034 29 9\n"
simple_expect "=1034"
talk_to client 1
if {$cross_mirror} {
simple_expect ":18 14 9 $any_time 5 0 6 0 2 { 0 3 6 7 } 1 { 1 3 5 $any_time 00000000 1 [holl "T1"] }"
}
# Text 10: linked via a cross-reference with trailing info.
talk_to client 0
send "1035 86 [holl "text 10"] 1 { 0 3 } 1 { 3 00000000 1 [holl "T1 ho ho"] }\n"
simple_expect "=1035 10"
talk_to client 1
if {$cross_mirror} {
simple_expect ":16 0 10 $any_time 5 0 7 0 2 { 0 3 6 8 }"
simple_expect ":18 15 10 $any_time 5 0 7 0 2 { 0 3 6 8 } 1 { 1 3 5 $any_time 00000000 1 [holl "T1 ho ho"] }"
}
# Add conference 4 as recipient of text 10.
talk_to client 0
send "1036 30 10 4 0\n"
simple_expect "=1036"
talk_to client 1
if {$cross_mirror} {
simple_expect ":3 16 10 4 0"
}
# Remove conference 4 as recipient of text 10.
talk_to client 0
send "1037 31 10 4\n"
simple_expect "=1037"
talk_to client 1
if {$cross_mirror} {
simple_expect ":3 17 10 4 0"
}
# Delete text 10.
talk_to client 0
send "1038 29 10\n"
simple_expect "=1038"
talk_to client 1
if {$cross_mirror} {
simple_expect ":18 14 10 $any_time 5 0 7 0 2 { 0 3 6 8 } 1 { 1 3 5 $any_time 00000000 1 [holl "T1 ho ho"] }"
}
# Text 11: linked via a cross-reference to a conf (no async).
# FIXME (bug 23): Once a mirroring aux-item for cross-references
# exists, we probably should expect async messages here.
talk_to client 0
send "1039 86 [holl "text 11"] 1 { 0 3 } 1 { 3 00000000 1 [holl "C1 ho ho"] }\n"
simple_expect "=1039 11"
# Add conference 4 as recipient of text 11.
talk_to client 0
send "1040 30 11 4 0\n"
simple_expect "=1040"
# Remove conference 4 as recipient of text 11.
send "1041 31 11 4\n"
simple_expect "=1041"
# Delete text 11.
send "1042 29 11\n"
simple_expect "=1042"
# Text 12: with a broken cross-reference.
talk_to client 0
send "1043 86 [holl "text 12"] 1 { 0 3 } 1 { 3 00000000 1 [holl "C99"] }\n"
simple_expect "=1043 12"
# Add conference 4 as recipient of text 12.
talk_to client 0
send "1044 30 12 4 0\n"
simple_expect "=1044"
# Remove conference 4 as recipient of text 12.
send "1045 31 12 4\n"
simple_expect "=1045"
# Delete text 12.
send "1046 29 12\n"
simple_expect "=1046"
# Text 13: with a broken cross-reference.
talk_to client 0
send "1047 86 [holl "text 13"] 1 { 0 3 } 1 { 3 00000000 1 [holl "C"] }\n"
simple_expect "=1047 13"
# Add conference 4 as recipient of text 13.
talk_to client 0
send "1048 30 13 4 0\n"
simple_expect "=1048"
# Remove conference 4 as recipient of text 13.
send "1049 31 13 4\n"
simple_expect "=1049"
# Delete text 13.
send "1050 29 13\n"
simple_expect "=1050"
# Text 14: linked via a mx-mime-belongs-to.
talk_to client 0
send "1051 86 [holl "text 14"] 1 { 0 3 } 1 { 10100 00000000 1 [holl "1"] }\n"
simple_expect "=1051 14"
talk_to client 1
simple_expect ":16 0 14 $any_time 5 0 7 0 2 { 0 3 6 12 }"
simple_expect ":18 15 14 $any_time 5 0 7 0 2 { 0 3 6 12 } 1 { 1 10100 5 $any_time 00000000 1 [holl "1"] }"
# Add conference 4 as recipient of text 14.
talk_to client 0
send "1052 30 14 4 0\n"
simple_expect "=1052"
talk_to client 1
simple_expect ":3 16 14 4 0"
# Remove conference 4 as recipient of text 14.
talk_to client 0
send "1053 31 14 4\n"
simple_expect "=1053"
talk_to client 1
simple_expect ":3 17 14 4 0"
# Delete text 14.
talk_to client 0
send "1054 29 14\n"
simple_expect "=1054"
talk_to client 1
simple_expect ":18 14 14 $any_time 5 0 7 0 2 { 0 3 6 12 } 1 { 1 10100 5 $any_time 00000000 1 [holl "1"] }"
# Text 15: linked via a mx-mime-part-in.
talk_to client 0
send "1055 86 [holl "text 15"] 1 { 0 3 } 1 { 10101 00000000 1 [holl "1"] }\n"
simple_expect "=1055 15"
talk_to client 1
simple_expect ":16 0 15 $any_time 5 0 7 0 2 { 0 3 6 13 }"
simple_expect ":18 15 15 $any_time 5 0 7 0 2 { 0 3 6 13 } 1 { 1 10101 5 $any_time 00000000 1 [holl "1"] }"
# Add conference 4 as recipient of text 15.
talk_to client 0
send "1056 30 15 4 0\n"
simple_expect "=1056"
talk_to client 1
simple_expect ":3 16 15 4 0"
# Remove conference 4 as recipient of text 15.
talk_to client 0
send "1057 31 15 4\n"
simple_expect "=1057"
talk_to client 1
simple_expect ":3 17 15 4 0"
# Delete text 15.
talk_to client 0
send "1058 29 15\n"
simple_expect "=1058"
talk_to client 1
simple_expect ":18 14 15 $any_time 5 0 7 0 2 { 0 3 6 13 } 1 { 1 10101 5 $any_time 00000000 1 [holl "1"] }"
# Text 16: linked via a mx-mime-belongs-to with empty data.
talk_to client 0
send "1059 86 [holl "text 16"] 1 { 0 3 } 1 { 10100 00000000 1 [holl ""] }\n"
lyskomd_expect "Bad aux-item 10100 found in text 16: \"\": bad number\\."
simple_expect "=1059 16"
# Add conference 4 as recipient of text 16.
send "1060 30 16 4 0\n"
simple_expect "=1060"
# Remove conference 4 as recipient of text 16.
send "1061 31 16 4\n"
simple_expect "=1061"
# Delete text 16.
send "1062 29 16\n"
simple_expect "=1062"
# Text 17: linked via a mx-mime-part-in with empty data.
talk_to client 0
send "1063 86 [holl "text 17"] 1 { 0 3 } 1 { 10101 00000000 1 [holl ""] }\n"
lyskomd_expect "Bad aux-item 10101 found in text 17: \"\": bad number\\."
simple_expect "=1063 17"
# Add conference 4 as recipient of text 17.
send "1064 30 17 4 0\n"
simple_expect "=1064"
# Remove conference 4 as recipient of text 17.
send "1065 31 17 4\n"
simple_expect "=1065"
# Delete text 17.
send "1066 29 17\n"
simple_expect "=1066"
# Text 18: linked via a mx-mime-belongs-to with extra data.
set tno 18
talk_to client 0
send "1067 86 [holl "text $tno"] 1 { 0 3 } 1 { 10100 00000000 1 [holl "1x"] }\n"
lyskomd_expect "Bad aux-item 10100 found in text $tno: \"1x\": trailing garbage\\."
simple_expect "=1067 $tno"
# Add conference 4 as recipient of text $tno.
send "1068 30 $tno 4 0\n"
simple_expect "=1068"
# Remove conference 4 as recipient of text $tno.
send "1069 31 $tno 4\n"
simple_expect "=1069"
# Delete text $tno.
send "1070 29 $tno\n"
simple_expect "=1070"
# Text 19: linked via a mx-mime-part-in with extra data.
set tno 19
talk_to client 0
send "1071 86 [holl "text $tno"] 1 { 0 3 } 1 { 10101 00000000 1 [holl "1 x"] }\n"
lyskomd_expect "Bad aux-item 10101 found in text $tno: \"1 x\": trailing garbage\\."
simple_expect "=1071 $tno"
# Add conference 4 as recipient of text $tno.
send "1072 30 $tno 4 0\n"
simple_expect "=1072"
# Remove conference 4 as recipient of text $tno.
send "1073 31 $tno 4\n"
simple_expect "=1073"
# Delete text $tno.
send "1074 29 $tno\n"
simple_expect "=1074"
# Text 20: linked via a mx-mime-belongs-to with broken data.
set tno 20
talk_to client 0
send "1075 86 [holl "text $tno"] 1 { 0 3 } 1 { 10100 00000000 1 [holl "x1"] }\n"
lyskomd_expect "Bad aux-item 10100 found in text $tno: \"x1\": trailing garbage\\."
simple_expect "=1075 $tno"
# Add conference 4 as recipient of text $tno.
send "1076 30 $tno 4 0\n"
simple_expect "=1076"
# Remove conference 4 as recipient of text $tno.
send "1077 31 $tno 4\n"
simple_expect "=1077"
# Delete text $tno.
send "1078 29 $tno\n"
simple_expect "=1078"
# Text 21: linked via a mx-mime-part-in with broken data.
set tno 21
talk_to client 0
send "1079 86 [holl "text $tno"] 1 { 0 3 } 1 { 10101 00000000 1 [holl "99999999999999999999999999999999999999999999999999999999999999999999999999999999"] }\n"
simple_expect "=1079 $tno"
# Add conference 4 as recipient of text $tno.
send "1080 30 $tno 4 0\n"
simple_expect "=1080"
# Remove conference 4 as recipient of text $tno.
send "1081 31 $tno 4\n"
simple_expect "=1081"
# Delete text $tno.
send "1082 29 $tno\n"
simple_expect "=1082"
# FIXME (bug 59): Test for async-sub-recipient when we are not allowed
# to see the recipient.
......@@ -215,10 +481,10 @@ simple_expect ":18 14 8 $any_time 5 0 6 0 3 { 0 3 6 6 3 1 } 0 \\*"
# Shut everything down.
talk_to client 0
send "1031 42 255\n"
simple_expect "=1031"
send "1032 44 0\n"
simple_expect "=1032"
send "1083 42 255\n"
simple_expect "=1083"
send "1084 44 0\n"
simple_expect "=1084"
client_death 0
client_death 1
lyskomd_death
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