@@ -58,13 +58,26 @@ pub struct TaskOci {
5858}
5959
6060impl TaskOci {
61- /// Create a `TaskOci` configured for smoke tests with the given API URL
61+ /// Create a `TaskOci` configured for smoke tests with the given API URL and default credentials
6262 pub fn for_test ( api_url : & str , admin : bool ) -> Self {
6363 let ( username, password) = if admin {
64- ( TEST_ADMIN_USERNAME , TEST_ADMIN_API_TOKEN )
64+ (
65+ TEST_ADMIN_USERNAME . to_owned ( ) ,
66+ TEST_ADMIN_API_TOKEN . to_owned ( ) ,
67+ )
6568 } else {
66- ( TEST_USERNAME , TEST_API_TOKEN )
69+ ( TEST_USERNAME . to_owned ( ) , TEST_API_TOKEN . to_owned ( ) )
6770 } ;
71+ Self :: for_test_with_credentials ( api_url, admin, username, password)
72+ }
73+
74+ /// Create a `TaskOci` configured for smoke tests with custom credentials
75+ pub fn for_test_with_credentials (
76+ api_url : & str ,
77+ admin : bool ,
78+ username : String ,
79+ password : String ,
80+ ) -> Self {
6881 Self {
6982 api_url : api_url. to_owned ( ) ,
7083 namespace : "namespace" . to_owned ( ) ,
@@ -75,8 +88,8 @@ impl TaskOci {
7588 output_dir : "./oci-conformance-results" . to_owned ( ) ,
7689 spec_dir : "./distribution-spec" . to_owned ( ) ,
7790 admin,
78- username : username . to_owned ( ) ,
79- password : password . to_owned ( ) ,
91+ username,
92+ password,
8093 }
8194 }
8295}
0 commit comments