Commit Graph

47 Commits

Author SHA1 Message Date
Liam Fitzgerald
6c90331fc7 tests: update for less slog noise 2023-09-29 16:27:07 +01:00
Liam Fitzgerald
352130a545 ames: update tests to cover encrypted remote scry 2023-09-29 15:50:15 +01:00
Liam Fitzgerald
792d42d9cc pill: update solid 2023-09-26 14:19:07 +01:00
Liam Fitzgerald
ab3a4b05f8 Merge remote-tracking branch 'origin/jb/chum' into lf/back-to-school-arc 2023-09-26 10:10:31 +01:00
fang
34148f9f44 eyre: allow PUTting empty channel-request list
Previously, we would reject this with a 400 error. Considering the
request body is expected to contain "array of requests" and that arrays
may be empty, we really should not be rejecting the requests.

Prior to 156ca21472, sending the empty array would have been convenient
for channel creation. Empty arrays getting rejected forced clients to
inject a faux poke (commonly hi-ing oneself). With that recent change,
the most common case for wanting to PUT the empty list of requests is
largely obsolete, but one can still imagine it being useful for clients
that want to keep their channel alive without necessarily being
connected to it. This also implements sloppier clients from running into
400 responses when they submit an empty "command queue" for whatever.

Regardless, there seems to be no clear reason why the empty request list
_shouldn't_ be accepted and processed as normal.

We add a small test to ensure eyre accepts this.
2023-09-19 19:12:25 +03:00
fang
4affae8181 eyre: GETting non-existent channels creates them
Previously, a channel could only be created by sending a PUT request,
and a GET request to receive the channel's stream would only succeed
after channel creation had happened that way. This forces client
libraries, that generally have an explicit "set up" step before allowing
normal operation, to do strange things, like sending faux pokes
(commonly hi-ing oneself) before connecting to the channel's stream as
normal.

Here, we update the GET request handling for channels to allow requests
for non-existent channels. When this happens, the channel will be
created, and eyre tracks the request as normal.

We do some... gentle restructuring... of +on-get-request:by-channel to
let the new creation case share code with the "already exists" codepath.
In the process, we find that duct-to-key was never getting updated in
the case where we replace the original channel request/connection with
the new incoming one. We fix this, it's trivial. We also identify two
other areas with vaguely-incorrect behavior, but consider them less
important and out of scope.

We also add a test case for "create channel through GET".
2023-09-19 19:12:25 +03:00
fang
b427c9e800 eyre: serve 503 if bound agent is not running
Previously, for endpoints bound to agents, we would pass the request
onto the agent even if the agents wasn't currently running.

Here, we make eyre check to see if the agent is actually running, before
passing the request on. If the bound agent is not running, eyre serves a
503 synchronously instead.

This way, we avoid cluttering up the gall queue for the bound agent.
2023-09-18 15:52:28 +03:00
Liam Fitzgerald
12c9e64297 temp commit 2023-09-17 15:54:43 +01:00
fang
f87871f0c1
tests: update eyre tests with new wire format
See also a9e3ebb
2023-08-11 11:48:23 +02:00
fang
c33ddfa101
Merge branch 'next/kelvin/412' into m/eyre-mirage 2023-06-26 13:47:39 +02:00
fang
41048b21e2
tests: update for new eauth architecture
Tag names have been changed, communication direction is now
client->host, and other changes which heavily affect the tests.
2023-06-16 21:20:20 +02:00
Tinnus Napbus
7c3a1c4d7c Merge branch 'next/kelvin/412' into tinnus/local-provenance 2023-06-07 20:38:05 +12:00
Ted Blackman
fc5598718b Merge branch 'develop' into next/kelvin/412 2023-06-06 12:50:11 -04:00
yosoyubik
385ede5c89 tests: remove misleading comment 2023-06-05 15:43:55 +02:00
yosoyubik
7b15f5c022 ames: fix tests 2023-06-05 11:41:39 +02:00
yosoyubik
6696f587be Merge branch 'next/kelvin/412' into i/6103/abet-pure 2023-06-01 17:46:36 +02:00
yosoyubik
8b518f4bfe Merge branch 'develop' into next/kelvin/412 2023-06-01 17:39:42 +02:00
Tinnus Napbus
0105be6459 Merge branch 'develop' into tinnus/local-provenance 2023-05-31 12:52:53 +12:00
Tinnus Napbus
df53148183 tests: change sock to sack 2023-05-30 23:38:26 +12:00
yosoyubik
96e3bdcf11 Merge branch 'develop' into i/6103/abet-pure 2023-05-30 10:38:39 +02:00
yosoyubik
4f27ac7329 ames: use %deep task in test-nack 2023-05-30 10:33:13 +02:00
fang
30cde41800
tests: add ames test for crashing on %boon
To detect regressions of the bug d8e11b6 fixed.
2023-05-23 22:12:21 +02:00
fang
bf64e94ca3
tests: expand eyre eauth tests
For the server case, we add tests for http-first finalization, incorrect
eauth tokens, attempt expiration, client abort signalling, and client
deletion requests.

For the client case, we add a test for approving eauth attempts without
being locally authenticated.

