File tree 2 files changed +23
-2
lines changed
intel-sgx/dcap-artifact-retrieval/src/provisioning_client
2 files changed +23
-2
lines changed Original file line number Diff line number Diff line change 63
63
- name : Cargo test -p dcap-artifact-retrieval --features rustls-tls
64
64
run : cargo test --verbose --locked -p dcap-artifact-retrieval --features rustls-tls
65
65
66
+ - name : Test dcap-artifact-retrieval PCCS provider with rustls-tls
67
+ if : secrets.PCCS_URL && secrets.PCCS_URL != ''
68
+ env :
69
+ PCCS_URL : ${{ secrets.PCCS_URL }}
70
+ run : cargo test --verbose --locked -p dcap-artifact-retrieval --features rustls-tls "pccs::" -- --ignored
71
+
72
+ - name : Test dcap-artifact-retrieval PCCS provider without rustls-tls
73
+ if : secrets.PCCS_URL && secrets.PCCS_URL != ''
74
+ env :
75
+ PCCS_URL : ${{ secrets.PCCS_URL }}
76
+ run : cargo test --verbose --locked -p dcap-artifact-retrieval "pccs::" -- --ignored
77
+
66
78
- name : Cargo test -p dcap-ql --features link
67
79
run : cargo test --verbose --locked -p dcap-ql --features link
68
80
Original file line number Diff line number Diff line change @@ -403,6 +403,7 @@ impl<'inp> ProvisioningServiceApi<'inp> for QeIdApi {
403
403
mod tests {
404
404
use std:: hash:: { DefaultHasher , Hash , Hasher } ;
405
405
use std:: path:: PathBuf ;
406
+ use std:: sync:: OnceLock ;
406
407
use std:: time:: Duration ;
407
408
408
409
use pcs:: PckID ;
@@ -416,10 +417,18 @@ mod tests {
416
417
const PCKID_TEST_FILE : & str = "./tests/data/pckid_retrieval.csv" ;
417
418
const OUTPUT_TEST_DIR : & str = "./tests/data/" ;
418
419
const TIME_RETRY_TIMEOUT : Duration = Duration :: from_secs ( 180 ) ;
419
- const PCCS_URL : & ' static str = "https://localhost:8081" ;
420
+
421
+ static PCCS_URL : OnceLock < String > = OnceLock :: new ( ) ;
422
+
423
+ fn pccs_url_from_env ( ) -> String {
424
+ let api_key = std:: env:: var ( "PCCS_URL" ) . expect ( "PCCS_URL must be set" ) ;
425
+ assert ! ( !api_key. is_empty( ) , "Empty string in PCCS_URL" ) ;
426
+ api_key
427
+ }
420
428
421
429
fn make_client ( api_version : PcsVersion ) -> Client < ReqwestClient > {
422
- PccsProvisioningClientBuilder :: new ( api_version, PCCS_URL )
430
+ let url = & * PCCS_URL . get_or_init ( pccs_url_from_env) ;
431
+ PccsProvisioningClientBuilder :: new ( api_version, url)
423
432
. set_retry_timeout ( TIME_RETRY_TIMEOUT )
424
433
. build ( reqwest_client_insecure_tls ( ) )
425
434
}
You can’t perform that action at this time.
0 commit comments