@@ -433,11 +433,15 @@ mod tests {
433433 use std:: sync:: OnceLock ;
434434 use std:: time:: Duration ;
435435
436- use pcs:: { EnclaveIdentity , Fmspc , PckID , Platform , RawTcbEvaluationDataNumbers , TcbEvaluationDataNumbers } ;
436+ use pcs:: {
437+ EnclaveIdentity , Fmspc , PckID , Platform , RawTcbEvaluationDataNumbers ,
438+ TcbEvaluationDataNumbers ,
439+ } ;
437440
438441 use super :: Client ;
439442 use crate :: provisioning_client:: {
440- test_helpers, PccsProvisioningClientBuilder , DcapArtifactIssuer , PcsVersion , ProvisioningClient ,
443+ test_helpers, DcapArtifactIssuer , PccsProvisioningClientBuilder , PcsVersion ,
444+ ProvisioningClient ,
441445 } ;
442446 use crate :: { reqwest_client_insecure_tls, ReqwestClient } ;
443447
@@ -448,8 +452,11 @@ mod tests {
448452 static PCCS_URL : OnceLock < String > = OnceLock :: new ( ) ;
449453
450454 fn pccs_url_from_env ( ) -> String {
451- let url = std:: env:: var ( "PCCS_URL" ) . expect ( "PCCS_URL must be set" ) ;
452- assert ! ( !url. is_empty( ) , "Empty string in PCCS_URL" ) ;
455+ let url = std:: env:: var ( "PCCS_URL" ) . unwrap_or ( String :: from ( "https://pccs.fortanix.com" ) ) ;
456+ assert ! (
457+ !url. is_empty( ) ,
458+ "Empty string in environment variable: PCCS_URL"
459+ ) ;
453460 url
454461 }
455462
@@ -585,22 +592,24 @@ mod tests {
585592 let tcb_info = client. tcbinfo ( & pckcerts. fmspc ( ) . unwrap ( ) , None ) . unwrap ( ) ;
586593 let tcb_data = tcb_info. data ( ) . unwrap ( ) ;
587594
588- let selected = pckcerts. select_pck (
589- & tcb_data,
590- & pckid. cpu_svn ,
591- pckid. pce_isvsvn ,
592- pckid. pce_id ,
593- ) . unwrap ( ) ;
595+ let selected = pckcerts
596+ . select_pck ( & tcb_data, & pckid. cpu_svn , pckid. pce_isvsvn , pckid. pce_id )
597+ . unwrap ( ) ;
594598
595- let pck = client. pckcert (
599+ let pck = client
600+ . pckcert (
596601 Some ( & pckid. enc_ppid ) ,
597602 & pckid. pce_id ,
598603 & pckid. cpu_svn ,
599604 pckid. pce_isvsvn ,
600605 Some ( & pckid. qe_id ) ,
601- ) . unwrap ( ) ;
606+ )
607+ . unwrap ( ) ;
602608
603- assert_eq ! ( format!( "{:?}" , selected. sgx_extension( ) . unwrap( ) ) , format!( "{:?}" , pck. sgx_extension( ) . unwrap( ) ) ) ;
609+ assert_eq ! (
610+ format!( "{:?}" , selected. sgx_extension( ) . unwrap( ) ) ,
611+ format!( "{:?}" , pck. sgx_extension( ) . unwrap( ) )
612+ ) ;
604613 }
605614 }
606615 }
@@ -638,7 +647,11 @@ mod tests {
638647
639648 let fmspc = pckcerts. fmspc ( ) . unwrap ( ) ;
640649
641- let evaluation_data_numbers = client. tcb_evaluation_data_numbers ( ) . unwrap ( ) . evaluation_data_numbers ( ) . unwrap ( ) ;
650+ let evaluation_data_numbers = client
651+ . tcb_evaluation_data_numbers ( )
652+ . unwrap ( )
653+ . evaluation_data_numbers ( )
654+ . unwrap ( ) ;
642655
643656 for number in evaluation_data_numbers. numbers ( ) {
644657 assert ! ( client
@@ -670,7 +683,10 @@ mod tests {
670683
671684 let ( cached_tcb_info, _) = {
672685 let mut hasher = DefaultHasher :: new ( ) ;
673- let input = client. tcbinfo_service . pcs_service ( ) . build_input ( & fmspc, None ) ;
686+ let input = client
687+ . tcbinfo_service
688+ . pcs_service ( )
689+ . build_input ( & fmspc, None ) ;
674690 input. hash ( & mut hasher) ;
675691
676692 cache
@@ -707,7 +723,10 @@ mod tests {
707723
708724 #[ test]
709725 pub fn pckcrl_cached ( ) {
710- for ca in [ DcapArtifactIssuer :: PCKProcessorCA , DcapArtifactIssuer :: PCKPlatformCA ] {
726+ for ca in [
727+ DcapArtifactIssuer :: PCKProcessorCA ,
728+ DcapArtifactIssuer :: PCKPlatformCA ,
729+ ] {
711730 for api_version in [ PcsVersion :: V3 , PcsVersion :: V4 ] {
712731 let client = make_client ( api_version) ;
713732 let pckcrl = client. pckcrl ( ca) . unwrap ( ) ;
@@ -796,9 +815,11 @@ mod tests {
796815 assert_eq ! ( eval_numbers, eval_numbers2) ;
797816
798817 let fmspc = Fmspc :: try_from ( "90806f000000" ) . unwrap ( ) ;
799- let eval_numbers: TcbEvaluationDataNumbers = eval_numbers. verify ( & root_cas, Platform :: SGX ) . unwrap ( ) ;
818+ let eval_numbers: TcbEvaluationDataNumbers =
819+ eval_numbers. verify ( & root_cas, Platform :: SGX ) . unwrap ( ) ;
800820 for number in eval_numbers. numbers ( ) . map ( |n| n. number ( ) ) {
801- let qe_id = client. qe_identity ( Some ( number) )
821+ let qe_id = client
822+ . qe_identity ( Some ( number) )
802823 . unwrap ( )
803824 . verify ( & root_cas, EnclaveIdentity :: QE )
804825 . unwrap ( ) ;
0 commit comments