To this end, we refactor the layout of the eauth tests. The +eauth core
now contains the tasks/gifts to be handled by the client/server, but no
longer does move checking. This happens within the test arms only. This
way, we may trivially re-run parts of the eauth flow under different
conditions.
2023-05-23 20:32:24 +02:00
Tinnus Napbus
2ba8e45fd2 tests: fix tests for provenance 2023-05-23 01:55:55 +12:00
fang
a6acfe3c93
tests: add based happy-path eauth tests 2023-05-19 19:25:04 +02:00
fang
3347e84811
eyre: rename authentication-state to auth
Only in the $server-state type, the lull typename remains unchanged (for
now). "authentication-state" is just such a mouthful!
2023-05-19 11:32:07 +02:00
fang
dd41df7d7c
tests: make eyre tests build & succeed again 2023-05-19 11:09:11 +02:00
fang
b8ff52d79a
tests: remove trailing whitespace in eyre tests 2023-05-16 21:47:23 +02:00
fang
637992475b
eyre: refactor guest name generation
Concatenating before we truncate, instead of truncating the entropy by
itself, is slightly simpler.

Because this slightly changes the naming algorithm, we must update the
eyre tests to match.
2023-05-16 21:46:48 +02:00
Philip Monk
c3dc248b30 Merge remote-tracking branch 'origin/m/the-open-eyre' into philip/mare 2023-05-11 11:19:25 -07:00
fang
466fc0b63b
eyre: pass session-id+identity into auth handling
This lets it also clean up guest sessions created just for the login
request, and lets us display the current guest identity on the login
page.
2023-05-09 15:10:14 +02:00
yosoyubik
b154c62fdc ames, tests: remove extraneous comments 2023-05-09 11:43:54 +02:00
Philip Monk
8910e12f67 eyre: refactor tests
This shaves off 1000 lines of testing code while maintaining the same
tests.  It reduces boilerplate by introducing "mare", a monad for
testing Eyre.  It's very simple (just maintains the current state of
Eyre and the current time), but it's easier to build helper functions in
this form, and that reduces the immense quantities of copy-and-paste
that were in the old tests.  What's there now could surely be improved
further, but I think this is a good start.

The underlying mare machinery is not really specific to Eyre, so it
would be straightforward to apply this strategy to other vanes.  The
work is in creating appropriate helper functions for each vane.  Eyre is
undergoing work, so that's the only one I've changed here.  Further,
it's not clear that this is the ultimate solution to unit testing vanes.
The resulting code is IMO clearer than before, but I wouldn't say it's
*clear*.
2023-05-08 20:40:28 -07:00
fang
67799c77e0
tests: update eyre tests for guest sessions
Unauthenticated requests now also create sessions. This affects most
HTTP request handling tests.

The situation here is not ideal, and worsening over time. Worth spending
some time to think about how to best refactor the Eyre tests to make
them more manageable and easier to maintain.
2023-05-08 19:10:00 +02:00
yosoyubik
f53fee723a ames: defer mutual calls between |pump and |sink
|pump and |sink call into each other in three places
related to nacks and naxplanations (sending a nack,
notifying the |pump of a naxplanation, or dropping a
nack from the |sink). This intra calls are making implicit
updates to more parts of the state than the core should
manage. To avoid that we emit a move to %arvo, encoded
as an %ames plea, to handle that in the next event.
2023-05-08 15:28:13 +02:00
~wicrum-wicrun
6355b84d35 tests: use @uxyowl instead of @uxmeow 2023-04-24 19:56:24 +02:00
~wicrum-wicrun
738b17d0ca tests: remove .siz from $meow 2023-04-24 17:48:00 +02:00
yosoyubik
fc22926ed6 tests: fix rift/life in ames/fine tests 2023-04-23 09:40:57 +02:00
Ted Blackman
84cd948f30 Merge branch 'next/kelvin/413' into i/5788/remote-scry 2023-04-22 14:33:20 -04:00
yosoyubik
d259656e29 lull: clean up remote scry namespace missmatches
(note: first pass, subject to change)
2023-04-22 10:57:49 +02:00
Joe Bryan
3eeca101ac test: fixes ames tests (broken due to $roar refactoring) 2023-04-21 13:16:59 -04:00
fang
4bc88f2825
tests: patch eyre tests for channel modes
Since the tests call arms from eyre directly, these had to be updated
alongside it, to now specify the channel mode in light of which the
request should be parsed.

Includes smoke tests for jam-mode channels.
2023-04-12 19:33:05 +02:00
yosoyubik
5f2eb383c7 tests: make /test/sys/ames pass 2023-04-06 13:44:45 +02:00
yosoyubik
dd0f35c8ad Merge branch 'm/contdist-and-behn' into i/5788/remote-scry 2023-03-21 18:01:17 +01:00
yosoyubik
3963b0a951 ames: fix test-nack
previously we were acking the nack-trace message (adding a %send move)
before notifying the message-pump with a %near task. Now, due to the
refactoring we invert the order of those moves. This seems safe but will
determine with livenet testing
2023-02-22 14:45:44 +01:00
fang
92066f3a33
Merge branch 'develop' into m/http-auth-tokens 2023-02-06 19:44:01 +01:00
fang
e888960370
tests: move to root, out of pkg/arvo
Including these in pkg/arvo has caused many minor problems over the
years. We don't want to include them in releases, but this often meant
excluding them manually, which was error-prone.

Here, we move them out of /pkg/arvo/tests and into /tests. CI will have
to be updated to match, since we'll still want to include tests there.
2023-01-18 16:50:42 +01:00