Commit 030f3c9d authored by Per Cederqvist's avatar Per Cederqvist
Browse files

Wrote an outline of the test case.

parent a282eddc
# Test suite for lyskomd.
# Copyright (C) 2001 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.
# Check the aux-item send-comments-to (33).
# There are three major players:
#
# 5. (client 0) The administrator.
# 6. (client 1)
# 7. (client 2)
#
# There are a few major conferences:
#
# 8. Created by 6. Secret. Members: 6.
# 9. Created by 6. Rd-prot. Members: 6.
# 10. Created by 6. Public. Members: 6.
#
# Some texts:
#
# 1. Created by 6. Recipients: 8.
# 2. Created by 6. Recipients: 9.
# 3. Created by 6. Recipients: 10.
# We currently get aux-item-permission (49) instead of illegal-aux-item (48)
# in several places.
proc want_illegal_aux_item {tst} {
global test
global errorcode
set test "$tst"
setup_xfail "*-*-*" "Bug 192"
if {$errorcode == 48} {
pass "$test"
} else {
fail "$test"
}
unset test
}
proc FIXME {} {
setup_xfail "*-*-*" "Bug 308"
fail "testcase not written yet"
}
proc enable {} {
send "990 42 255\n"
simple_expect "=990"
}
proc disable {} {
send "991 42 0\n"
simple_expect "=991"
}
read_versions
lyskomd_start
client_start 0
talk_to client 0
send "A3Hfoo\n"
simple_expect "LysKOM" "connected"
send "1000 62 5 [holl "gazonk"] 1\n"
simple_expect "=1000"
# Populate the database.
client_start 1
talk_to client 1
send "A3Hbar\n"
simple_expect "LysKOM"
send "1001 89 [holl "Person 6"] [holl "pswd6"] 00 0 { }\n"
simple_expect "=1001 6"
send "1002 62 6 [holl "pswd6"] 1\n"
simple_expect "=1002"
client_start 2
talk_to client 2
send "A 10Hfoo@bar.se\n"
simple_expect "LysKOM"
send "1003 89 [holl "Person 7"] [holl "pswd7"] 00 0 { }\n"
simple_expect "=1003 7"
send "1004 62 7 [holl "pswd7"] 1\n"
simple_expect "=1004"
talk_to client 1
send "1005 88 [holl "conf 8"] 0000 0 { }\n"
simple_expect "=1005 8"
send "1006 88 [holl "conf 9"] 1000 0 { }\n"
simple_expect "=1006 9"
send "1007 88 [holl "conf 10"] 1010 0 { }\n"
simple_expect "=1007 10"
# (Test to create a public-secret conf with four-bit conference type.)
send "1008 88 [holl "conf 11"] 0010 0 { }\n"
simple_expect "%1008 22 0"
# (Test to create a public-secret conf using create-conf-old.)
send "1009 10 [holl "conf 11"] 0010\n"
simple_expect "%1009 22 0"
send "1010 86 [holl "text 1"] 1 { 0 8 } 0 { }\n"
simple_expect "=1010 1"
send "1011 86 [holl "text 2"] 1 { 0 9 } 0 { }\n"
simple_expect "=1011 2"
send "1012 86 [holl "text 3"] 1 { 0 10 } 0 { }\n"
simple_expect "=1012 3"
#
# Test send-comments-to
#
# Attempt to set "0" while creating a conference.
# Should fail, since we can only set send-comments-to on letterboxes.
FIXME
# Attempt to set "1" while creating a conference.
# Should fail, since we can only set send-comments-to on letterboxes.
FIXME
# Attempt to set "0" while creating a text.
# Should fail, since we can only set send-comments-to on letterboxes.
FIXME
# Attempt to set "1" while creating a text.
# Should fail, since we can only set send-comments-to on letterboxes.
FIXME
# Attempt to set "0" on server while enabled.
# Should fail, since we can only set send-comments-to on letterboxes.
FIXME
# Attempt to set "1" on server while enabled.
# Should fail, since we can only set send-comments-to on letterboxes.
FIXME
# Attempt to set "0" on an existing conference.
# Should fail, since we can only set send-comments-to on letterboxes.
FIXME
# Attempt to set "1" on an existing conference.
# Should fail, since we can only set send-comments-to on letterboxes.
FIXME
# Attempt to set "0" on an existing text.
# Should fail, since we can only set send-comments-to on letterboxes.
FIXME
# Attempt to set "1" on an existing text.
# Should fail, since we can only set send-comments-to on letterboxes.
FIXME
# Attempt to set "0" while creating a person.
# Should work.
FIXME
# Attempt to set "1" while creating a person.
# Should work.
FIXME
# Attempt to set "99" while creating a person.
# Should fail, because no such conference exists, but because there is
# no mirror aux item (bug 314) this will work.
FIXME
# Attempt to set "8", a secret conference, while creating a person.
# Should fail, because no such conference exists, but because there is
# no mirror aux item (bug 314) this will work.
client_start 3
talk_to client 3
send "A4Hheja\n"
simple_expect "LysKOM"
FIXME
send "1013 1\n"
simple_expect "=1013"
# Attempt to set "9", an rd-prot conference, while creating a person.
# Should work.
FIXME
# Set "10", a secret conference that is visible to the
# administrator. Should fail -- there can be only one send-comments-to.
talk_to client 0
enable
FIXME
# Remove the send-comments-to.
FIXME
# Set "10", a secret conference that is visible to the
# administrator and to person 6. Should work.
FIXME
# Fetch the conference status of person 6. The aux-item should be
# visible.
FIXME
# Fetch the conference status of person 6. The aux-item should be
# visible.
talk_to client 1
FIXME
# Fetch the conference status of person 6. The aux-item should not be
# visible, because conference 10 is secret and person 7 isn't allowed
# to see it.
talk_to client 2
# (Check that the various get-conf-stat* calls really fail.)
send "1014 13 10 0\n"
simple_expect "%1014 9 10"
send "1015 13 10 1\n"
simple_expect "%1015 9 10"
send "1016 50 10\n"
simple_expect "%1016 9 10"
send "1017 91 10\n"
simple_expect "%1017 9 10"
FIXME
# Remove the aux-item.
talk_to client 0
FIXME
# Attempt to set some bad values, including the empty string, negative
# numbers, hexadecimal numbers, whitespace-separated digits, et c.
# They should all fail.
talk_to client 1
FIXME
# Set to "0".
FIXME
# Check visibility for person 6.
FIXME
# Check visibility for person 7.
talk_to client 2
FIXME
# Remove "0".
talk_to client 1
FIXME
# Set to "6".
FIXME
# Check visibility for person 6.
FIXME
# Check visibility for person 7.
talk_to client 2
FIXME
# Remove "6".
talk_to client 0
FIXME
# Set to "8".
talk_to client 1
FIXME
# Check visibility for person 6.
FIXME
# Check visibility for person 7.
talk_to client 2
FIXME
# Remove "8".
talk_to client 1
FIXME
# Set to "9".
FIXME
# Check visibility for person 6.
FIXME
# Check visibility for person 7.
talk_to client 2
FIXME
# Remove "9".
talk_to client 1
FIXME
# Set to "10".
FIXME
# Check visibility for person 6.
FIXME
# Check visibility for person 7. Should not be visible.
talk_to client 2
FIXME
# Remove "10".
talk_to client 1
FIXME
# Attempt to set to "10" on person 7. Should fail, because this is a
# unique aux-item, and person 7 isn't allowed to see conference 10.
# See the 2001-12-12 00:30 entry on bug 25 for more info.
# This will work, due to bug 25 and bug 314.
FIXME
# FIXME: Finally, let the administrator enable and fetch everything,
# to make sure that no stray aux-items (or mirror aux-items) remain.
#
# Shut down
#
talk_to client 0
enable
send "1018 44 0\n"
simple_expect "=1018"
client_death 0
client_death 1
client_death 2
client_death 3
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