[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: Updating the test suite: Shell functions

I'm nearly ready to replace process handling + much result code
handling with functions, unless someone has ideas for improvements.

Can someone address the ITS#3952 questions first?  Ignore the patch,
an "eval" variant of some of these functions.  Afterwards I'll need
someone to test my sql-test* changes.

I guess the Init_testdir() function should be omitted until we
decide what to do about ./run, ./scripts/all etc.

I've removed the --soft option to Check_RC().  (Oops, I called it
Demand_RC() in this thread).

The max sleep time of Wait_slapd() seems less important after all:
Wait_slapd() aborts if slapd died.  It sleeps for max time only if
slapd is hanging (and then the test will hang waiting for slapd
anyway in Kill_all or Kill_named), or if the LDAP operation used to
test slapd fails for some other reason.
I suggest a loop waiting for 0, 1, 2, 3, 4, 5 and maybe 6, 7 seconds
= max 15/21/28 seconds, vs. the current 25 + 5 pointless seconds.
(I don't quite know how a "slowdown factor" variable for the
replication sleeps would best fit into the current logic of this
function, so the simple solution is to defer the problem and keep a
fairly large max for now.  Improvements welcome, now or later.)

I'm a bit dissatisfied the function names Kill_named() and
Check_RC(), but couldn't come up with anything better.

I think I'll rename the '$fV_' prefix - function Variables - to
'$dV_' - default.sh Variables.  As opposed to variables in any
functions in the individual tests.  The deliberately strange prefix
is to avoid name clashes with the callers' current and future
variables.  Also rename pid "name" variables to pid "text", in case
we end up wanting symbolic "names" for pids someday.