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
Unknown Object (File)
Mon, Jun 24, 10:00 PM
Unknown Object (File)
Mon, Jun 24, 11:28 AM
Unknown Object (File)
Fri, Jun 21, 4:54 PM
Unknown Object (File)
Mon, Jun 17, 5:22 AM
Unknown Object (File)
Fri, Jun 14, 12:48 AM
Unknown Object (File)
Tue, Jun 11, 9:33 AM
Unknown Object (File)
Sat, Jun 1, 9:41 PM
Unknown Object (File)
May 26 2024, 2:57 PM
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
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: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.