Skip to content
Snippets Groups Projects
Commit 8f429f67 authored by Per Cederqvist's avatar Per Cederqvist
Browse files

New file.

parent 78f9b838
No related branches found
No related tags found
No related merge requests found
File added
# Test suite for lyskomd.
# Copyright (C) 2001-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.
# Check that the read-text part of a membership can be saved and
# restored.
obtain_lock
unpack_db bug-52
proc start {} {
lyskomd_start "" "Garb: no" "" "" "" [list \
"WARN: [pwd]/db/number.txt: No such file" \
] 0 0 6 21 1
client_start 0
talk_to client 0
send "A3Hfoo\n"
simple_expect "LysKOM"
send "1000 62 5 [holl "gazonk"] 0\n"
simple_expect ":2 9 5 1"
simple_expect "=1000"
}
proc stop {} {
global lyskomd_pid
system "kill -HUP $lyskomd_pid"
lyskomd_death {} signal
client_death 0
dbck_run
}
proc checkit {pos conf prio last arrsize array} {
global any_time
send "1 99 5 $pos 1 0\n"
simple_expect "=1 1 { $pos $any_time $conf $prio $last $arrsize \\* 5 $any_time 00000000 }"
send "2 99 5 $pos 1 1\n"
simple_expect "=2 1 { $pos $any_time $conf $prio $last $arrsize $array 5 $any_time 00000000 }"
send "3 98 5 $conf\n"
simple_expect "=3 $pos $any_time $conf $prio $last $arrsize $array 5 $any_time 00000000"
send "4 46 5 $pos 1 0\n"
simple_expect "=4 1 { $any_time $conf $prio $last $arrsize \\* }"
send "5 46 5 $pos 1 1\n"
simple_expect "=5 1 { $any_time $conf $prio $last $arrsize $array }"
send "6 9 5 $conf\n"
simple_expect "=6 $any_time $conf $prio $last $arrsize $array"
}
start
checkit 0 5 255 0 0 "\\*"
checkit 1 1 100 0 0 "\\*"
checkit 2 2 100 0 0 "\\*"
checkit 3 3 100 0 0 "\\*"
checkit 4 4 100 0 0 "\\*"
stop
start
checkit 0 5 255 0 0 "\\*"
checkit 1 1 100 0 0 "\\*"
checkit 2 2 100 0 0 "\\*"
checkit 3 3 100 0 0 "\\*"
checkit 4 4 100 0 0 "\\*"
send "1000 27 5 1 { 2 }\n"
simple_expect "=1000"
send "1001 27 1 0 { }\n"
simple_expect "=1001"
send "1002 27 2 1 { 1 }\n"
simple_expect "=1002"
send "1003 27 3 2 { 1 2 }\n"
simple_expect "=1003"
send "1004 27 4 2 { 1 3 }\n"
simple_expect "=1004"
checkit 0 5 255 0 1 "{ 2 }"
checkit 1 1 100 0 0 "\\*"
checkit 2 2 100 1 0 "\\*"
checkit 3 3 100 2 0 "\\*"
checkit 4 4 100 1 1 "{ 3 }"
stop
start
checkit 0 5 255 0 1 "{ 2 }"
checkit 1 1 100 0 0 "\\*"
checkit 2 2 100 1 0 "\\*"
checkit 3 3 100 2 0 "\\*"
checkit 4 4 100 1 1 "{ 3 }"
send "1000 27 5 1 { 4 }\n"
simple_expect "=1000"
send "1001 27 1 2 { 2 4 }\n"
simple_expect "=1001"
send "1002 27 2 1 { 2 }\n"
simple_expect "=1002"
send "1003 27 3 2 { 4 3 }\n"
simple_expect "=1003"
send "1004 27 4 2 { 5 6 }\n"
simple_expect "=1004"
checkit 0 5 255 0 2 "{ 2 4 }"
checkit 1 1 100 0 2 "{ 2 4 }"
checkit 2 2 100 2 0 "\\*"
checkit 3 3 100 4 0 "\\*"
checkit 4 4 100 1 3 "{ 3 5 6 }"
stop
start
checkit 0 5 255 0 2 "{ 2 4 }"
checkit 1 1 100 0 2 "{ 2 4 }"
checkit 2 2 100 2 0 "\\*"
checkit 3 3 100 4 0 "\\*"
checkit 4 4 100 1 3 "{ 3 5 6 }"
stop
release_lock
hello
text 1hello
text 2hello
text 3hello
text 4hello
text 5hello
text 6hello
text 7hello
text 8hello
text 9hello
text 10hello
text 11hello
text 12hello
text 13hello
text 14hello
text 15hello
text 16hello
text 17hello
text 18hello
text 19hello
text 20
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment