IF YOU WOULD LIKE TO GET AN ACCOUNT, please write an
email to Administrator. User accounts are meant only to access repo
and report issues and/or generate pull requests.
This is a purpose-specific Git hosting for
BaseALT
projects. Thank you for your understanding!
Только зарегистрированные пользователи имеют доступ к сервису!
Для получения аккаунта, обратитесь к администратору.
This means less random files dropped in /tmp or similar.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
The usage message says it is dodgy and some test suites may not
support it.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
There is no point inventing a whole new set of options here.
Continue to locally implement the --no-event-scripts option. This
must be first, though in practice only one option is ever passed to
setup_ctdb() from ctdb_test_init().
Simply pass all other options through to "local_daemons.sh setup".
This has the side effect of causing failure when an invalid option is
passed.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
SC2086 Double quote to prevent globbing and word splitting
This one doesn't need the double quotes if it is contained within the
preceding variable expansion.
SC2181 Check exit code directly with e.g. 'if mycmd;', not indirectly with $?
SC2004 $/${} is unnecessary on arithmetic variables
These are straightforward.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
This is only needed for setup_ctdb_base() so only set it when calling
this function.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
The nested, arbitrary use of onnode can cause messages from ssh on
stderr to appear in the node list:
Getting list of nodes...
Output of "onnode -pq all ctdb pnn | grep '^[0-9][0-9]*$'":
Warning: Permanently added '10.0.0.72' (RSA) to the list of known hosts.^M
Warning: Permanently added '10.0.0.75' (RSA) to the list of known hosts.^M
Warning: Permanently added '10.0.0.73' (RSA) to the list of known hosts.^M
Warning: Permanently added '10.0.0.74' (RSA) to the list of known hosts.^M
1
0
3
2
Create/wipe test database rec_test.tdb
Failed to execute "Permanently added '10.0.0.72' (RSA) to the list of known hosts.^M ctdb attach rec_test.tdb" on node(s) "Warning:"
Invalid <nodespec>
Avoid that by using an existing function that does not nest ssh uses.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Direct leak of 256 byte(s) in 8 object(s) allocated from:
#0 0x7f11b90d9c08 in __interceptor_malloc (/lib64/libasan.so.5+0xefc08)
#1 0x7f11b8f395df in tdb_alloc_read ../../../lib/tdb/common/io.c:696
#2 0x7f11b8f290ee in _tdb_fetch ../../../lib/tdb/common/tdb.c:274
#3 0x7f11b8f29379 in tdb_fetch ../../../lib/tdb/common/tdb.c:283
#4 0x473ecc in ltdb_fetch ../../tests/src/fake_ctdbd.c:904
#5 0x478b40 in ltdb_transaction_update ../../tests/src/fake_ctdbd.c:993
#6 0x41fef2 in ctdb_rec_buffer_traverse ../../protocol/protocol_types.c:1656
#7 0x48108b in ltdb_transaction ../../tests/src/fake_ctdbd.c:1026
#8 0x48108b in control_trans3_commit ../../tests/src/fake_ctdbd.c:2878
#9 0x48108b in client_process_control ../../tests/src/fake_ctdbd.c:4147
#10 0x48108b in client_process_packet ../../tests/src/fake_ctdbd.c:3839
#11 0x4847f5 in client_read_handler ../../tests/src/fake_ctdbd.c:3806
#12 0x44f620 in comm_read_done ../../common/comm.c:208
#13 0x7f11b8f94fe8 in _tevent_req_notify_callback ../../../lib/tevent/tevent_req.c:141
#14 0x7f11b8f951fd in tevent_req_finish ../../../lib/tevent/tevent_req.c:193
#15 0x7f11b8f95265 in _tevent_req_done ../../../lib/tevent/tevent_req.c:199
#16 0x44e876 in pkt_read_handler ../../common/pkt_read.c:133
#17 0x44f315 in comm_fd_handler ../../common/comm.c:412
#18 0x7f11b8f92896 in tevent_common_invoke_fd_handler ../../../lib/tevent/tevent_fd.c:138
#19 0x7f11b8fa6937 in epoll_event_loop ../../../lib/tevent/tevent_epoll.c:736
#20 0x7f11b8fa6937 in epoll_event_loop_once ../../../lib/tevent/tevent_epoll.c:937
#21 0x7f11b8f9f53e in std_event_loop_once ../../../lib/tevent/tevent_standard.c:110
#22 0x7f11b8f90f34 in _tevent_loop_once ../../../lib/tevent/tevent.c:772
#23 0x7f11b8f955f1 in tevent_req_poll ../../../lib/tevent/tevent_req.c:300
#24 0x485a04 in start_server ../../tests/src/fake_ctdbd.c:4450
#25 0x485a04 in main ../../tests/src/fake_ctdbd.c:4544
#26 0x7f11b8c60412 in __libc_start_main (/lib64/libc.so.6+0x24412)
Signed-off-by: Swen Schillig <swen@linux.ibm.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Mon Aug 26 10:19:30 UTC 2019 on sn-devel-184
This test has been flapping because sometimes the record is not
vacuumed within the expected time period, perhaps even because the
check for the record can interfere with vacuuming. However, instead
of waiting for vacuuming the record can be cleared by doing a
recovery. This should be much more reliable.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14085
RN: Fix flapping CTDB tests
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Wed Aug 21 13:06:57 UTC 2019 on sn-devel-184
The following test sometimes fails:
==================================================
Running "cluster_mutex_test lock-unlock-lock-unlock ./tests/var/cluster_mutex.lockfile"
--------------------------------------------------
Output (Exit status: 134):
--------------------------------------------------
LOCK
UNLOCK
CONTENTION
NOLOCK
cluster_mutex_test: ../../tests/src/cluster_mutex_test.c:307: test_lock_unlock_lock_unlock: Assertion `dl2->mh != NULL' failed.
--------------------------------------------------
Required output (Exit status: 0):
--------------------------------------------------
LOCK
UNLOCK
LOCK
UNLOCK
FAILED
==========================================================================
TEST FAILED: tests/cunit/cluster_mutex_001.sh (status 1) (duration: 0s)
==========================================================================
This is due to a race in the test. For the first UNLOCK a signal is
sent to the cluster mutex handler but the test tries to retake the
lock before that process is scheduled and the signal is processed.
Therefore, the fcntl() lock is still held and contention is seen.
After unlocking, tests need to wait until the child has gone, so build
this into ctdb_kill(). This is one of the only places where the PID
is accessible.
Outside of testing, on a real system, nothing will never try
to (re)take the lock so quickly.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14085
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Check the record count more often, from multiple nodes. Add a case
with multiple records.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14085
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Use the VNN map from the node running node_has_status().
This means that
wait_until_node_has_status 1 notlmaster 10 0
will run "ctdb status" on node 0 and check (for up to 10 seconds) if
node 1 is in the VNN map.
If the LMASTER capability has been dropped on node 1 then the above
will wait for the VNN map to be updated on node 0. This will happen
as part of the recovery that is triggered by the change of LMASTER
capability. The next command will then only be able to attach to
$TESTDB after the recovery is complete thus guaranteeing a sane state
for the test to continue.
This stops simple/79_volatile_db_traverse.sh from going into recovery
during the traverse or at some other inconvenient time.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14085
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
All the other cases involve matching bits.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14085
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Re-indent and drop non-POSIX left-parenthesis from case labels.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14085
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Should be used when public IP addresses are not assigned.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
If there is a failure it will always be the last test run. Don't
obscure this by following it with a summary.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
These files now pass, so we might as well keep them in good shape.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
This can be used to find ctdb_run_tests and ctdb_local_daemons.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Given other improvements, this is now needlessly complex.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
SC2045 Iterating over ls output is fragile. Use globs.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
SC2034 summary appears unused. Verify use (or export if used externally)
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
SC2155 Declare and assign separately to avoid masking return values
The wscript changes require an identical change in local_daemons.sh.
While touching the lines in wscript, escape the backslashes to make
them literal backslashes.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
SC2164 Use 'cd ... || exit' or 'cd ... || return' in case cd fails
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
SC2086 Double quote to prevent globbing and word splitting
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
These tests currently do not do what is expected. They test the
default case.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
If the lock file is inaccessible or the inode number changes then the
lock is lost, so exit. This allows the recovery daemon to trigger an
election. The ensuing recovery will re-take the lock.
By default the lock file is checked every 60 seconds. A lot can
happen in 60 seconds but being more aggressive and accessing the lock
too often could result in a performance issue for the cluster
filesystem.
An new optional 2nd argument is added, which is the lock file re-check
time in seconds.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Put the checking for the process being immediately re-parented into
the computation too. This will be very rare and doing it
consistently makes testing saner.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>