Page MenuHomePhabricator

[services/commtest] Tunnelbroker - Adding `deviceID` validation check function
ClosedPublic

Authored by max on Dec 19 2022, 6:47 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Nov 10, 5:55 PM
Unknown Object (File)
Thu, Nov 7, 5:53 AM
Unknown Object (File)
Thu, Nov 7, 5:52 AM
Unknown Object (File)
Thu, Nov 7, 5:52 AM
Unknown Object (File)
Mon, Nov 4, 4:08 PM
Unknown Object (File)
Mon, Nov 4, 4:08 PM
Unknown Object (File)
Mon, Nov 4, 4:07 PM
Unknown Object (File)
Mon, Nov 4, 5:18 AM
Subscribers

Details

Summary

This diff introduces a function that makes a call to the Tunnelbroker (get signature API) with the deviceID in the wrong format.
In this case, we are making sure that the Tunnelbroker returns an error on the wrong format deviceID provided.
This function is called during the test in D5931.

Linear task: ENG-1657

Test Plan

The commtest app is successfully built and the tests are successfully passed in the following D5931 where the function is used.

Diff Detail

Repository
rCOMM Comm
Branch
commtest-session-sign-device-id-valid
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

max held this revision as a draft.
max published this revision for review.Dec 19 2022, 7:17 AM
max edited the summary of this revision. (Show Details)
max edited the test plan for this revision. (Show Details)
max added a reviewer: bartek. max added 1 blocking reviewer(s): jon.
services/commtest/src/tunnelbroker/tunnelbroker_utils.rs
23 ↗(On Diff #19554)

We tend to use anyhow::Result to skip specifying the error type when it's the anyhow::Error

Would really like to see these tests get added to the CI. They are pretty expensive to run locally.

This revision is now accepted and ready to land.Dec 20 2022, 9:55 AM
max edited the test plan for this revision. (Show Details)

Change the Result to be an anyhow.

max added inline comments.
services/commtest/src/tunnelbroker/tunnelbroker_utils.rs
23 ↗(On Diff #19554)

We tend to use anyhow::Result to skip specifying the error type when it's the anyhow::Error

We are not using anyhow::Result globally in this file, so making it use globally doesn't make sense, but it makes sense to change the Result to anyhow::Result in this function. It looks better. Thanks, @bartek !

In D5929#178691, @jon wrote:

Would really like to see these tests get added to the CI. They are pretty expensive to run locally.

Yes, we should start the RabbitMQ and Localstack on the CI machine to do this, I think we are ok with this now, thanks to nix. It's tracked by the ENG-2548

Rebasing and merging with the master changes.