Commit 9d0c248c authored by Per Cederqvist's avatar Per Cederqvist
Browse files

Test cases for bug 612.

parent b5e0dfb8
# Test suite for lyskomd.
# Copyright (C) 2002 Lysator Academic Computer Association.
#
# This file is part of the LysKOM server.
#
# LysKOM is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 1, or (at your option)
# any later version.
#
# LysKOM is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License
# along with LysKOM; see the file COPYING. If not, write to
# Lysator, c/o ISY, Linkoping University, S-581 83 Linkoping, SWEDEN,
# or the Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
# MA 02139, USA.
#
# Please mail bug reports to bug-lyskom@lysator.liu.se.
# Test bug 612: the error codes from sub-member are sometimes wrong.
#
# Startup and create the players
#
# Start the server.
lyskomd_start
# Create and log in as foo (person 6).
client_start 0
send "A3Hfoo\n"
simple_expect "LysKOM"
send "1000 80 0 { }\n"
simple_expect "=1000"
send "1001 89 [holl "foo"] [holl "p6"] 00000000 0 { }\n"
simple_expect "=1001 6"
send "1002 62 6 [holl "p6"] 0\n"
simple_expect "=1002"
# Create and log in as bar (person 7) (creator of confs)
client_start 1
send "A3Hbar\n"
simple_expect "LysKOM"
send "1003 80 0 { }\n"
simple_expect "=1003"
send "1004 89 [holl "bar"] [holl "p7"] 00000000 0 { }\n"
simple_expect "=1004 7"
send "1005 62 7 [holl "p7"] 0\n"
simple_expect "=1005"
send "1006 21 7 10111000\n"
simple_expect "=1006"
# Create and log in as citrus (person 8) (gazonk is supervisor).
client_start 2
send "A6Hcitrus\n"
simple_expect "LysKOM"
send "1007 80 0 { }\n"
simple_expect "=1007"
send "1008 89 [holl "citrus"] [holl "p8"] 10000000 0 { }\n"
simple_expect "=1008 8"
send "1009 62 8 [holl "p8"] 0\n"
simple_expect "=1009"
# Create and log in as gazonk (person 9). This is the observer.
client_start 3
send "A6Hgazonk\n"
simple_expect "LysKOM"
send "1010 80 0 { }\n"
simple_expect "=1010"
send "1011 89 [holl "gazonk"] [holl "p9"] 00000000 0 { }\n"
simple_expect "=1011 9"
send "1012 62 9 [holl "p9"] 0\n"
simple_expect "=1012"
# Set gazonk as supervisor of citrus.
talk_to client 2
send "1013 18 8 9\n"
simple_expect "=1013"
#
# Create conferences.
#
# As bar, create secret (conf 10; secret).
talk_to client 1
send "1014 88 [holl "secret"] 10101000 0 { }\n"
simple_expect "=1014 10"
# As bar, create rd-prot (conf 11; rd-prot).
send "1015 88 [holl "rd-prot"] 10001000 0 { }\n"
simple_expect "=1015 11"
# As bar, create public (conf 12).
send "1016 88 [holl "public"] 00001000 0 { }\n"
simple_expect "=1016 12"
#
# Join conferences
#
# bar joins secret, rd-prot and public.
send "1017 100 10 7 200 1 00000000\n"
simple_expect "=1017"
send "1018 100 11 7 200 2 00000000\n"
simple_expect "=1018"
send "1019 100 12 7 200 3 00000000\n"
simple_expect "=1019"
# bar invites foo to secret, rd-prot and public.
send "1020 100 10 6 200 1 00000000\n"
simple_expect "=1020"
send "1021 100 11 6 200 2 00000000\n"
simple_expect "=1021"
send "1022 100 12 6 200 3 00000000\n"
simple_expect "=1022"
# bar invites citrus to secret, rd-prot and public.
send "1023 100 10 8 200 1 00000000\n"
simple_expect "=1023"
send "1024 100 11 8 200 2 00000000\n"
simple_expect "=1024"
send "1025 100 12 8 200 3 00000000\n"
simple_expect "=1025"
#
# gazonk attempts to unsubscribe foo.
#
talk_to client 3
send "1026 15 10 6\n"
simple_expect "%1026 9 10"
send "1027 15 11 6\n"
simple_expect "%1027 12 11"
send "1028 15 12 6\n"
simple_expect "%1028 12 12"
#
# gazonk attempts to unsubscribe bar.
#
talk_to client 3
send "1029 15 10 7\n"
simple_expect "%1029 9 10"
send "1030 15 11 7\n"
simple_expect "%1030 12 11"
send "1031 15 12 7\n"
simple_expect "%1031 12 12"
#
# gazonk attempts to unsubscribe citrus. This works, since
# gazonk is supervisor of citrus.
#
talk_to client 3
send "1032 15 10 8\n"
simple_expect "=1032"
send "1033 15 11 8\n"
simple_expect "=1033"
send "1034 15 12 8\n"
simple_expect "=1034"
# bar re-invites citrus to secret, rd-prot and public.
talk_to client 1
send "1035 100 10 8 200 1 00000000\n"
simple_expect "=1035"
send "1036 100 11 8 200 2 00000000\n"
simple_expect "=1036"
send "1037 100 12 8 200 3 00000000\n"
simple_expect "=1037"
# bar invites gazonk to secret, rd-prot and public.
send "1038 100 10 9 200 1 00000000\n"
simple_expect "=1038"
send "1039 100 11 9 200 2 00000000\n"
simple_expect "=1039"
send "1040 100 12 9 200 3 00000000\n"
simple_expect "=1040"
#
# gazonk attempts to unsubscribe foo.
#
talk_to client 3
send "1041 15 10 6\n"
simple_expect "%1041 12 10"
send "1042 15 11 6\n"
simple_expect "%1042 12 11"
send "1043 15 12 6\n"
simple_expect "%1043 12 12"
#
# gazonk attempts to unsubscribe bar.
#
talk_to client 3
send "1044 15 10 7\n"
simple_expect "%1044 12 10"
send "1045 15 11 7\n"
simple_expect "%1045 12 11"
send "1046 15 12 7\n"
simple_expect "%1046 12 12"
#
# gazonk attempts to unsubscribe citrus. This works, since
# gazonk is supervisor of citrus.
#
talk_to client 3
send "1047 15 10 8\n"
simple_expect "=1047"
send "1048 15 11 8\n"
simple_expect "=1048"
send "1049 15 12 8\n"
simple_expect "=1049"
# make gazonk supervisor of bar
talk_to client 1
send "1050 18 7 9\n"
simple_expect "=1050"
#
# gazonk attempts to unsubscribe foo.
#
talk_to client 3
send "1051 15 10 6\n"
simple_expect "%1051 12 10"
send "1052 15 11 6\n"
simple_expect "%1052 12 11"
send "1053 15 12 6\n"
simple_expect "%1053 12 12"
#
# gazonk attempts to unsubscribe bar.
#
talk_to client 3
send "1054 15 10 7\n"
simple_expect "=1054"
send "1055 15 11 7\n"
simple_expect "=1055"
send "1056 15 12 7\n"
simple_expect "=1056"
# ...and again, when bar already is unsubscribed.
send "1057 15 10 7\n"
simple_expect "%1057 13 10"
send "1058 15 11 7\n"
simple_expect "%1058 13 11"
send "1059 15 12 7\n"
simple_expect "%1059 13 12"
# Shut down.
talk_to client 3
send "1060 0 5 [holl "gazonk"]\n"
simple_expect "=1060"
send "1061 42 255\n"
simple_expect "=1061"
send "1062 44 0\n"
simple_expect "=1062"
client_death 3
client_death 2
client_death 1
client_death 0
lyskomd_death
Supports Markdown
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