Commit Graph

1144 Commits

Author SHA1 Message Date
Nick Mathewson
6ed5733169 Fix another test failure
We need the test scripts to become +x *after* they are created.
2015-04-28 10:47:37 -04:00
Yawning Angel
915c7438a7 Add "ADD_ONION"/"DEL_ONION" and "GETINFO onions/*" to the controller.
These commands allow for the creation and management of ephemeral
Onion ("Hidden") services that are either bound to the lifetime of
the originating control connection, or optionally the lifetime of
the tor instance.

Implements #6411.
2015-04-28 10:19:08 -04:00
Nick Mathewson
63a90f2df4 Mark set-test-permissions as .PHONY; use u+x only 2015-04-24 16:10:34 -04:00
Nick Mathewson
f6167f51ac Revert "Add +x to these .in files; see if it helps"
This reverts commit ecf98313d6.

It didn't help.
2015-04-24 16:05:41 -04:00
Nick Mathewson
d579d751dc Kludge include.am to work with automake <1.12
The SH_LOG_COMPILER feature doesn't work with older automakes, and
those are still in use in many environments we want to support
development on, like Debian Stable.

Instead, use autoconf substitution to fill out the shebang lines on
the shell scripts, and an intermediate make target to make them
executable.

This is a bugfix on the patches for #15344.  Bug not in any released
tor.
2015-04-24 08:41:53 -04:00
Nick Mathewson
ecf98313d6 Add +x to these .in files; see if it helps 2015-04-23 16:15:21 -04:00
Nick Mathewson
54000d7ad9 Merge remote-tracking branch 'dgoulet/bug14847_027_06' 2015-04-23 12:24:35 -04:00
Nick Mathewson
9b6e57290f Fix crash-test for assertion failure
When we made assertions not get compiled in for the coverage case, we
missed one case where, for our tests, we really DO want to have an
assertion fail: the backtrace test.

Bugfix on 1228dd293b60a8eaab03472fa29428c5e2752c44; bug not in any
released tor
2015-04-23 10:25:16 -04:00
cypherpunks
0e89abfa73 Integrate backtrace test into the automake test suite.
For this to work bt_test.py now returns an exit code indicating success or
failure. Additionally, check-local and its specific dependencies are now
obsolete so they are removed.
2015-04-23 09:56:25 -04:00
cypherpunks
c535494238 Integrate ntor test into the automake test suite. 2015-04-23 09:56:16 -04:00
cypherpunks
21e2425307 Integrate zero_length_keys test into the automake test suite.
The zero length keys test now requires the path to the Tor binary as the first
parameter to ensure the correct Tor binary is used without hard coding a path.

The wrapper script calls the zero length keys test for each test separately to
ensure the correct shell is used (as configured by autoconf). Another solution
would have been to place the tests into separate functions so multiple tests
could be run internally. This would have made a diff of considerable size and
frankly it is outside the scope of this fix.
2015-04-23 09:56:12 -04:00
Nick Mathewson
01d988d72f Merge remote-tracking branch 'teor/bug-15642-v3-fallback-unit-tests' 2015-04-23 09:22:16 -04:00
Nick Mathewson
647b7d37c2 Merge remote-tracking branch 'public/bug15745_027_03' 2015-04-23 09:10:35 -04:00
Nick Mathewson
3acee61422 Merge branch 'feature15652_squashed' 2015-04-23 09:09:33 -04:00
Nick Mathewson
55118d90ca Fix some implicit conversion warnings 2015-04-23 09:09:20 -04:00
Yawning Angel
196499da73 Use a custom Base64 encoder with more control over the output format. 2015-04-23 09:06:58 -04:00
teor
d68bbb0a29 Unit tests for consider_adding_dir_servers() as modified in #15642
Unit tests for the 10 valid combinations of set/NULL config options
DirAuthorities, AlternateBridgeAuthority, AlternateDirAuthority,
and FallbackDir.

Add assertion in consider_adding_dir_servers() for checks in
validate_dir_servers():
"You cannot set both DirAuthority and Alternate*Authority."
2015-04-23 00:16:04 +10:00
David Goulet
dd07c78524 Test: fix HSFETCH control command with latest change
The expected message of the command now expects "650+" and "650 OK".

Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-04-21 14:22:54 -04:00
David Goulet
28cf9f2186 Control: unbolt rend_data from HS desc event
The HS_DESC event was using rend_data_t from the dir connection to reply the
onion address and authentication type. With the new HSFETCH command, it's
now possible to fetch a descriptor only using the descriptor id thus
resulting in not having an onion address in any HS_DESC event.

This patch removes rend_query from the hs desc control functions and replace
it by an onion address string and an auth type.

On a successful fetch, the service id is taken from the fetched descriptor.
For that, an extra parameter is added to "store as a client" function that
contains the cache entry stored.

