Commit Graph

551 Commits

Author SHA1 Message Date
iphydf
cc99ecd43a
Stop hard-coding packet IDs in tests. 2020-05-04 02:14:56 +01:00
iphydf
02a5bdc60c
Add logging to TCP and onion client. 2020-05-04 01:27:36 +01:00
iphydf
88b90c8225
Fix a bug in savedata loading when malloc fails.
Also added a bunch of asserts to tests where they don't check allocs.
2020-05-03 14:13:48 +00:00
iphydf
2570ddcb17
Fix errors on error paths found by oomer.
* Use-after-free because we free network before dht in one case.
* Various unchecked allocs in tests (not so important).
* We used to not check whether ping arrays were actually allocated in DHT.
* `ping_kill` and `ping_array_kill` used to crash when passing NULL.

Also:
* Added an assert in all public API functions to ensure tox isn't NULL.
  The error message you get from that is a bit nicer than "Segmentation
  fault" when clients (or our tests) do things wrong.
* Decreased the sleep time in iterate_all_wait from 20ms to 5ms.
  Everything seems to still work with 5ms, and this greatly decreases
  the amount of time spent per test run, making oomer run much faster.
2020-05-02 21:47:08 +01:00
zugz (tox)
8816e50ed7
Skip invalid TCP relays and DHT nodes when loading save data 2020-04-26 00:00:00 +00:00
iphydf
7c0eb5c70b
Enable TCP relay test in Bazel and autotools build.
This test was fixed by @robinlinden, but not enabled in all builds.
2020-04-20 09:28:00 +00:00
Robin Linden
7f9f8045cd
Fix things not being initialized if creating a TCP-only network 2020-04-13 22:43:51 +02:00
iphydf
4b73607b6f
Fixes towards building on MSVC. 2020-03-29 02:56:09 +00:00
iphydf
44e13956ef
Mark conference test as small.
This used to take a long time, but is now very fast.
2020-03-27 14:51:45 +00:00
zugz (tox)
db07bda7f7
Add "member" invite response
This allows invitations to work in the case that the invitee is already
in the group, which can happen if the group becomes split. Such an
invitation is automatically accepted, leading to the peers becoming
connected in the group and sharing peer lists.
2020-03-18 00:00:00 +00:00
iphydf
52696a0686
Add another bootstrap node to the bootstrap test.
Hopefully not both will be down at the same time.
2020-03-15 23:53:59 +00:00
iphydf
11ad5471b9
Use spdx license identifier instead of GPL blurb. 2020-03-14 13:06:19 +00:00
zugz (tox)
c644ef7681
use -1 rather than ~0 in unsigned integer types
Using ~0 involves a bitwise operation on int, so depends on
the internal representation of signed integers.
2020-03-14 00:00:02 +00:00
iphydf
e671490989
Use rules_cc instead of native cc_library rules. 2020-03-12 12:20:54 +00:00
iphydf
0f7138c010
Upgrade bazel to 2.1.1.
Removed av_test, because it depends on an ancient opencv that starts to
really not exist on modern systems anymore.
2020-03-02 14:23:44 +00:00
sudden6
1b7d7b66c5
synchronize call control actions to tox_iterate 2020-01-02 11:58:42 +01:00
Robin Linden
79748dd9e5
Allow Bazel to rerun tests marked as flaky 2019-11-17 01:24:02 +01:00
Robin Linden
f6235b5f8d
Update tests to use a working bootstrap node 2019-11-02 15:35:21 +01:00
zugz (tox)
306dd1f21f
add configurable limit on number of stored frozen peers 2019-05-19 18:51:28 +02:00
sudden6
b3100c977c
add undef guard in tox_many_tcp_test
This fixes an redefinition error when creating amalgamation.cc during
static analysis
2019-05-01 14:24:46 +02:00
zugz (tox)
efff822aef
Disable failing TCP server test
The test's intermittent failure may well be exposing a real bug in the
TCP relay and/or onion systems, but we can't find the bug, and keeping
the test is disrupting our CI.
2019-04-01 19:43:32 +02:00
zugz (tox)
959f468eac
add API function to test whether av is enabled 2019-02-10 00:00:00 +00:00
zugz (tox)
49e2406ffa
Expose api functions for enabling and disabling AV in AV groups
A group loaded from a savefile starts with AV disabled.
2019-02-10 00:00:00 +00:00
zoff99
78bc9e7403
Added test and patch for VLA stack overflow vuln.
Also added and used the new crypto_malloc and crypto_free.

