@@ -120,12 +120,8 @@ func TestSignedComponentUploadToLocalOCIRegistry(t *testing.T) {
120120 t .Fatal (err )
121121 }
122122
123- _ , invalidPublicKey , err := createRSAKeys ()
124- if err != nil {
125- t .Fatal (err )
126- }
127-
128- setupComponent := createTestComponentVersionSigned (t , "Add signed components to component-version" , privateKey , keyName , invalidPublicKey , componentNameIdentifier , testSignedComponentsPath , version1 )
123+ createSigningSecret := features .New ("Create signing secret" ).WithStep ("create valid rsa key secret" , 1 , shared .CreateSecret (keyName , map [string ][]byte {keyName : publicKey }, nil , "" ))
124+ setupComponent := createTestComponentVersionSigned (t , "Add signed components to component-version" , privateKey , keyName , componentNameIdentifier , testSignedComponentsPath , version1 )
129125 validation := features .New ("Validate if signed OCM Components are present in OCI Registry" ).
130126 Setup (setup .AddScheme (v1alpha1 .AddToScheme )).
131127 Setup (setup .AddScheme (sourcev1 .AddToScheme )).
@@ -136,16 +132,14 @@ func TestSignedComponentUploadToLocalOCIRegistry(t *testing.T) {
136132 Assess ("Validate Component " + podinfoComponentName , checkRepositoryExistsInRegistry (componentNamePrefix + componentNameIdentifier + podinfoComponentName )).
137133 Assess ("Validate Component " + podinfoBackendComponentName , checkRepositoryExistsInRegistry (componentNamePrefix + componentNameIdentifier + podinfoBackendComponentName )).
138134 Assess ("Validate Component " + podinfoFrontendComponentName , checkRepositoryExistsInRegistry (componentNamePrefix + componentNameIdentifier + podinfoFrontendComponentName )).
139- Assess ("Validate Component " + redisComponentName , checkRepositoryExistsInRegistry (componentNamePrefix + componentNameIdentifier + redisComponentName )).
140- Teardown (shared .DeleteSecret (keyName ))
135+ Assess ("Validate Component " + redisComponentName , checkRepositoryExistsInRegistry (componentNamePrefix + componentNameIdentifier + redisComponentName ))
141136
142137 signatureVerification := features .New ("Validate if signed Component Versions of OCM Components exist" ).
143- WithStep ("create valid rsa key secret" , 1 , shared .CreateSecret (keyName , map [string ][]byte {keyName : publicKey }, nil , "" )).
144- Assess ("Check that component version " + cvName + " is ready and signature was verified" , checkIsComponentVersionReady (cvName , ocmNamespace )).
145- Teardown (shared .DeleteSecret (keyName ))
138+ Assess ("Check that component version " + cvName + " is ready and signature was verified" , checkIsComponentVersionReady (cvName , ocmNamespace ))
146139
147140 testEnv .Test (t ,
148141 setupComponent .Feature (),
142+ createSigningSecret .Feature (),
149143 validation .Feature (),
150144 signatureVerification .Feature (),
151145 )
0 commit comments