This will make the control event functions scale more easily over time if
other values not present in rend_data_t are needed since the rend_data from
the dir connection might not contained everything we need.

Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-04-21 14:22:54 -04:00
David Goulet
7db58445fd Control: add HS_DESC_CONTENT event
As defined in section 4.1.26 in the control-spec.txt, this new event replies
the content of a successfully fetched HS descriptor. This also adds a unit
test for the controller event.

Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-04-21 14:15:02 -04:00
Yawning Angel
9a9ab455a3 Use correct severity in the get_if_addrs tests. 2015-04-21 16:42:07 +00:00
Nick Mathewson
e48ad353a3 Add test for random-int-in-range 2015-04-21 11:41:31 -04:00
teor
af2b6bdaba Fix spaces in crypto.h and test-memwipe.c 2015-04-15 19:42:41 +10:00
Yawning Angel
e891deb021 Disable the udp_socket_trick_blackbox tests that fail due to #12377
Till someone writes get_interface_address6 interface enumeration that is
routing table aware, these tests will continue to fail on certain
systems because the get_interface_address6() code is broken.
2015-04-10 18:13:34 +00:00
Nick Mathewson
f9327848ba Collect badness values in ntor_ref.py; don't just clobber.
Fixes bug 15591; patch from joelanders
2015-04-09 11:57:55 -04:00
Sebastian Hahn
e10e6f78b1 Update entrynodes unit test for dirs
We no longer base our opinion on whether someone is a directory solely
on the routerstatus we might have for that relay, but also on a
routerinfo. Remove logic in test checking that. This broke unit tests in
05f7336624.

Reported by toralf on #tor-dev, thanks!
2015-04-01 21:10:39 +02:00
Nick Mathewson
cd8f13b5cb Merge branch 'bug13736' 2015-04-01 13:46:50 -04:00
Nick Mathewson
aa7b792250 Merge remote-tracking branch 'yawning/feature15435' 2015-04-01 13:34:14 -04:00
Nick Mathewson
1ac3cb4823 work around lack of AF_CCITT 2015-03-31 15:56:52 -04:00
Nick Mathewson
02c3879f87 Merge remote-tracking branch 'teor/ticket15431-event-mask-tests' 2015-03-31 14:57:04 -04:00
Nick Mathewson
725d6157df fix some compilation warnings 2015-03-31 14:42:01 -04:00
Nick Mathewson
30e933b136 Merge branch 'ticket14710_squashed' 2015-03-31 14:37:09 -04:00
rl1987
33fbb5011d Use tor_inet_pton() (not inet_pton()) in testcases. 2015-03-31 14:37:02 -04:00
rl1987
5e759127f8 Remove unused function. 2015-03-31 14:37:02 -04:00
rl1987
b5f84fde49 IPv6 case for whitebox test. 2015-03-31 14:37:02 -04:00
rl1987
a4f89e21a6 Whitebox test for get_interface_address6_via_udp_socket_hack().
Also, fix some whitespace mishaps.
2015-03-31 14:37:02 -04:00
rl1987
c03493ad13 Skipping the AF_INET6 case because bug #12377 makes it fail. 2015-03-31 14:37:02 -04:00
rl1987
6af471f394 Rework the black box test, like Yawning and nickm suggested. 2015-03-31 14:37:01 -04:00
rl1987
a13f944314 Black box test for get_interface_address6_via_udp_socket_hack(). 2015-03-31 14:36:35 -04:00
Yawning Angel
fda61e030e Implement "TOR_PT_EXIT_ON_STDIN_CLOSE".
Background processes spawned by Tor now will have a valid stdin.
Pluggable transports can detect this behavior with the aformentioned
enviornment variable, and exit if stdin ever gets closed.
2015-03-26 12:55:12 +00:00
Nick Mathewson
dde4ffeb97 Merge remote-tracking branch 'dgoulet/bug15377_027_01' 2015-03-24 16:27:27 -04:00
David Goulet
2dc5d790d3 Test: add missing libor.a in include.am
Also add test-memwipe to .gitignore file.

Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-03-24 16:04:30 -04:00
Nick Mathewson
9e80fc8171 Merge remote-tracking branch 'sebastian/coverage_builds' 2015-03-24 15:16:49 -04:00
Nick Mathewson
8f951d0196 Put an upper bound on test_workqueue -I argument
This makes coverity happy, since it doesn't like us looping against
a value which might be INT_MAX.

This is CID 1268069
2015-03-24 10:49:29 -04:00
Sebastian Hahn
1a50cb88e6 Fix test-network.sh argument parsing
The bash on one of my machines didn't understand the question mark
correctly, it didn't end up accepting flavor. We can spell it out
explicitly.
2015-03-22 09:43:50 +01:00
teor
99c10a95e4 Add unit tests for control_event_is_interesting()
Part of ticket 15431, checks for bugs similar to 13085.
2015-03-22 14:24:41 +11:00
Sebastian Hahn
1228dd293b Disable assertions during coverage builds
This removes roughly 5000 branches in my testing. We never want to
trigger assertions even during tests, so this is sane. Implements #15400.
2015-03-21 02:34:44 +01:00
Nick Mathewson
e82e600d6e Here is a test for memwipe.
It invokes undefined behavior, I'm afraid, since there's no other
c-legal way to test whether memwipe() works when we're not allowed to
look at it.

Closes ticket 15377.
2015-03-19 18:47:24 -04:00
cypherpunks
17cbc4350f Use output variables instead of relative paths.
Fixes the following rules in out-of-tree builds;
- check-spaces
- check-docs
- check-logs
- Doxygen
- coverage-html

And cleans up additional directories;
- coverage_html
- doc/doxygen
2015-03-14 13:00:04 -04:00
Nick Mathewson
511ca9b91c Remove DynamicDHGroups as obsoleted by PluggableTransports or P256.
Closes ticket 13736.
2015-03-14 12:40:55 -04:00