Commit 1cb2a0ae authored by Per Cederqvist's avatar Per Cederqvist
Browse files

Initial commit. Lots of setup done, but no actual tests yet.

parent 046ac95f
# 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 37: get_unread_confs does not check that the caller is
# allowed to see the person, and returns the correct result even for
# secret persons, including secret confs!
#
# We also check get-membership, get-membership-old, query-read-texts,
# and query-read-texts-old.
#
# While we are at it, we also test the unread-is-secret personal flag.
#
# FIXME (bug 590): If the request requested in bug 590 is implemented,
# it should also be checked here.
#
# 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; secret).
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; has unread-is-secret set).
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 0
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"
#
# Create conferences.
#
# As bar, create secret (conf 10; secret).
talk_to client 1
send "1013 88 [holl "secret"] 10101000 0 { }\n"
simple_expect "=1013 10"
# As bar, create rd-prot (conf 11; rd-prot).
send "1014 88 [holl "rd-prot"] 10001000 0 { }\n"
simple_expect "=1014 11"
# As bar, create public (conf 12).
send "1015 88 [holl "public"] 00001000 0 { }\n"
simple_expect "=1015 12"
#
# Join conferences
#
# bar joins secret, rd-prot and public.
send "1016 100 10 7 200 1 00000000\n"
simple_expect "=1016"
send "1017 100 11 7 200 2 00000000\n"
simple_expect "=1017"
send "1018 100 12 7 200 3 00000000\n"
simple_expect "=1018"
# bar invites foo to secret, rd-prot and public.
send "1019 100 10 6 200 1 00000000\n"
simple_expect "=1019"
send "1020 100 11 6 200 2 00000000\n"
simple_expect "=1020"
send "1021 100 12 6 200 3 00000000\n"
simple_expect "=1021"
# bar invites citrus to secret, rd-prot and public.
send "1022 100 10 8 200 1 00000000\n"
simple_expect "=1022"
send "1023 100 11 8 200 2 00000000\n"
simple_expect "=1023"
send "1024 100 12 8 200 3 00000000\n"
simple_expect "=1024"
#
# foo examines foo.
#
talk_to client 0
# foo does get-unread-confs of foo. Should return the empty list.
# foo does get-membership of foo. Should return 4 { 6 10 11 12 }.
# foo does get-membership-old of foo. Should return 4 { 6 10 11 12 }.
# foo does query-read-texts on foo and 10, 11 and 12. Should get results.
# foo does query-read-texts-old on foo and 10, 11 and 12. Should get results.
# foo does <FIXME (bug 590)> on foo and 10, 11 and 12. Should get results.
#
# gazonk examines foo.
#
# gazonk does get-unread-confs of foo. Should return the empty list.
# gazonk does get-membership of foo. Should return 4 { 6 11 12 }.
# gazonk does get-membership-old of foo. Should return 4 { 6 11 12 }.
# gazonk does query-read-texts on foo and 10, 11 and 12. 10 should fail.
# gazonk does query-read-texts-old on foo and 10, 11 and 12. 10 should fail.
# gazonk does <FIXME (bug 590)> on foo and 10, 11 and 12. 10 should fail.
#
# gazonk examines bar.
#
# gazonk does get-unread-confs of bar. Should return undefined-person.
# gazonk does get-membership of bar. Should return undefined-person.
# gazonk does get-membership-old of bar. Should return undefined-person.
# gazonk does query-read-texts on bar and 10, 11 and 12. undefined-person.
# gazonk does query-read-texts-old on bar and 10, 11 and 12. undefined-person.
# gazonk does <FIXME (bug 590)> on bar and 10, 11 and 12. undefined-person.
#
# gazonk examines citrus.
#
# gazonk does get-unread-confs of citrus. Should return the empty list.
# gazonk does get-membership of citrus. Should return 4 { 6 11 12 }.
# gazonk does get-membership-old of citrus. Should return 4 { 6 11 12 }.
# gazonk does query-read-texts on citrus and 10, 11 and 12. 10 should fail.
# gazonk does query-read-texts-old on citrus and 10, 11 and 12. 10 fails.
# gazonk does <FIXME (bug 590)> on citrus and 10, 11 and 12. 10 should fail.
#
# foo writes a text with secret, rd-prot and public as recipients.
#
#
# foo examines foo
#
# foo does get-unread-confs of foo. Should return 3 { 10 11 12 }.
# ... & copy from above
#
# gazonk examines foo
#
# gazonk does get-unread-confs of foo. Should return 2 { 11 12 }.
# ... & copy from above
#
# gazonk examines bar
#
# gazonk does get-unread-confs of bar. Should return undefined-person.
# ... & copy from above
#
# gazonk examines citrus.
#
# gazonk does get-unread-confs of citrus. Should return the empty list.
# ... & copy from above
#
# mark as read
#
# foo marks the text as read
# bar marks the text as read
# gazonk marks the text as read
# citrus marks the text as read
#
# foo examines foo.
#
# foo does get-unread-confs of foo. Should return the empty list.
# foo does get-membership of foo. Should return 4 { 6 10 11 12 }.
# foo does get-membership-old of foo. Should return 4 { 6 10 11 12 }.
# foo does query-read-texts on foo and 10, 11 and 12. Should get results.
# foo does query-read-texts-old on foo and 10, 11 and 12. Should get results.
# foo does <FIXME (bug 590)> on foo and 10, 11 and 12. Should get results.
#
# gazonk examines foo.
#
# gazonk does get-unread-confs of foo. Should return the empty list.
# gazonk does get-membership of foo. Should return 4 { 6 11 12 }.
# gazonk does get-membership-old of foo. Should return 4 { 6 11 12 }.
# gazonk does query-read-texts on foo and 10, 11 and 12. 10 should fail.
# gazonk does query-read-texts-old on foo and 10, 11 and 12. 10 should fail.
# gazonk does <FIXME (bug 590)> on foo and 10, 11 and 12. 10 should fail.
#
# gazonk examines bar.
#
# gazonk does get-unread-confs of bar. Should return undefined-person.
# gazonk does get-membership of bar. Should return undefined-person.
# gazonk does get-membership-old of bar. Should return undefined-person.
# gazonk does query-read-texts on bar and 10, 11 and 12. undefined-person.
# gazonk does query-read-texts-old on bar and 10, 11 and 12. undefined-person.
# gazonk does <FIXME (bug 590)> on bar and 10, 11 and 12. undefined-person.
#
# gazonk examines citrus.
#
# gazonk does get-unread-confs of citrus. Should return the empty list.
# gazonk does get-membership of citrus. Should return 4 { 6 11 12 }.
# gazonk does get-membership-old of citrus. Should return 4 { 6 11 12 }.
# gazonk does query-read-texts on citrus and 10, 11 and 12. 10 should fail.
# gazonk does query-read-texts-old on citrus and 10, 11 and 12. 10 fails.
# gazonk does <FIXME (bug 590)> on citrus and 10, 11 and 12. 10 should fail.
# Shut down.
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