Commit Graph

4294 Commits

Author SHA1 Message Date
Jamil
d656cd54f6 chore: remove test lib bash sourcing from customer-run scripts (#4753)
Didn't catch this in code review. These are run on customer's systems
and can't possibly source our shared script.
2024-04-23 19:04:02 +00:00
Jamil
e92eeb6934 feat(website): Add battlecard to landing page (#4744)
Fixes firezone/gtm#227
2024-04-23 16:01:35 +00:00
Thomas Eizinger
98520b2131 chore(snownet): free memory of allocation without valid credentials (#4720)
In https://github.com/firezone/firezone/pull/4537, we fixed a bug that
made an `Allocation` busy-loop with invalid credentials. There is no
point in keeping invalid credentials around so with this PR, we are
clearing the credentials and free the memory associated with this
`Allocation`.

This is another safe-guard to prevent these kind of busy-loops and also
reduces the memory footprint of very long-running services.
2024-04-23 03:41:52 +00:00
dependabot[bot]
e340a02054 build(deps): Bump rustls from 0.22.3 to 0.22.4 in /rust in the cargo group (#4715)
Bumps the cargo group in /rust with 1 update:
[rustls](https://github.com/rustls/rustls).

Updates `rustls` from 0.22.3 to 0.22.4
<details>
<summary>Commits</summary>
<ul>
<li><a
href="ae277befb5"><code>ae277be</code></a>
Prepare 0.22.4</li>
<li><a
href="5374108df6"><code>5374108</code></a>
complete_io: bail out if progress is impossible</li>
<li><a
href="00e695d68d"><code>00e695d</code></a>
Regression test for <code>complete_io</code> infinite loop bug</li>
<li><a
href="0c6cd7ef68"><code>0c6cd7e</code></a>
Don't specially handle unauthenticated close_notify alerts</li>
<li>See full diff in <a
href="https://github.com/rustls/rustls/compare/v/0.22.3...v/0.22.4">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=rustls&package-manager=cargo&previous-version=0.22.3&new-version=0.22.4)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore <dependency name> major version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's major version (unless you unignore this specific
dependency's major version or upgrade to it yourself)
- `@dependabot ignore <dependency name> minor version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's minor version (unless you unignore this specific
dependency's minor version or upgrade to it yourself)
- `@dependabot ignore <dependency name>` will close this group update PR
and stop Dependabot creating any more for the specific dependency
(unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore <dependency name>` will remove all of the ignore
conditions of the specified dependency
- `@dependabot unignore <dependency name> <ignore condition>` will
remove the ignore condition of the specified dependency and ignore
conditions
You can disable automated security fix PRs for this repo from the
[Security Alerts
page](https://github.com/firezone/firezone/network/alerts).

</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-23 01:11:38 +00:00
Andrew Dryga
a666d63051 Add environment variables to allow enabling all features locally 2024-04-22 13:32:52 -06:00
Andrew Dryga
450b647553 Increase CPU utilization alert alignment window 2024-04-22 13:32:51 -06:00
Andrew Dryga
f1375b4a61 Stop sending text messages on alerts 2024-04-22 13:32:51 -06:00
dependabot[bot]
317e995fbd build(deps): Bump time from 0.3.34 to 0.3.36 in /rust (#4730)
Bumps [time](https://github.com/time-rs/time) from 0.3.34 to 0.3.36.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/time-rs/time/releases">time's
releases</a>.</em></p>
<blockquote>
<h2>v0.3.36</h2>
<p>See the <a
href="https://github.com/time-rs/time/blob/main/CHANGELOG.md">changelog</a>
for details.</p>
<h2>v0.3.35</h2>
<p>See the <a
href="https://github.com/time-rs/time/blob/main/CHANGELOG.md">changelog</a>
for details.</p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/time-rs/time/blob/main/CHANGELOG.md">time's
changelog</a>.</em></p>
<blockquote>
<h2>0.3.36 [2024-04-10]</h2>
<h3># Fixed</h3>
<ul>
<li><code>FormatItem</code> can be used as part of an import path. See
<a href="https://redirect.github.com/time-rs/time/issues/675">#675</a>
for details.</li>
</ul>
<p><a
href="https://redirect.github.com/time-rs/time/issues/675">#675</a>: <a
href="https://redirect.github.com/time-rs/time/issues/675">time-rs/time#675</a></p>
<h2>0.3.35 [2024-04-10]</h2>
<h3>Added</h3>
<ul>
<li><code>Duration::checked_neg</code></li>
<li><code>ext::InstantExt</code>, which provides methods for using
<code>time::Duration</code> with <code>std::time::Instant</code></li>
</ul>
<h3>Changed</h3>
<ul>
<li><code>Instant</code> is deprecated. It is recommended to use
<code>std::time::Instant</code> directly, importing
<code>time::ext::InstantExt</code> for interoperability with
<code>time::Duration</code>.</li>
<li><code>FormatItem</code> has been renamed to
<code>BorrowedFormatItem</code>, avoiding confusion with
<code>OwnedFormatItem</code>.
An alias has been added for backwards compatibility.</li>
</ul>
<h3>Fixed</h3>
<ul>
<li>The weekday is optional when parsing RFC2822.</li>
<li>The range of sub-second values in <code>Duration</code> is
documented correctly. The previous documentation
contained an off-by-one error.</li>
<li>Leap seconds are now correctly handled when parsing ISO 8601.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="3c3c546a66"><code>3c3c546</code></a>
<code>pub use</code> instead of <code>pub type</code> re-exporting</li>
<li><a
href="266178da67"><code>266178d</code></a>
Update code coverage CI</li>
<li><a
href="131049ea15"><code>131049e</code></a>
v0.3.35 release</li>
<li><a
href="9c15ee3466"><code>9c15ee3</code></a>
Permit leap seconds when parsing ISO 8601</li>
<li><a
href="d279d8d38f"><code>d279d8d</code></a>
Fix invalid offset hour diagnostic test</li>
<li><a
href="f04a28feec"><code>f04a28f</code></a>
Eliminate unreachable branch</li>
<li><a
href="06a096d821"><code>06a096d</code></a>
Rename <code>FormatItem</code> to <code>BorrowedFormatItem</code></li>
<li><a
href="fd664eef0d"><code>fd664ee</code></a>
Include diagnostics regression</li>
<li><a
href="b8d09a7bcc"><code>b8d09a7</code></a>
Address nightly lints</li>
<li><a
href="330865ac90"><code>330865a</code></a>
Update deny.toml</li>
<li>Additional commits viewable in <a
href="https://github.com/time-rs/time/compare/v0.3.34...v0.3.36">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=time&package-manager=cargo&previous-version=0.3.34&new-version=0.3.36)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Reactor Scram <ReactorScram@users.noreply.github.com>
2024-04-22 16:43:24 +00:00
Jamil
d0702f351a docs: Fix a few typos / wording issues (#4735)
Just a few things I found re-reading through over the weekend.

---------

Signed-off-by: Jamil <jamilbk@users.noreply.github.com>
Co-authored-by: Brian Manifold <bmanifold@users.noreply.github.com>
2024-04-22 16:38:58 +00:00
Thomas Eizinger
e387e3e13d chore(ip-packet): address PR feedback (#4721)
Addressing feedback from #4702.
2024-04-22 16:32:54 +00:00
Jamil
fd2948f5c0 revert: Revert removal of GitHub link in the navbar (#4734)
I was able to fixing spacing / sizing to get the GitHub link in there.
It is still one our main CTAs.
<img width="700" alt="Screenshot 2024-04-22 at 8 30 36 AM"
src="https://github.com/firezone/firezone/assets/167144/44703d82-e0b6-4db8-8c69-0950ff81bc3c">
2024-04-22 15:45:46 +00:00
Jamil
81dfa90f38 docs: Add user/group limit info to Entra connector (#4725)
Clarifies a request from support today.
2024-04-21 03:09:31 +00:00
Jamil
1c2ceaefac docs: Adjust format size based on screen size (#4724)
Updates typography to scale with screen size for docs and website blog.
2024-04-21 03:08:52 +00:00
Jamil
6dfb2ac814 chore(website): revert split-horizon DNS terming (#4703)
Split-horizon isn't entirely accurate. DNS-based routing and Split DNS
describe this feature better.
2024-04-20 01:20:17 -07:00
Jamil
83340b9252 ci: Don't run browser tests on release images (#4722)
Fixes https://github.com/firezone/firezone/actions/runs/8763390111
2024-04-20 00:37:12 -07:00
Gabi
adc0bb73f7 test(client): add reconnection tests from a client using a headless browser (#4569)
Considered using Elixir and Rust to write the tests.

For Elixir, `wallaby` doesn't seem to have a way to attach to an
existing `chromium` instance, launching it each time, which makes it
hard to coordinate with the relay restart.

For Rust we considered `thirtyfour` which would be very nice since we
could test both firefox and chrome but each time it connects to the
instance it launches a new session making it hard to test the DNS cache
behavior.

We also considered `chrome_headless` for Rust it needs a small patch to
prevent it from closing the browser after `Drop` but it still presents a
problem, since it has no easy way to retrieve if loading a page has
succeeded. There are some workarounds such as retrieving the title that
we could have used but after some testing they are quite finnicky and we
don't want that for CI.

So I ended up settling for TypeScript but I'm open to other options, or
a fix for the previous ones!

There are some modifications still incoming for this PR, around the test
name and that sleep in the middle of the test doesn't look good so I
will probably add some retries, but the gist is here, will keep it in
draft until we expect it to be passing.

So feel free to do some initial reviews.

Note: the number of lines changed is greatly exaggerated by
`package.lock`

---------

Signed-off-by: Thomas Eizinger <thomas@eizinger.io>
Co-authored-by: Jamil Bou Kheir <jamilbk@users.noreply.github.com>
Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
2024-04-20 06:57:07 +00:00
Thomas Eizinger
51089b89e7 feat(connlib): smoothly migrate relayed connections (#4568)
Whenever we receive a `relays_presence` message from the portal, we
invalidate the candidates of all now disconnected relays and make
allocations on the new ones. This triggers signalling of new candidates
to the remote party and migrates the connection to the newly nominated
socket.

This still relies on #4613 until we have #4634.

Resolves: #4548.

---------

Co-authored-by: Jamil <jamilbk@users.noreply.github.com>
2024-04-20 06:16:35 +00:00
Jamil
3e457fbd3c Update readme.mdx 2024-04-19 19:37:05 -07:00
Thomas Eizinger
53e0f9be73 refactor(connlib): remove PacketTransform abstraction (#4709)
As a result of moving all logic into `ClientState` and `GatewayState`,
the concrete types of `Peer` are statically known everywhere. Thus, we
can remove this abstraction layer and directly store a `ClientOnGateway`
and `GatewayOnClient` struct in the `PeerStore`.

This makes code-navigation and reasoning easier because one can directly
jump to the function that is being called.

Resolves: #4224.
2024-04-20 00:59:51 +00:00
Thomas Eizinger
0f7e80642d chore(snownet): don't update remote socket from WG activity (#4615)
Resolves: #4613.
2024-04-20 00:15:19 +00:00
Jamil
c8d36a8922 chore(website): Publish macOS client (#4719)
Finally live.
2024-04-19 23:44:10 +00:00
Jamil
0282163e51 chore(docs): Update sizing recs for Gateways (#4708)
Fixes #4690
2024-04-19 21:04:18 +00:00
Jamil
c6c171840d docs: Add common use cases (#4677)
Adds common use cases of Firezone.

---------

Signed-off-by: Jamil <jamilbk@users.noreply.github.com>
Co-authored-by: Reactor Scram <ReactorScram@users.noreply.github.com>
2024-04-19 20:26:21 +00:00
Jamil
5784c1ed5f chore(website): Use sales / sign up for CTA in navbar (#4711)
Fixes #4644 

<img width="291" alt="Screenshot 2024-04-19 at 7 03 39 AM"
src="https://github.com/firezone/firezone/assets/167144/666c2c10-9372-4d02-ae08-a211056e7e27">
2024-04-19 19:55:07 +00:00
Andrew Dryga
7fe043aee0 Increase CPU utilization alert window to reduce alerts noise when portal is rolled out 2024-04-19 13:36:42 -06:00
Andrew Dryga
8fb25d806c Add extra node to run background jobs 2024-04-19 13:32:19 -06:00
Andrew Dryga
a0bd6e3d5b Hotfix: silence warnings about self-service sign ups from Stripe 2024-04-19 13:32:19 -06:00
Reactor Scram
7081c71c10 chore(linux-client): allow custom token path (#4666)
```[tasklist]
# Before merging
- [x] Remove file extension `.txt`
- [x] Wait for `linux-group` test to go green on `main` (#4692)
- [x] *all* compatibility tests must be green on this branch
```

Closes #4664 
Closes #4665 

~~The compatibility tests are expected to fail until the next release is
cut, for the same reasons as in #4686~~

The compatibility test must be handled somehow, otherwise it'll turn
main red.
`linux-group` was moved out of integration / compatibility testing, but
the DNS tests do need the whole Docker + portal setup, so that one can't
move.

---------

Signed-off-by: Reactor Scram <ReactorScram@users.noreply.github.com>
Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
2024-04-19 18:50:24 +00:00
Andrew Dryga
1b60c49f32 Also exclude acceptance tests 2024-04-19 12:23:41 -06:00
Andrew Dryga
d56b4e20f7 Hotfix: issues with directory sync metrics and error logs 2024-04-19 12:11:33 -06:00
Andrew Dryga
f965efd3d0 Add account slug to directory sync traces and logs 2024-04-19 11:31:05 -06:00
Andrew Dryga
5b153f9ba4 Provider a way to disable flaky Elixir tests on CI 2024-04-19 11:27:31 -06:00
Andrew Dryga
0889895c5e relays alert: better metric alignment to reduce noise 2024-04-19 11:24:50 -06:00
Andrew Dryga
0d3d372ada hotfix: trim metric labels to 1023 chars 2024-04-19 11:12:06 -06:00
Andrew Dryga
fc89e73e7f Do not trigger relay down alerts during deploys 2024-04-19 11:12:06 -06:00
Jamil
642b5e2ff7 feat(docs): Add Cloudflare WARP known incompatibility issue (#4704)
Fixes #4652
2024-04-19 16:28:30 +00:00
Jamil
1710e6e0eb refactor(docs): Refactor KbSideBar to more accurately reflect content (#4712)
"User-Guides" isn't a great name. "End-user guides" is a tiny bit better
-- the goal for this was to have something an admin could distribute to
their end-users during onboarding.

Also I tried to clarify that only SSO+sync requires the Enterprise tier
for Google/Okta/Entra
2024-04-19 15:28:24 +00:00
Thomas Eizinger
3669f010c4 chore: extract common ip-packet crate (#4702)
With the introduction of `snownet`, we temporarily duplicated the
`IpPacket` abstraction from `firezone-tunnel` because there was no
common place to put it. Overtime, these have grown in size and we needed
to convert back and forth between time. Lately, we've also been adding
more tests to both `snownet` and `firezone-tunnel` that needed to create
`IpPacket`s as test data.

This seems like an appropriate time to do away with this duplication by
introducing a dedicated crate that acts as a facade for the
`pnet_packet` crate, extending it with the functionality that we need.

Resolves: #3926.

---------

Signed-off-by: Thomas Eizinger <thomas@eizinger.io>
Co-authored-by: Jamil <jamilbk@users.noreply.github.com>
2024-04-19 15:05:29 +00:00
Thomas Eizinger
69644054ce ci: remove setting of unused env variable (#4710) 2024-04-19 14:11:58 +00:00
Thomas Eizinger
53c7bd8201 fix(relay): clear channel bindings when allocation is deleted (#4705)
As suspected, there was a bug in the relay where channel bindings were
not cleared if the client freed the allocation early by sending a
REFRESH request with a lifetime of 0.

Resolves: #4588.
2024-04-19 13:25:38 +00:00
dependabot[bot]
e4ca0a46e1 build(deps): Bump either from 1.10.0 to 1.11.0 in /rust (#4621)
Bumps [either](https://github.com/rayon-rs/either) from 1.10.0 to
1.11.0.
<details>
<summary>Commits</summary>
<ul>
<li><a
href="864eae4540"><code>864eae4</code></a>
Merge pull request <a
href="https://redirect.github.com/rayon-rs/either/issues/104">#104</a>
from cuviper/release-1.11.0</li>
<li><a
href="0bdb583188"><code>0bdb583</code></a>
Release 1.11.0</li>
<li><a
href="e385751eda"><code>e385751</code></a>
Merge pull request <a
href="https://redirect.github.com/rayon-rs/either/issues/101">#101</a>
from SFM61319/feat/into-either</li>
<li><a
href="d62efa6fff"><code>d62efa6</code></a>
Feat: Implement trait <code>IntoEither</code></li>
<li><a
href="d48ab1b312"><code>d48ab1b</code></a>
Merge pull request <a
href="https://redirect.github.com/rayon-rs/either/issues/103">#103</a>
from masklinn/patch-1</li>
<li><a
href="365f674f6d"><code>365f674</code></a>
Enable <code>serde</code> feature on playgrounds</li>
<li>See full diff in <a
href="https://github.com/rayon-rs/either/compare/1.10.0...1.11.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=either&package-manager=cargo&previous-version=1.10.0&new-version=1.11.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-19 05:32:42 +00:00
Thomas Eizinger
c4db5736d7 chore(relay): restore request metadata for control messages (#4699)
Previously, we would have a single span that was activated for all
messages, including channel-data messages. That was great for
de-duplication but shit for performance, so we turned it down to `debug`
level. That lost us a lot of context for messages like "Successfully
bound channel" or any other state change in the relay.

To restore this, we remove the span from `handle_client_input` and start
a new span on `info` level for each control message. For channel data
messages, the span is however on `debug` level to not affect performance
in production.

Resolves: #4496.
2024-04-19 05:32:00 +00:00
Thomas Eizinger
d9dc94eca3 chore(relay): log all failed requests on warn (#4700)
This was discussed with @AndrewDryga to allow us detecting potential
attacks. Some amount of authentication failures are expected during
normal operation because TURN has this system of nonces which can only
be used a certain number of times.

Resolves: #4550.
2024-04-19 05:17:38 +00:00
Thomas Eizinger
4ee37d6cce chore(connlib): remove MTU refreshing (#4698)
This did not do anything other than limit the size of the buffer that we
pass in for reading. This has no effect whatsoever. We only ever read a
single packet anyway and we get told how big it is as a result of
`poll_read`.

Resolves: #4469.
2024-04-19 05:09:02 +00:00
Reactor Scram
bc22fb2bf2 test(linux-client): move linux-group test out of integration tests (#4692)
Closes #4669 

This should stop the problem of `linux-group` failing because of trying
to test an older release that doesn't have the right CLI features

---------

Co-authored-by: Jamil <jamilbk@users.noreply.github.com>
Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
2024-04-19 02:52:31 +00:00
Thomas Eizinger
022e431be2 chore(snownet): assert that we can send ICMP packets through the tunnel (#4675)
This is extracted out of #4568 to make that PR smaller. Plus, I'd like
to use these new assertions in #4615.
2024-04-19 02:31:32 +00:00
Thomas Eizinger
95219376b9 test(connlib): assert connection intents using property-based state machine test (#4597)
Opening this in a basic version that asserts sending of connection
intents to resource IPs. To do this, we add some boilerplate that sets
up the state machine test in general. Together with the
[work](d575dc3866/rust/connlib/snownet/tests/lib.rs (L296-L824))
that I've done on the `snownet` tests, this can then be extended to
describe the entire state machine of connlib and letting `proptest`
search for inputs & combinations that break stuff.

Some more `Transition`s that I'd expect we can implement:

- Add DNS resource
- Reconnect (i.e. roam networks)
- Remove resource

The public API of `Tunnel` isn't actually very large: We add and remove
resources, set upstream DNS servers and call `reconnect`. I think the
bet here is that we can implement the reference state machine in a very
simple way. For example, once we have added a resource and handled the
connection-intent, we should be able to send an ICMP packet through the
tunnel. I've already worked out how to pass `Transmit`s back and forth
between relay, client and gateway (see linked `snownet` tests above). If
we port that to this state machine test, we can actually exercise all
the code paths that are required to encapsulate / decapsulate those
packets whilst asserting against something simple like "packet pops out
at the other end".

Because the setup of the test is also a proptest-strategy, we can even
add the network topology as a variable by configuring the `Firewall`
(see `snownet` tests) dynamically with or without blocking rules and
thus force the entire tunnel through an (in-memory) relay.

Related: #4589.
2024-04-19 02:31:08 +00:00
Andrew Dryga
cc81105320 Fix flaky test: Increase concurrency test timeout 2024-04-18 20:02:44 -06:00
Andrew Dryga
65fce8872a Fix flaky test 2024-04-18 18:08:21 -06:00
Thomas Eizinger
4972e49b34 ci: run assertions inside docker container (#4680)
As part of #4568, we are adding a 2nd relay which showed some
short-comings of the current process state assertions because they were
running outside the docker containers, thus listing all relays as soon
as there are multiple.
2024-04-18 23:48:42 +00:00