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
F3491084: D5931.id20194.diff
Wed, Dec 18, 6:17 PM
F3491083: D5931.id20167.diff
Wed, Dec 18, 6:17 PM
F3491082: D5931.id20192.diff
Wed, Dec 18, 6:17 PM
F3491080: D5931.id19557.diff
Wed, Dec 18, 6:17 PM
F3491079: D5931.id19783.diff
Wed, Dec 18, 6:17 PM
F3488674: D5931.id.diff
Wed, Dec 18, 10:59 AM
Unknown Object (File)
Tue, Dec 17, 9:56 AM
Unknown Object (File)
Mon, Dec 16, 7:22 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
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

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

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.