summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoriphydf <iphydf@users.noreply.github.com>2020-05-17 12:36:34 +0100
committeriphydf <iphydf@users.noreply.github.com>2020-05-17 12:41:00 +0100
commitfe8e0fb8fa46a815e89e3722a7c92b35181c2ce8 (patch)
tree4dadb4824ce110da41182bcb33545ba3772050ed
parent3d601fe32066619f50297cb52131d1bbf5e6862e (diff)
Fix tcp_relay_test by adding a second bootstrap node.
This is a non-hermetic network test. initramfs node is down, so let's have a second one for redundancy.
-rw-r--r--auto_tests/tcp_relay_test.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/auto_tests/tcp_relay_test.c b/auto_tests/tcp_relay_test.c
index fcb1fdef..b904055d 100644
--- a/auto_tests/tcp_relay_test.c
+++ b/auto_tests/tcp_relay_test.c
@@ -7,7 +7,14 @@
7#include "../testing/misc_tools.h" 7#include "../testing/misc_tools.h"
8#include "check_compat.h" 8#include "check_compat.h"
9 9
10static uint8_t const key[] = { 10static uint8_t const key1[] = {
11 0x02, 0x80, 0x7C, 0xF4, 0xF8, 0xBB, 0x8F, 0xB3,
12 0x90, 0xCC, 0x37, 0x94, 0xBD, 0xF1, 0xE8, 0x44,
13 0x9E, 0x9A, 0x83, 0x92, 0xC5, 0xD3, 0xF2, 0x20,
14 0x00, 0x19, 0xDA, 0x9F, 0x1E, 0x81, 0x2E, 0x46,
15};
16
17static uint8_t const key2[] = {
11 0x3F, 0x0A, 0x45, 0xA2, 0x68, 0x36, 0x7C, 0x1B, 18 0x3F, 0x0A, 0x45, 0xA2, 0x68, 0x36, 0x7C, 0x1B,
12 0xEA, 0x65, 0x2F, 0x25, 0x8C, 0x85, 0xF4, 0xA6, 19 0xEA, 0x65, 0x2F, 0x25, 0x8C, 0x85, 0xF4, 0xA6,
13 0x6D, 0xA7, 0x6B, 0xCA, 0xA6, 0x67, 0xA4, 0x9E, 20 0x6D, 0xA7, 0x6B, 0xCA, 0xA6, 0x67, 0xA4, 0x9E,
@@ -23,10 +30,15 @@ int main(void)
23 Tox *tox_tcp = tox_new_log(opts, nullptr, nullptr); 30 Tox *tox_tcp = tox_new_log(opts, nullptr, nullptr);
24 tox_options_free(opts); 31 tox_options_free(opts);
25 32
26 tox_bootstrap(tox_tcp, "tox.initramfs.io", 33445, key, nullptr); 33 tox_bootstrap(tox_tcp, "78.46.73.141", 33445, key1, nullptr);
34 tox_bootstrap(tox_tcp, "tox.initramfs.io", 33445, key2, nullptr);
27 35
28 Tox_Err_Bootstrap tcp_err; 36 Tox_Err_Bootstrap tcp_err;
29 tox_add_tcp_relay(tox_tcp, "tox.initramfs.io", 33445, key, &tcp_err); 37 tox_add_tcp_relay(tox_tcp, "78.46.73.141", 33445, key1, &tcp_err);
38 ck_assert_msg(tcp_err == TOX_ERR_BOOTSTRAP_OK,
39 "attempting to add tcp relay returned with an error: %d",
40 tcp_err);
41 tox_add_tcp_relay(tox_tcp, "tox.initramfs.io", 33445, key2, &tcp_err);
30 ck_assert_msg(tcp_err == TOX_ERR_BOOTSTRAP_OK, 42 ck_assert_msg(tcp_err == TOX_ERR_BOOTSTRAP_OK,
31 "attempting to add tcp relay returned with an error: %d", 43 "attempting to add tcp relay returned with an error: %d",
32 tcp_err); 44 tcp_err);