1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00
Commit Graph

15 Commits

Author SHA1 Message Date
Martin Schwenke
ce5116cfb3 ctdb-tests: Don't expand octal escapes in unit test output
The echo command in dash expands octal escapes in strings by default
but the echo command in bash doesn't.  Since the behaviour is
ill-defined, use printf to handle affected strings.  However, ensure
that these strings aren't used as format strings.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>

Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Tue Mar 27 09:06:14 CEST 2018 on sn-devel-144
2018-03-27 09:06:14 +02:00
Martin Schwenke
27cb5d63d5 ctdb-tests: New function unit_test_notrace()
Avoids valgrind and such, so a function can be passed.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2016-12-19 04:07:08 +01:00
Amitay Isaacs
ec00b49029 ctdb-tests: Display filtered output when the test fails
This simplifies comparing the output to the expected output.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2016-12-16 08:42:32 +01:00
Amitay Isaacs
aa9ca809be ctdb-tests: Add test cleanup hooks
To do any cleanup before exiting the test, register hooks with
test_cleanup().  Multiple hooks can be registered.  All the hooks will
be called before exiting from the test.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2015-07-09 06:23:21 +02:00
Amitay Isaacs
13770f7410 ctdb-tests: Remove extra_header and extra_footer variables
This is now achieved by defining functions extra_header() and
extra_footer().

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2015-07-09 06:23:21 +02:00
Amitay Isaacs
93dc2f0839 ctdb-tests: Add simple test harnesses for running unit tests
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2015-07-09 06:23:21 +02:00
Amitay Isaacs
956d1dbfd9 ctdb-tests: Correctly cascade test failures from the end of pipes
Some eventscript unit test failures get lost because _passed=false is
set in the tail of a pipe.  Add a new function test_fail() and call it
when necessary to ensure the value of _passed is set correctly.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Pair-programmed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Martin Schwenke <martin@meltin.net>

Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Thu Mar  5 07:16:54 CET 2015 on sn-devel-104
2015-03-05 07:16:54 +01:00
Martin Schwenke
3105737c4b ctdb-logging: Change LogLevel to DEBUGLEVEL
For compatibility with current Samba debug.[ch].

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Volker Lendecke <vl@samba.org>
2014-10-06 12:34:33 +02:00
Martin Schwenke
1c8c0be6f9 ctdb-tests: Make the fake log timestamp string easy to modify
Use a variable to allow easy change of this string in case future
logging changes modify the timestamp format or do not support
timestamping.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Volker Lendecke <vl@samba.org>
2014-10-06 12:34:32 +02:00
Michael Adam
90f79bf073 ctdb:tests: ignore SIGPIPE in unit tests
This makes scripts called in the unit tests behave like
when called from ctdbd which ignodes SIGPIPE.
This also makes the scrips behave the same when
called from "make autotest" directly and via autobuild (python).

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2013-11-28 07:31:12 +01:00
Martin Schwenke
8ca117a68e ctdb:tests: Rework unit test result filtering
Using a variable is too fragile, so use a function instead.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-11-27 18:46:17 +01:00
Martin Schwenke
b416376e68 tests: Unit test diff output should use filtered output
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 9721aae001b3023e9c8b4af2b143c0db3442d623)
2013-05-07 16:20:46 +10:00
Martin Schwenke
2d719e5c84 eventscripts: Auto-start/stop services in background
If $CTDB_SERVICE_AUTOSTARTSTOP="yes" then service start/stop is done
in the background with logging.

Fix some unit tests for samba and winbind.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 3a3dae4cb5ec8b4b8381a4013adda25b87641f3a)
2012-10-03 08:48:23 +10:00
Martin Schwenke
116f19b808 tests: More unit test factoring/rationalisation and bug fixes
Move some options from eventscripts/run_tests.sh to scripts/run_tests.
Remove the former.

Move some functions from eventscripts/scripts/local.sh to
scripts/unit.sh.

Both of these are modified during move so they are no longer
eventscript-specific.

Tweak */local.sh so that the new functions in unit.sh are used.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 7ff485687891732074c9fc9998502ca197663d02)
2012-04-18 10:37:45 +10:00
Martin Schwenke
f6178fcc9d tests - add scripts/unit.sh
This will be sourced by all unit tests.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit afdaa5f032938d56ff315d9553cb285ebc413c4c)
2012-04-16 14:57:45 +10:00