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
F3491127: D5929.id19554.diff
Wed, Dec 18, 6:17 PM
F3491125: D5929.id20191.diff
Wed, Dec 18, 6:17 PM
F3491124: D5929.id20187.diff
Wed, Dec 18, 6:17 PM
F3491122: D5929.id20163.diff
Wed, Dec 18, 6:17 PM
F3488683: D5929.id.diff
Wed, Dec 18, 10:59 AM
Unknown Object (File)
Nov 10 2024, 5:55 PM
Unknown Object (File)
Nov 7 2024, 5:53 AM
Unknown Object (File)
Nov 7 2024, 5:52 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
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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.