@@ -242,6 +242,14 @@ func deleteStoreTypeTest(t *testing.T, shortName string, allowFail bool) {
242242 testCmd .SetArgs ([]string {"store-types" , "delete" , "--name" , shortName })
243243 deleteStoreOutput := captureOutput (
244244 func () {
245+ undeleteables := []string {"F5-CA-REST" , "F5-WS-REST" , "F5-SL-REST" }
246+ for _ , v := range undeleteables {
247+ if v == shortName {
248+ t .Skip ("Not processing un-deletable store-type: " , shortName )
249+ return
250+ }
251+ }
252+
245253 err := testCmd .Execute ()
246254 if ! allowFail {
247255 assert .NoError (t , err )
@@ -266,10 +274,24 @@ func deleteStoreTypeTest(t *testing.T, shortName string, allowFail bool) {
266274 )
267275}
268276
277+ func checkIsUnDeleteable (shortName string ) bool {
278+ undeleteables := []string {"F5-CA-REST" , "F5-WS-REST" , "F5-SL-REST" }
279+ for _ , v := range undeleteables {
280+ if v == shortName {
281+ return true
282+ }
283+ }
284+ return false
285+ }
286+
269287func createStoreTypeTest (t * testing.T , shortName string ) {
270288 t .Run (
271289 fmt .Sprintf ("CreateStore %s" , shortName ), func (t * testing.T ) {
272290 testCmd := RootCmd
291+ if checkIsUnDeleteable (shortName ) {
292+ t .Skip ("Not processing un-deletable store-type: " , shortName )
293+ return
294+ }
273295 deleteStoreTypeTest (t , shortName , true )
274296 testCmd .SetArgs ([]string {"store-types" , "create" , "--name" , shortName })
275297 createStoreOutput := captureOutput (
@@ -278,6 +300,19 @@ func createStoreTypeTest(t *testing.T, shortName string) {
278300 assert .NoError (t , err )
279301 },
280302 )
303+ exceptions := []string {
304+ "F5-CA-REST: Certificate Store Type with either short name 'F5-CA-REST' or name 'F5 CA Profiles REST' already exists." ,
305+ "F5-WS-REST: Certificate Store Type with either short name 'F5-WS-REST' or name 'F5 WS Profiles REST' already exists." ,
306+ "F5-SL-REST: Certificate Store Type with either short name 'F5-SL-REST' or name 'F5 SSL Profiles REST' already exists." ,
307+ }
308+
309+ // check if any of the exceptions are in the output
310+ for _ , exception := range exceptions {
311+ if strings .Contains (createStoreOutput , exception ) {
312+ t .Skip ("Not processing un-deletable store-type: " , exception )
313+ return
314+ }
315+ }
281316
282317 if strings .Contains (createStoreOutput , "already exists" ) {
283318 assert .Fail (t , fmt .Sprintf ("Store type %s already exists" , shortName ))
0 commit comments