The latter also zeroes out the memory safely. The former only exists for
symmetry (static analysis can detect asymmetric usages).
2019-01-03 11:13:27 +00:00
zugz (tox)
9770880e97
Implement conferences saving
* add global friend_connection status callback, used for group rejoining
* stop leaving groups on killing tox
2018-11-29 21:52:23 +01:00
zugz (tox)
caca350f43
Avoid format truncation in save compatibility test
(without this, gcc-8.2.0 issues a warning)
2018-11-23 18:09:45 +01:00
zugz (tox)
744dc2f5da
Make saving and loading the responsibility of Tox rather than Messenger 2018-10-20 11:03:10 +02:00
zugz (tox)
4dd86f1f29
ensure save data unchanged after save and load 2018-10-11 00:21:39 +02:00
iphydf
605dfe882c
Consistently use camel case enum names.
Including in tests and implementation files.
2018-10-09 17:33:37 +00:00
iphydf
b2b96b1aa1
Avoid use of IPv6 in tests if not supported (e.g. on Travis). 2018-10-06 21:27:02 +00:00
iphydf
4f266f913d
Use a working DHT node for bootstrap tests.
A lot of bootstrap nodes are down :(.
2018-09-25 21:19:07 +00:00
zugz (tox)
e43b2eadc0
Send rejoin packets on conference disconnection
We were mistakenly not making a rejoin attempt on freezing connections
due to all closest connections going down. This fixes that, and tweaks
the test. I've still only done tens rather than hundreds of tests, but
I'm fairly confident that the conference test now consistently passes.
2018-09-20 22:30:28 +02:00
yangfl
d3d5b701cb
Fix typos 2018-09-19 18:16:13 +00:00
iphydf
49bb43f662
Standardise header guards.
Using the full path including the repo name.
2018-09-14 19:09:10 +00:00
hugbubby
0688877fba
Use run_auto_test fixture in typing_test.c 2018-09-14 13:51:41 +00:00
iphydf
d9541d542c
Use (void) for empty parameter lists in C.
Because `()` means "some unknown number of parameters".
2018-09-08 10:59:30 +00:00
zugz
1b2322284f
Add mechanism for recovering from disconnections in conferences
* add freezing and unfreezing of peers
  * add rejoin packet
  * revise handling of temporary invited connections
  * rename "peer kill" packet to "peer leave" packet
  * test rejoining in conference test
  * use custom clock in conference test
2018-09-05 20:56:26 +02:00
iphydf
6872c14e1a
Avoid use of global mutable state in mono_time on win32.
This uses a trick to get read-write access to `this` from a `const`
member function, similar to C++ `mutable`, but uglier.
2018-09-03 20:03:47 +00:00
zugz (tox)
9764285ab1
Use test clock in run_auto_test tests and dht test 2018-08-31 17:08:35 +02:00
zugz (tox)
66ab386d6f
try ipv6 connections even after udp timeout
Also adds a test (auto_reconnect_test) which fails without this change.
2018-08-27 22:27:01 +02:00
iphydf
473cde24d8
Update copyright to 2018. 2018-08-26 18:57:29 +00:00
iphydf
64ddb7fff2
Call abort instead of exit on test failure.
This raises a signal, so we can more easily catch it with gdb.
2018-08-26 13:18:43 +00:00
iphydf
80f8458146
Run save_compatibility_test in the autotools build. 2018-08-25 23:25:15 +00:00
iphydf
17e8195a8f
Fix the PORT_ALLOC failure of save_compatibility_test.
`tox_new_log` has a much larger range of ports it can select from.
2018-08-25 22:28:38 +00:00
iphydf
94b06818fb
Use do-while instead of while in tests.
This forces all the loop bodies to be executed at least once, which is
harmless since it just means one more tox event loop iteration. This
reduces the jitter we see in coverage measurements, which is partially
caused by loops sometimes being entered and sometimes not (because their
condition happens to randomly already be true).
2018-08-25 15:25:33 +00:00
iphydf
853a2a10b1
Stop using massive macros in toxav_basic_test.
Turned a huge macro into a function. Macros are a pain to debug.
2018-08-25 13:46:47 +00:00
zugz (tox)
efcda6c319
Fix auto_tests Makefile
* specify correct source files
* add save_compatibility_test (commented out for now)
* reformat TESTS to one line per test, and set check_PROGRAMS := TESTS
* add run_auto_test.h to EXTRA_DIST
* Fix `AUTO_TEST_CFLAGS` -> `AUTOTEST_CFLAGS`.
2018-08-25 14:30:04 +02:00
endoffile78
76f4ae64b7
Add check to make sure tox was created successfully 2018-08-22 10:12:46 +00:00
iphydf
7aa57afeba
Avoid redefining macros from different files. 2018-08-19 23:15:01 +00:00
iphydf
0fa700b55b
Make the save_compatibility_test work with bazel. 2018-08-19 22:08:02 +00:00