aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_dir.c
AgeCommit message (Collapse)Author
2024-02-28Merge branch 'maint-0.4.8'Alexander Færøy
2024-02-01Update test stringsSebastian Hahn
2024-01-30bwauth: Allow "node_id" KeyValue without "$"juga
Allow "node_id" KeyValue without the dollar sign at the start of the hexdigit in the BandwidthFiles, in order to easier database queries combining Tor documents in which the relays fingerprint doesn't include it. Bugfix on all supported versions of Tor. Closes #40891
2023-11-21bwauth: Allow "node_id" KeyValue without "$"juga
Allow "node_id" KeyValue without the dollar sign at the start of the hexdigit in the BandwidthFiles, in order to easier database queries combining Tor documents in which the relays fingerprint doesn't include it. Bugfix on all supported versions of Tor. Closes #40891
2023-10-05Fix the spelling of maxunmeasur(e)dbw.Nick Mathewson
This has been misspelled when using consensus method 31 or later since 0.4.6.1-alpha. Fixes bug 40869.
2023-10-05Whoops: test the "wrong" name for maxunmeasurdbw (sic).Nick Mathewson
Now that we never use an earlier consensus method, our tests actually hit this, and we find that we have misspelled "maxunmeasurdbw" (sic) in dirvote.c. I have opened ticket #40869 to track this misspelling.
2023-10-05Update consensus methods in dir_umbw tests.Nick Mathewson
These tests had previously listed methods that we no longer support.
2021-11-09Move published_on from routerstatus_t to vote_routerstatus_t.Nick Mathewson
Nothing breaks here, since all non-voting users of routerstatus_t.published_on have been adjusted or removed in previous commits. We have to expand the API of routerstatus_format_entry() a bit, though, so that it can always get a published time as argument, since it can't get it from the routerstatus any more. This should have no effect on voter behavior.
2021-10-24fetch missing bridge descriptors without delayRoger Dingledine
Without this change, if we have a working bridge, and we add a new bridge, we will schedule the fetch attempt for that new bridge descriptor for three hours(!) in the future. This change is especially needed because of bug #40396, where if you have one working bridge and one bridge whose descriptor you haven't fetched yet, your Tor will stall until you have successfully fetched that new descriptor -- in this case for hours. In the old design, we would put off all further bridge descriptor fetches once we had any working bridge descriptor. In this new design, we make the decision per bridge based on whether we successfully got *its* descriptor. To make this work, we need to also call learned_bridge_descriptor() every time we get a bridge descriptor, not just when it's a novel descriptor. Fixes bug 40396. Also happens to fix bug 40495 (redundant descriptor fetches for every bridge) since now we delay fetches once we succeed. A side effect of this change is that if we have any configured bridges that *aren't* working, we will keep trying to fetch their descriptors on the modern directory retry schedule -- every couple of seconds for the first half minute, then backing off after that -- which is a lot faster than before.
2021-07-06Merge branch 'maint-0.4.5' into maint-0.4.6George Kadianakis
2021-07-01Suppress a clang 12 warning about "suspicious concatenation".Nick Mathewson
My clang doesn't like it when we write code like this: char *list[] = { "abc", "def", "ghi" "jkl" } It wonders whether we meant to put a comma between "ghi" and "jkl" or not, and gives a warning. To suppress this warning (since in this case, we did mean to omit the comma), we just wrap the two strings in parentheses. Closes #40426; bugfix on 0.4.0.4-rc.
2021-03-12Update copyrights to 2021, using "make update-copyright"Nick Mathewson
2021-02-22Merge remote-tracking branch 'tor-gitlab/mr/319'Nick Mathewson
2021-02-22relay: Reduce streaming compression ratio from HIGH to LOWDavid Goulet
Fixes #40301 Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-02-19hs-v2: Removal of service and relay supportDavid Goulet
This is unfortunately massive but both functionalities were extremely intertwined and it would have required us to actually change the HSv2 code in order to be able to split this into multiple commits. After this commit, there are still artefacts of v2 in the code but there is no more support for service, intro point and HSDir. The v2 support for rendezvous circuit is still available since that code is the same for the v3 and we will leave it in so if a client is able to rendezvous on v2 then it can still transfer traffic. Once the entire network has moved away from v2, we can remove v2 rendezvous point support. Related to #40266 Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-11-12Fix typos.Samanta Navarro
Typos found with codespell. Please keep in mind that this should have impact on actual code and must be carefully evaluated: src/core/or/lttng_circuit.inc - ctf_enum_value("CONTROLER", CIRCUIT_PURPOSE_CONTROLLER) + ctf_enum_value("CONTROLLER", CIRCUIT_PURPOSE_CONTROLLER)
2020-10-16Regenerate extample_extrainfo.inc and adjust tests.Nick Mathewson
2020-10-16Regenerate complete failing_routerdescs.inc and adjust tests accordingly.Nick Mathewson
2020-10-16Fix formats_rsa_ed25519 tests.Nick Mathewson
The "protos" field is mandatory, and so are Ed25519 signatures. Also, remove formats_rsa (the version without Ed25519), since RSA-only relays are no longer supported.
2020-10-16Add pr= lines to test_dir_clip_unmeasured*.Nick Mathewson
2020-10-16Fix a couple of routerstatus-based tests.Nick Mathewson
2020-09-17Rename tor_cert_create to tor_cert_create_ed25519Nick Mathewson
This is an automated commit, generated by this command: ./scripts/maint/rename_c_identifier.py \ tor_cert_create tor_cert_create_ed25519 It was generated with --no-verify, so it probably breaks some commit hooks. The commiter should be sure to fix them up in a subsequent commit.
2020-07-23Merge branch 'remove-padding-fix-7869-v2'Nick Mathewson
2020-07-23Remove padding from ntor-onion-key #7869Daniel Pinto
2020-07-14addr: Use tor_addr_t instead of uint32_t for IPv4David Goulet
This changes a LOT of code but in the end, behavior is the same. Unfortunately, many functions had to be changed to accomodate but in majority of cases, to become simpler. Functions are also removed specifically those that were there to convert an IPv4 as a host format to a tor_addr_t. Those are not needed anymore. The IPv4 address field has been standardized to "ipv4_addr", the ORPort to "ipv4_orport" (currently IPv6 uses ipv6_orport) and DirPort to "ipv4_dirport". This is related to Sponsor 55 work that adds IPv6 support for relays and this work is needed in order to have a common interface between IPv4 and IPv6. Closes #40043. Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-04-29Run "make autostyle"teor
2020-03-19coverity: Silence spurious unreachable warningteor
Closes bug 33641; not in any released version of tor.
2020-03-17Conditionally disable part of dir/param_voting_lookup that expects soft ↵rl1987
asserts to happen
2020-03-06Also skip dir/purpose_needs_anonymity_returns_true_by_default when ↵rl1987
ALL_BUGS_ARE_FATAL
2020-03-05Merge branch 'clang_format_prep_3'Nick Mathewson
2020-02-24Rename voting_schedule_*() functions.Nick Mathewson
This is an automated commit, generated by this command: ./scripts/maint/rename_c_identifier.py \ voting_schedule_recalculate_timing dirauth_sched_recalculate_timing \ voting_schedule_get_start_of_next_interval voting_sched_get_start_of_interval_after \ voting_schedule_get_next_valid_after_time dirauth_sched_get_next_valid_after_time
2020-02-24Move voting_schedule.[ch] to src/feature/dirauth/Nick Mathewson
2020-02-06circuitbuild: expect bug message that clang-format will generate.Nick Mathewson
clang-format wants to put no space here, so we need to tell the test to expect a lack of a space.
2020-01-17Merge branch 'ticket32806'Nick Mathewson
2020-01-16Merge branch 'ticket32695_squashed'Nick Mathewson
2020-01-16Remove functions that checked for pre-ipv6 consensus.Nick Mathewson
We no longer need or need to test: * node_awaiting_ipv6() * networkstatus_consensus_has_ipv6().
2020-01-16Remove support for now-obsolete consensus methods before 28.Nick Mathewson
Closes ticket 32695.
2020-01-09Merge branch 'disable_ns_macro'Nick Mathewson
2020-01-09Merge branch 'ticket22029_attempt_squashed'Nick Mathewson
2020-01-09Add dirserv_load_fingerprint_file() testNeel Chauhan
2020-01-09Remove all usage of the NS*() macros in test*.cNick Mathewson
This is an automatically generated commit, made with the following kludgey perl script. It results in a number of wide lines, which I'll clean up in a subsequent commit. #/usr/bin/perl -w -i $mod = "NS_MODULE"; $submod = "NS_SUBMODULE"; $last_was_empty = 0; while (<>) { s/\bASPECT\(\s*(\w+)\s*,\s*(\w+)\s*\)/$1_$2/; if (/# *define +NS_MODULE +(\w+)/) { $mod = $1; next; } elsif (/# *define +NS_SUBMODULE +(\w+)/) { $submod = $1; next; } next if (/#undef NS_(SUB)?MODULE/); s/NS\(\s*test_main\s*\)/test_${mod}_${submod}/; s/NS\(\s*(\w+)\s*\)/${mod}_${submod}_$1/g; s/NS_FULL\(\\s*(\w+)\s*,\s*(\w+),\s*(\w+)\s*\)/$1_$2_$3/; s/^(\s*)NS_MOCK\(\s*(\w+)\s*\)/$1MOCK($2,\n$1 ${mod}_${submod}_$2)/; s/NS_UNMOCK\(\s*(\w+)\s*\)/UNMOCK($1)/; s/TEST_CASE\(\s*(\w+)\s*\)/{ "$1", test_${mod}_$1, TT_FORK, NULL, NULL }/; s/TEST_CASE_ASPECT\(\s*(\w+)\s*,\s*(\w+)\s*\)/{ "$1_$2", test_${mod}_$1_$2, TT_FORK, NULL, NULL }/; s/NS_DECL\(\s*([^,]+)\s*,\s*([^,]+)\s*,\s*(\(.*)\);/static $1 ${mod}_${submod}_$2$3;\nATTR_UNUSED static int ${mod}_${submod}_$2_called = 0;/; s/\bCALLED\(\s*(\w+)\s*\)/${mod}_${submod}_$1_called/; if (/^$/) { print if (! $last_was_empty); $last_was_empty = 1; } else { $last_was_empty = 0; print; } if (eof) { $mod = "NS_MODULE"; $submod = "NS_SUBMODULE"; $last_was_empty = 0; } } # Please enter the commit message for your changes. Lines starting # with '#' will be kept; you may remove them yourself if you want to. # An empty message aborts the commit. # # Date: Thu Jan 9 10:26:10 2020 -0500 # # On branch disable_ns_macro # Changes to be committed: # modified: src/test/test_accounting.c # modified: src/test/test_compat_libevent.c # modified: src/test/test_dir.c # modified: src/test/test_dir_handle_get.c # modified: src/test/test_dns.c # modified: src/test/test_options.c # modified: src/test/test_procmon.c # modified: src/test/test_rendcache.c # modified: src/test/test_router.c # modified: src/test/test_routerset.c # modified: src/test/test_status.c # modified: src/test/test_tortls.c # modified: src/test/test_tortls_openssl.c # modified: src/test/test_util_format.c # modified: src/test/test_util_process.c # # Untracked files: # experiments/ # locate_options.sh # un_ns.pl # # Please enter the commit message for your changes. Lines starting # with '#' will be kept; you may remove them yourself if you want to. # An empty message aborts the commit. # # Date: Thu Jan 9 10:26:10 2020 -0500 # # On branch disable_ns_macro # Changes to be committed: # modified: src/test/test_accounting.c # modified: src/test/test_compat_libevent.c # modified: src/test/test_dir.c # modified: src/test/test_dir_handle_get.c # modified: src/test/test_dns.c # modified: src/test/test_options.c # modified: src/test/test_procmon.c # modified: src/test/test_rendcache.c # modified: src/test/test_router.c # modified: src/test/test_routerset.c # modified: src/test/test_status.c # modified: src/test/test_tortls.c # modified: src/test/test_tortls_openssl.c # modified: src/test/test_util_format.c # modified: src/test/test_util_process.c # # Untracked files: # experiments/ # locate_options.sh # un_ns.pl #
2020-01-09Put all NS_DECL invocations on single lines.Nick Mathewson
This is going to make my script happier; these lines will soon disappear.
2020-01-09Always define NS_MODULE and NS_SUBMODULE when NS is used.Nick Mathewson
When these macros aren't defined, the expansions of the NS macros can get particularly ugly.
2020-01-08It's 2020. Update the copyright dates with "make update-copyright"Nick Mathewson
2019-12-20Code Style: Delete PRIVATE defines that are never usedteor
Some ".c" files define *_PRIVATE macros, but those macros are not used in any header file. Delete them. These changes were created using the "make autostyle" from 32522, and then split into commits.
2019-12-19Move TestingDirVote{Exit,Guard,HSdir}{,IsStrict} to dirauth moduleNick Mathewson
2019-10-26Rename confparse.[ch] identifiers to confmgt.[ch] identifiers.Nick Mathewson
This is an automated commit, generated by this command: ./scripts/maint/rename_c_identifier.py \ confparse.h confmgt.h \ confparse.c confmgt.c \ CONFPARSE_PRIVATE CONFMGT_PRIVATE \ TOR_CONFPARSE_H TOR_CONFMGT_H
2019-10-24Merge remote-tracking branch 'tor-github/pr/1447'teor
2019-10-23Tidy whitespace around some STMT_BEGINs and STMT_ENDsteor
2019-10-22Re-run make autostyle.Nick Mathewson