Page MenuHomePhabricator

[services/commtest] Tunnelbroker - Adding the API integration tests call function
ClosedPublic

Authored by max on Dec 19 2022, 6:52 AM.
Tags
None
Referenced Files
F2160035: D5931.id20192.diff
Mon, Jul 1, 8:26 AM
F2159904: D5931.id19783.diff
Mon, Jul 1, 7:56 AM
F2159365: D5931.id20194.diff
Mon, Jul 1, 6:59 AM
F2149699: D5931.id20192.diff
Sun, Jun 30, 8:39 AM
Unknown Object (File)
Sat, Jun 29, 7:11 PM
Unknown Object (File)
Sat, Jun 29, 12:57 PM
Unknown Object (File)
Sat, Jun 29, 4:43 AM
Unknown Object (File)
Thu, Jun 27, 1:25 AM
Subscribers

Details

Summary

This diff introduces an integrational tests call for the Tunnelbroker API:

  1. We are checking for the wrong formatted deviceID: the server should return an error.
  2. Generating a keypair for making a signature.
  3. Getting a string to be signed from the Tunnelbroker server for the deviceID.
  4. Checking for the server error in case the provided signature is wrong.
  5. Create a new session (getting sessionID) by calling the Tunnelbroker new session API call.

Linear task: ENG-1657

Test Plan
  1. The commtest app is successfully built.
  2. To run tests:
    • Start the Tunnelbroker server using the nix develop --accept-flake-config -c bash -c "cargo run" command in the services/tunnelbroker directory.
    • Open another terminal and run the following command from the services/commtest directory:

nix develop --accept-flake-config -c bash -c "cargo t --test tunnelbroker_integration_test -- --nocapture"

The expected result is that the commapp will be running the tests for the Tunnelbroker API.

Diff Detail

Repository
rCOMM Comm
Branch
commtest-new-session-tests
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:26 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.
max edited the test plan for this revision. (Show Details)

Rebasing on parent changes, removing unwrap() in a favor of anyhow.

was unable to do arc patch without a conflict, but overall looks good to me

services/commtest/tests/tunnelbroker_integration_test.rs
5 ↗(On Diff #19783)

not super related to this task, but I think the namespace would be a bit cleaner as commtest::tunnelbroker::utils. As tunnelbroker_utils is a bit redundant.

This revision is now accepted and ready to land.Dec 20 2022, 10:00 AM
max added inline comments.
services/commtest/tests/tunnelbroker_integration_test.rs
5 ↗(On Diff #19783)

not super related to this task, but I think the namespace would be a bit cleaner as commtest::tunnelbroker::utils. As tunnelbroker_utils is a bit redundant.

I'm following the current code convention that we have in a commtest. We have the same for the blob and backup.

max marked an inline comment as done.

Rebasing and merging.