Commit ee5db3eb authored by David Byers's avatar David Byers

Bug fixes, more testing support and documentation updates

parent 7cf3b8e0
1999-01-18 David Byers <davby@ida.liu.se>
* src/server/testsuite/tcpconnect.py (fdset): Accep
* src/server/testsuite/config/unix.exp (suspend_client): New
function. Suspends reading from lyskomd.
(resume_client): New function. Resumes reading.
* src/server/testsuite/.cvsignore: Added .da, .bb, .bbg and .da
files.
* src/libraries/libansi/.cvsignore: Added .da, .bb, .bbg and .da
files.
* src/libraries/libmisc/.cvsignore: Added .da, .bb, .bbg and .da
files.
1999-01-17 David Byers <davby@ida.liu.se>
* src/server/conference.c: Don't allow change to forbid_secret if
there are secret members.
* src/server/testsuite/tcpconnect.py (fdset): Added command
#suspend socket to stop the relay from reading from the socket, to
simulate a communications failure of sorts. Added #resume socket
to reopen communications.
1999-01-16 David Byers <davby@ida.liu.se>
* src/server/debug.c: New file.
(get_memory_info): Moved here from admin.c.
* src/server/Makefile.am (ATOMS): Added debug.c
* src/server/person.c (create_person_generic): Don't autologin
unless do_auto_login is true
(create_person_old): Set do_auto_login to true in call to
create_person_generic.
(create_person): Set do_auto_login to false in call to
create_person_generic.
* src/server/connections.c (logout_client): Send async logout if
the session is not logged in.
1999-01-15 David Byers <davby@ida.liu.se>
* src/server/send-async.c (async_new_name): Send new-name only to
clients with the appropriate privileges.
* src/server/membership.c (fast_access_perm): Only check priv bits
if the viewer is ACTPERS or ACT_P
(access_perm): Ditto.
* src/server/manipulate.h (ENA_C): New macro.
* configure.in: New argument --with-optimization
* src/server/conference.c (legal_name): Set err_stat when
......
......@@ -232,16 +232,17 @@ and flex version 2.5.4 or later.
3. DATABASE VERSIONS -- you may have to convert the database
------------------------------------------------------------
lyskomd version 1.9.0 uses a new improved file format for the
database. If you have been running earlier versions of lyskomd you
must convert the database by issuing the following command:
lyskomd version 2.0.0 uses a new file format for the database. If you
have been running earlier versions of lyskomd you must convert the
database by issuing the following command:
dbck -o 1 -F
dbck -o 2 -F
You must, of course, use version 1.9.0 or later of dbck to do the
You must, of course, use version 2.0.0 or later of dbck to do the
conversion. You can convert back the database to the old format with
dbck -o 0 -F
dbck -o 1 -F (for lyskomd version 1.9.0)
dbck -o 0 -F (for ancient lyskomd versions)
4. BUILDING -- the details
--------------------------
......
This diff is collapsed.
1990-11-25 ceder@lysator.liu.se 000056
----------------------------------------------------------------------
]tg{rdas av:
Program: server
Till version:
----------------------------------------------------------------------
Det b|r finnas n}got s{tta att st{nga av asynkrona meddelanden (t ex
n{r man k|r r}tt).
----------------------------------------------------------------------
1991-02-15 ceder@Lysator.LiU.SE 000070
----------------------------------------------------------------------
]tg{rdas av:
Program: server
Till version:
Orsak:
----------------------------------------------------------------------
add_recipient med m}nga flera skickar ej ut n}got asynkront meddelande.
----------------------------------------------------------------------
1991-02-15 ceder@Lysator.LiU.SE 000069
----------------------------------------------------------------------
]tg{rdas av:
Program: server
Till version:
Orsak:
----------------------------------------------------------------------
Det ska, genom att g|ra g|ra add_recipient, g} att {ndra en recpt till
cc_recpt (och inte bara }t andra h}llet). En mottagare ska, precis som
nu, inte f} vara b}de recpt och cc_recpt.
----------------------------------------------------------------------
1991-02-08 ceder@Lysator.LiU.SE 000068
----------------------------------------------------------------------
]tg{rdas av:
Program: server
Till version:
Orsak:
----------------------------------------------------------------------
kom_info, som bl a inneh}ller motd_of_lyskom, sparas inte. N{r man
startar om servern {r all info gl|md.
----------------------------------------------------------------------
1991-12-16 ceder@Lysator.LiU.Se 000074
----------------------------------------------------------------------
]tg{rdas av: ceder
......
......@@ -38,42 +38,6 @@ man borde f}tt "G} till n{sta m|te" f|ljt av "L{sa n{sta text".
----------------------------------------------------------------------
1991-02-15 ceder@Lysator.LiU.SE 000070
----------------------------------------------------------------------
]tg{rdas av:
Program: server
Till version:
Orsak:
----------------------------------------------------------------------
add_recipient med m}nga flera skickar ej ut n}got asynkront meddelande.
----------------------------------------------------------------------
1991-02-15 ceder@Lysator.LiU.SE 000069
----------------------------------------------------------------------
]tg{rdas av:
Program: server
Till version:
Orsak:
----------------------------------------------------------------------
Det ska, genom att g|ra g|ra add_recipient, g} att {ndra en recpt till
cc_recpt (och inte bara }t andra h}llet). En mottagare ska, precis som
nu, inte f} vara b}de recpt och cc_recpt.
----------------------------------------------------------------------
1991-02-08 ceder@Lysator.LiU.SE 000068
----------------------------------------------------------------------
]tg{rdas av:
Program: server
Till version:
Orsak:
----------------------------------------------------------------------
kom_info, som bl a inneh}ller motd_of_lyskom, sparas inte. N{r man
startar om servern {r all info gl|md.
----------------------------------------------------------------------
1991-02-05 linus@Lysator.LiU.SE 000067
----------------------------------------------------------------------
]tg{rdas av:
......@@ -182,17 +146,6 @@ Till version:
Det borde finnas ett s{tt att markera en region av en text.
----------------------------------------------------------------------
1990-11-25 ceder@lysator.liu.se 000056
----------------------------------------------------------------------
]tg{rdas av:
Program: server
Till version:
----------------------------------------------------------------------
Det b|r finnas n}got s{tta att st{nga av asynkrona meddelanden (t ex
n{r man k|r r}tt).
----------------------------------------------------------------------
1990-11-23 ceder@lysator.liu.se 000055
----------------------------------------------------------------------
]tg{rdas av:
......
......@@ -2,7 +2,7 @@
@c
@c FIXME: Explain how the garb works with nice and keep-commented
@c
@c $Id: Protocol-A.texi,v 1.51 1999/01/15 11:16:04 byers Exp $
@c $Id: Protocol-A.texi,v 1.52 1999/01/18 11:55:10 byers Exp $
@c %**start of header
@setfilename protocol-a.info
@settitle LysKOM Protocol A
......@@ -900,7 +900,7 @@ list this should be the email address of the list. For other conferences
we haven't really defined a sensible use.
When this aux-item is set on the server it shold contain the email
address of the administrator (or administrators).
address of the administrator (or administrators.)
This aux-item can only be set by the supervisor of a conference or the
server administrator. The creator cannot be hidden.
......@@ -1253,8 +1253,8 @@ protocol-dependent. Protocol A servers will reply with the string
After connecting, calls to the server can be made. Most calls require
the user to log in, but some calls can be made without a log-in. Calls
to the server are made by sending a reference number followed by the
call as specified. The call @i{must} be terminated with a newline
character, but extra newlines @i{within} the call are permitted.
call as specified. The call @i{must} be terminated with a linefeed
character (ASCII 0x0A).
@example
server-call ::=
......@@ -1314,11 +1314,16 @@ while complex data types include things such as conferences and people.
@node Simple Data Types, LysKOM Data Types, Data Types, Data Types
@section Simple Data Types
Data elements are sent from client to server separated by one or more
ASCII spaces (0x20), tab characters (0x09), line feeds (0x0A) or
carriage returns (0x0D.) In messages from server to client the data
elements are separated by exactly one space character and the entire
message terminated with a line feed.
Data elements sent from the client to the server are separated by one or
more space characters (ASCII 32). An entire call is terminated by a
linefeed character (ASCII 10).
Earlier versions of the protocol specified that data elements could be
separated by any number of linefeed (ASCII 10), return (ASCII 13), tab
(ASCII 9) or space (ASCII 32) characters. Servers should be forgiving
and understand requests using the older conventions, but clients must
conform to the current convention of separating data elements with
spaces and terminating all requests with a linefeed character.
@subsection Integers
......@@ -3174,7 +3179,8 @@ be made and @code{conference} is the conference in question.
This call may be issued without logging in.
Calling @code{query-read-texts-old} does not require the session to be logged in.
Calling @code{query-read-texts-old} does not require the session to be
logged in.
@i{Example:}
@example
......@@ -3867,6 +3873,12 @@ Not enough permissions or privileges to change the conference type of
conference @code{conf-no}.
@item letterbox
Attempt to change the @code{letterbox} flag.
@item invalid-membership-type
Attemt to change to a conference type that is not compatible with one of
meore members of the conference (for example, attempting to set
@code{forbid-secret} on a conference with a secret member.)<
@code{error-status} is the id of the first person with an incompatible
membership type.
@end table
......@@ -6736,6 +6748,9 @@ The new person will be a member of exactly one conference: the
associated mailbox. That membership will have priority 255 and (of
course) position 0. All flags of the membership will be 0.
Unlike call number 5, this call does not automatically do a visible
login.
@unnumberedsubsubsec Error codes
......@@ -7574,7 +7589,8 @@ of the mailbox conference.
This message is sent when someone logs out. @code{pers-no} is the person
logging out and @code{session-no} is the session in which the person is
logging out.
logging out. This message is also sent when a session disconnects, even
if there is nobody logged on in the session.
......@@ -7925,7 +7941,8 @@ the recipient is not accepting messages at the moment.
@item invalid-membership-type (54)
A requested membership type was not compatible with restrictions set on
the server or on a specific conference. @code{error-status} is
undefined.
undefined unless specifically mentioned in the documentation for a
specific call.
@end table
......
\input texinfo
@c $Id: hacking.texi,v 1.4 1999/01/15 11:16:07 byers Exp $
@c $Id: hacking.texi,v 1.5 1999/01/18 11:55:13 byers Exp $
@c %**start of header
@setfilename hacking.info
@settitle Hacking lyskomd
......@@ -60,7 +60,7 @@ another language under the same conditions as for modified versions.
* Adding Aux-Item Types::
* Modifying an Existing Stored Type::
* Notes::
* Traversing Connections::
* Debugging and Testing::
@end menu
@end ifinfo
......@@ -564,13 +564,14 @@ example, if version 0 and version 1 are the same, only write an
case 1.
@node Notes, Traversing Connections, Modifying an Existing Stored Type, Top
@node Notes, Debugging and Testing, Modifying an Existing Stored Type, Top
@comment node-name, next, previous, up
@chapter Notes
@menu
* Membership Notes::
* Notes for fncdef.txt::
* Traversing Connections::
@end menu
@node Membership Notes, Notes for fncdef.txt, Notes, Notes
......@@ -581,7 +582,7 @@ The @code{position} field in the membership is @i{not} stored. It has to
be set every time a membership is requested for transmission to the
client.
@node Notes for fncdef.txt, , Membership Notes, Notes
@node Notes for fncdef.txt, Traversing Connections, Membership Notes, Notes
@comment node-name, next, previous, up
@section Notes for fncdef.txt
......@@ -637,9 +638,9 @@ Generates @code{prot-a-parse-arg.c} and @code{prot-a-parse-arg.h}.
@end table
@node Traversing Connections, , Notes, Top
@node Traversing Connections, , Notes for fncdef.txt, Notes
@comment node-name, next, previous, up
@chapter Traversing Connections
@section Traversing Connections
Since session 0 is interpreted as the currently active session by
get_conn_by_number it is important to be careful when traversing
......@@ -671,7 +672,189 @@ This code has @code{session} set to a session number before ever
entering the loop.
@node Debugging and Testing, , Notes, Top
@comment node-name, next, previous, up
@chapter Debugging and Testing
We're slowly adding support for debugging and testing lyskomd properly.
@menu
* The Test Suite:: The lyskomd regression test suite.
* Configuration Options:: Debugging options for the configure script.
* Coverage Testing:: How to do coverage testing with gcov.
* Debug Calls:: Special protocol A calls for testing.
@end menu
@node The Test Suite, Configuration Options, Debugging and Testing, Debugging and Testing
@comment node-name, next, previous, up
@section The Test Suite
The lyskomd test suite is in src/server/testsuite. Please extend this
with additional test cases every time you make modifications to the
server. Run the test suite often to make sure that your changes did not
break anything.
The file config/prot-a.exp contains some support for protocol A. Don't
use these functions in test cases. Use them to set up the inital
database and for things tht have to be done, such as logins and enabling
privileges, but that don't need to be tested. Also, don't count on all
the code in prot-a.exp to be fully functional. Add new functions to this
file as you see fit.
The basic structure of a test case is the following:
@example
source "config/prot-a.exp"
read_versions
lyskomd_start
client_start 0
talk_to client 0
kom_connect "DejaGnu test suite"
@i{The test cases}
talk_to client 0
kom_logout
kom_login 5 [holl "gazonk"] 0
kom_enable 255
send "9999 44 0\n"
simple_expect "=9999"
client_death 0
lyskomd_death
@end example
Use the existing test cases as templates.
@node Configuration Options, Coverage Testing, The Test Suite, Debugging and Testing
@comment node-name, next, previous, up
@section Configuration Options
There are several testing and debugging-related configuration options
for lyskomd. Some of them also apply to libisc.
@table @code
@item --with-purify
Build lyskomd with Purify. This currently does not work.
@item --with-efence
Build lyskomd with Electric Fence for checking buffer overruns. This
option does work.
@item --with-checker
Build lyskomd with Gnu Checker for checking memory accesses, leaks, file
descriptors and all kinds of stuff. As of Checker version 0.99.6, Gnu
Checker cannot deal with lyskomd. Once built, and this requires
modifications to Checker (at least on Linux) it reports spurious errors.
Still, the option is here for those who want to try it out.
@item --with-gcov
Build lyskomd with instrumentation for @code{gcov}. You have to use this
option if you want to run @code{gcov} on lyskomd. For @code{gcov} to be
effective, you should turn off optimization as well.
@item --with-optimization=@i{value}
Build lyskomd with the specified level of optimization. Use either
numeric values to select the level of optimization, or say
@code{--with-optimization=no} or @code{--without-optimization} to turn
optimization off.
@end table
@node Coverage Testing, Debug Calls, Configuration Options, Debugging and Testing
@comment node-name, next, previous, up
@section Coverage Testing
When you write new code, make sure that it is completely covered by the
test suite. Run the lyskomd configure script with the
@code{--with-gcov}, @code{--with-debug-calls} and
@code{--without-optimization} flags to instrument the server for
coverage testing with gcov.
If you run configure without the @code{--without-optimization} option,
the server will be compiled with optimizations on. This is fine, but the
coverage data from gcov isn't completely reliable since parts of the
program may have been optimized out of existance.
Recompile everything, then run the test suite. Next do @code{gcov -f }
@i{filename} to compute coverage information for the file @i{filename}.
The resulting file @i{filename}@code{.gcov} shows which lines have been
executed, and which haven't been run. Try to get 100% coverage.
@node Debug Calls, , Coverage Testing, Debugging and Testing
@comment node-name, next, previous, up
@section Debug Calls
Run the configure script with @code{--with-debug-calls} to compile in
support for debugging calls in the server. These calls are strictly for
making testing easier (or possible.) They are not official, and they may
change at any time.
@menu
* memory-info:: Get information from malloc (1000)
* set-marks:: Set the number of marks on a text (1001)
* backdate-text:: Change the creation date of a text (1002)
@end menu
@node memory-info, set-marks, Debug Calls, Debug Calls
@comment node-name, next, previous, up
@subsection memory-info (DEBUG) Experimential
@findex memory-info
@example
memory-info [1000] ( )
-> (( arena : INT32;
ordblks : INT32;
smblks : INT32;
hblks : INT32;
hblkhd : INT32;
usmblks : INT32;
fsmblks : INT32;
uordblks : INT32;
fordblks : INT32;
keepcost : INT32; ));
@end example
This call returns the data returned by @code{mallinfo} in the server.
See the man page for @code{mallinfo} for explanations of the fields.
@node set-marks, backdate-text, memory-info, Debug Calls
@comment node-name, next, previous, up
@subsection set-marks (DEBUG) Experimental
@findex set-marks
@example
set-marks [1001] (( text-no : Text_no;
no-of-marks : INT32; ))
-> ( );
@end example
Set the number of marks on text @code{text-no} to @code{no-of-marks},
regardless of how many marks it really has. This call is useful for
forcing the database into a state where the number of marks is incorrect
in some way.
@node backdate-text, , set-marks, Debug Calls
@comment node-name, next, previous, up
@subsection backdate-text (DEBUG) Experimental
@findex backdate-text
@example
backdate-text [1002] (( text-no : Text_no;
seconds : INT32; ))
-> ( );
@end example
Backdate a text in the server. Change the creation date of text
@code{text-no} so it appears to have been created @code{seconds} earlier
than it was actually created. This can be used to test the garbage
collector.
@contents
@bye
......
/*
* $Id: services.h,v 0.41 1999/01/15 11:16:09 byers Exp $
* $Id: services.h,v 0.42 1999/01/18 11:55:14 byers Exp $
* Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -719,6 +719,15 @@ KOM_( query_predefined_aux_items(Number_list *result));
#ifdef DEBUG_CALLS
extern Success
KOM_ ( get_memory_info(Memory_info *result));
extern Success
KOM_ ( set_marks(Text_no text_no, unsigned long no_of_marks));
extern Success
KOM_ (backdate_text(Text_no text_no,
unsigned long seconds));
#endif
......
.deps
Makefile
Makefile.in
*.da
*.bb
*.bbg
*.gcov
.deps
Makefile
Makefile.in
*.da
*.bb
*.bbg
*.gcov
1999-01-18 David Byers <davby@ida.liu.se>
* src/.cvsignore: Added .bbg, .bb, .da and .gcov files.
1999-01-15 David Byers <davby@ida.liu.se>
* configure.in: Added --with-checker, --with-gcov and
......
.deps
Makefile
Makefile.in
*.da
*.bb
*.bbg
*.gcov
.deps
Makefile
Makefile.in
*.da
*.bb
*.bbg
*.gcov
.deps
Makefile
Makefile.in
*.da
*.bb
*.bbg
*.gcov
1999-01-18 David Byers <davby@ida.liu.se>
* .cvsignore: Added .da, .bb, .bbg and .gcov files.
1998-07-09 Per Cederqvist <ceder@lysator.liu.se>
* Makefile.in: No longer kept under version control.
......
......@@ -18,3 +18,8 @@ updateLysKOM
version-info.c
version.incl
prot-a-is-legal-fnc.incl
*.da
*.bbg
*.bb
*.gcov
bb.out
# $Id: Makefile.am,v 1.10 1999/01/15 11:16:11 byers Exp $
# $Id: Makefile.am,v 1.11 1999/01/18 11:55:21 byers Exp $
# Copyright (C) 1998 Lysator Academic Computer Association.
#
# This file is part of the LysKOM server.
......@@ -83,7 +83,7 @@ MUX = mux.c mux-parse.c
# Implementations of the atomic calls.
ATOMS = text.c membership.c person.c conference.c session.c admin.c \
regex-match.c aux-items.c
regex-match.c aux-items.c debug.c
# These files are needed by all versions of the LysKOM server.
GENOBJS = connections.c log.c $(ATOMS) \
......
/*
* $Id: admin.c,v 0.31 1999/01/15 11:16:12 byers Exp $
* $Id: admin.c,v 0.32 1999/01/18 11:55:22 byers Exp $
* Copyright (C) 1991, 1993, 1994, 1995, 1996 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -33,7 +33,7 @@
#endif
static const char *
rcsid = "$Id: admin.c,v 0.31 1999/01/15 11:16:12 byers Exp $";
rcsid = "$Id: admin.c,v 0.32 1999/01/18 11:55:22 byers Exp $";
#include "rcs.h"
USE(rcsid);
......@@ -395,38 +395,3 @@ get_collate_table (String * result)
result->len = COLLAT_TAB_SIZE;
return OK;
}
#ifdef DEBUG_CALLS
extern Success
get_memory_info (Memory_info *result)
{
struct mallinfo info;
#ifdef HAVE_MALLINFO
info = mallinfo();
result->arena = info.arena;
result->ordblks = info.ordblks;
result->smblks = info.smblks;
result->hblks = info.hblks;
result->hblkhd = info.hblkhd;
result->usmblks = info.usmblks;
result->fsmblks = info.fsmblks;
result->uordblks = info.uordblks;
result->fordblks = info.fordblks;
result->keepcost = info.keepcost;
#else
result->arena = 0;
result->ordblks = 0;
result->smblks = 0;
result->hblks = 0;
result->hblkhd = 0;
result->usmblks = 0;
result->fsmblks = 0;
result->uordblks = 0;
result->fordblks = 0;
result->keepcost = 0;
#endif
return OK;
}
#endif
/*
* $Id: conference.c,v 0.43 1999/01/15 11:16:15 byers Exp $
* $Id: conference.c,v 0.44 1999/01/18 11:55:23 byers Exp $
* Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -35,7 +35,7 @@
static const char *
rcsid = "$Id: conference.c,v 0.43 1999/01/15 11:16:15 byers Exp $";
rcsid = "$Id: conference.c,v 0.44 1999/01/18 11:55:23 byers Exp $";
#include "rcs.h"
USE(rcsid);
......@@ -1053,12 +1053,18 @@ extern Success
set_conf_type (Conf_no conf_no,
Conf_type type )
{