Skip to content

Add some unit tests for arti-hyper

Joe Walsh requested to merge decaffjoe/arti:add-arti-hyper-unit-tests into main

Change Summary

Add some basic unit tests to arti-hyper to make sure the uri_to_host_port_tls function:

  • Returns an Error for unsupported uri schemes e.g. ftp
  • Returns a Result for supported uri schemes: http and https
  • Returns the correct port when explicitly defined in the uri e.g. http://example.com:2222 yields 2222
  • Returns the correct port by default (no explicit port in uri) e.g. http://example.com yields 80
  • Returns the correct host specified by the uri e.g. http://example.com yields example.com

Just getting my feet wet- please let me know if I've broken any conventions and need to refactor the way I've done things.

Pipeline Failure

Looks like the build pipeline failed on the rust-checks task due to a dependency vulnerability in openssl-src, here's the relevant log output:

...
$ ./maint/cargo_audit
    Fetching advisory database from `https://github.com/RustSec/advisory-db.git`
      Loaded 421 security advisories (from /usr/local/cargo/advisory-db)
    Updating crates.io index
    Scanning Cargo.lock for vulnerabilities (430 crate dependencies)
Crate:     openssl-src
Version:   111.21.0+1.1.1p
Title:     AES OCB fails to encrypt some bytes
Date:      2022-07-05
ID:        RUSTSEC-2022-0032
URL:       https://rustsec.org/advisories/RUSTSEC-2022-0032
Solution:  Upgrade to >=111.22, <300.0 OR >=300.0.9
Dependency tree:
openssl-src 111.21.0+1.1.1p
...
error: 1 vulnerability found!
...
Cleaning up project directory and file based variables 00:01
ERROR: Job failed: exit code 1

Merge request reports

Loading