Loading src/test/resources/hypo/cleanUp.feature +86 −80 Changes for src/test/resources/hypo/cleanUp.feature: 86 added lines, 80 removed lines. Original line number Original line Diff line number Diff line Loading @@ -28,21 +28,38 @@ Background: } } """ """ * def cleanupFailures = [] * def tryCall = """ function(tag, args, label) { try { return karate.call(tag, args); } catch (e) { var msg = label + ' (' + tag + '): ' + String(e).split('\n')[0]; karate.log('WARNING: clean up step failed: ' + msg); karate.set('cleanupFailures', karate.append(karate.get('cleanupFailures', []), msg)); return null; } } """ @clean-up-workflow @clean-up-workflow Scenario: Workflow that terminates services and deletes services, orders, network, organization, peering, candidates, specifications and registry secrets Scenario: Workflow that terminates services and deletes services, orders, network, organization, peering, candidates, specifications and registry secrets * karate.log('###### GENERIC CLEAN-UP-WORKFLOW STARTING ######') * karate.log('###### GENERIC CLEAN-UP-WORKFLOW STARTING ######') * def orgs = call read('classpath:hypo/organization.feature@getOrganizations') { auth_token: '#(auth_token)' } # A listing that fails falls back to an empty list, so the other resources are still cleaned up * def controllers = call read('classpath:hypo/fabric.feature@getControllers') { auth_token: '#(auth_token)' } * def orgs = tryCall('classpath:hypo/organization.feature@getOrganizations', { auth_token: auth_token }, 'list organizations') || { organizationIds: [] } * def peering = call read('classpath:hypo/peering.feature@getPeerings') { auth_token: '#(auth_token)' } * def controllers = tryCall('classpath:hypo/fabric.feature@getControllers', { auth_token: auth_token }, 'list fabric controllers') || { networkControllerIds: [] } * def registries = call read('classpath:hypo/registry.feature@getRegistries') { auth_token: '#(auth_token)' } * def peering = tryCall('classpath:hypo/peering.feature@getPeerings', { auth_token: auth_token }, 'list peerings') || { peeringIds: [] } * def registries = tryCall('classpath:hypo/registry.feature@getRegistries', { auth_token: auth_token }, 'list registry secrets') || { registryImageIds: [], registryPackageIds: [] } * def allServices = call read('classpath:hypo/service.feature@getAllServices') { auth_token: '#(auth_token)' } * def allServices = tryCall('classpath:hypo/service.feature@getAllServices', { auth_token: auth_token }, 'list services') || { terminatedServiceIds: [], feasibilityCheckedServiceIds: [], activeServiceIds: [], inactiveServiceIds: [], otherStateServices: [] } * def allCfsandOslServices = call read('classpath:hypo/service.feature@getAllCfsandOslServices') { auth_token: '#(auth_token)' } * def allCfsandOslServices = tryCall('classpath:hypo/service.feature@getAllCfsandOslServices', { auth_token: auth_token }, 'list CFS and OSL services') || { cfsActiveServiceIds: [], oslActiveServiceIds: [], cfsInactiveServiceIds: [], oslInactiveServiceIds: [] } * def allOrders = call read('classpath:hypo/service.feature@getAllServiceOrders') { auth_token: '#(auth_token)' } * def allOrders = tryCall('classpath:hypo/service.feature@getAllServiceOrders', { auth_token: auth_token }, 'list service orders') || { acknowledgedOrderIds: [], completedOrderIds: [] } * def cfsToTerminate = karate.append(allCfsandOslServices.cfsActiveServiceIds, allCfsandOslServices.cfsInactiveServiceIds) * call read('classpath:hypo/cleanUp.feature@cleanupTerminate') { auth_token: '#(auth_token)', cfsActiveServiceIds: '#(allCfsandOslServices.cfsActiveServiceIds)', oslActiveServiceIds: '#(allCfsandOslServices.oslActiveServiceIds)' } * def oslToTerminate = karate.append(allCfsandOslServices.oslActiveServiceIds, allCfsandOslServices.oslInactiveServiceIds) * def terminateResult = call read('classpath:hypo/cleanUp.feature@cleanupTerminate') { auth_token: '#(auth_token)', cfsActiveServiceIds: '#(cfsToTerminate)', oslActiveServiceIds: '#(oslToTerminate)' } * eval java.lang.Thread.sleep(1000) * eval java.lang.Thread.sleep(1000) Loading @@ -51,102 +68,58 @@ Scenario: Workflow that terminates services and deletes services, orders, networ allServices.terminatedServiceIds allServices.terminatedServiceIds .concat(allServices.feasibilityCheckedServiceIds) .concat(allServices.feasibilityCheckedServiceIds) .concat(allServices.activeServiceIds) .concat(allServices.activeServiceIds) .concat(allServices.inactiveServiceIds) """ """ * def orderIdsToDelete = allOrders.acknowledgedOrderIds.concat(allOrders.completedOrderIds) * def orderIdsToDelete = allOrders.acknowledgedOrderIds.concat(allOrders.completedOrderIds) * call read('classpath:hypo/cleanUp.feature@cleanupAll'){ auth_token: '#(auth_token)', organizationIds: '#(orgs.organizationIds)', peeringIds: '#(peering.peeringIds)', networkControllerIds: '#(controllers.networkControllerIds)', registryImageIds: '#(registries.registryImageIds)', registryPackageIds: '#(registries.registryPackageIds)', serviceIdsToDelete: '#(serviceIdsToDelete)', orderIdsToDelete: '#(orderIdsToDelete)' } * def deleteResult = call read('classpath:hypo/cleanUp.feature@cleanupAll'){ auth_token: '#(auth_token)', organizationIds: '#(orgs.organizationIds)', peeringIds: '#(peering.peeringIds)', networkControllerIds: '#(controllers.networkControllerIds)', registryImageIds: '#(registries.registryImageIds)', registryPackageIds: '#(registries.registryPackageIds)', serviceIdsToDelete: '#(serviceIdsToDelete)', orderIdsToDelete: '#(orderIdsToDelete)' } * def leftInOtherStates = karate.map(allServices.otherStateServices, function(s){ return 'service ' + s.id + ' left in state ' + s.state + ': the clean-up does not terminate or delete services in this state' }) * def cleanupFailures = karate.append(cleanupFailures, terminateResult.cleanupFailures, deleteResult.cleanupFailures, leftInOtherStates) * karate.log('###### GENERIC CLEAN-UP-WORKFLOW FINISHED: ' + cleanupFailures.length + ' failed step(s) ######') * if (cleanupFailures.length > 0) karate.log('WARNING: clean up left resources behind, failed steps: ' + karate.pretty(cleanupFailures)) @cleanupAll @cleanupAll Scenario: Delete all fetched organizations, controllers, peerings, registries, services and orders Scenario: Delete all fetched organizations, controllers, peerings, registries, services and orders * karate.log('--- STEP: CLEAN UP ALL ---') * karate.log('--- STEP: CLEAN UP ALL ---') * karate.log('--- CLEAN UP STEP 1: CLEAN UP FABRIC ---') * def deleteEachId = * def deleteControllerFn = """ """ function(id) { function(ids, tag, idParam, what) { karate.call('classpath:hypo/deleteAll.feature@deleteFabricNetwork', { token: token, networkControllerId: id }); karate.forEach(ids || [], function(id) { var args = { token: token }; args[idParam] = id; tryCall(tag, args, 'delete ' + what + ' ' + id); java.lang.Thread.sleep(1000); java.lang.Thread.sleep(1000); }); } } """ """ * karate.forEach(networkControllerIds, deleteControllerFn) * karate.log('--- CLEAN UP STEP 1: CLEAN UP FABRIC ---') * deleteEachId(networkControllerIds, 'classpath:hypo/deleteAll.feature@deleteFabricNetwork', 'networkControllerId', 'fabric controller') * karate.log('--- CLEAN UP STEP 2: CLEAN UP PEERING ---') * karate.log('--- CLEAN UP STEP 2: CLEAN UP PEERING ---') * def deletePeeringFn = * deleteEachId(peeringIds, 'classpath:hypo/deleteAll.feature@deletePeeringbyId', 'orgId', 'peering') """ function(id) { karate.call('classpath:hypo/deleteAll.feature@deletePeeringbyId', { token: token, orgId: id }); java.lang.Thread.sleep(1000); } """ * karate.forEach(peeringIds, deletePeeringFn) * karate.log('--- CLEAN UP STEP 3: CLEAN UP ORGANIZATIONS ---') * karate.log('--- CLEAN UP STEP 3: CLEAN UP ORGANIZATIONS ---') * def deleteOrgFn = * deleteEachId(organizationIds, 'classpath:hypo/deleteAll.feature@deleteOrganizationbyId', 'orgId', 'organization') """ function(id) { karate.call('classpath:hypo/deleteAll.feature@deleteOrganizationbyId', { token: token, orgId: id }); java.lang.Thread.sleep(1000); } """ * karate.forEach(organizationIds, deleteOrgFn) * karate.log('--- CLEAN UP STEP 4: CLEAN UP REGISTRY IMAGES---') * karate.log('--- CLEAN UP STEP 4: CLEAN UP REGISTRY IMAGES---') * def deleteRegistryImageFn = * deleteEachId(registryImageIds, 'classpath:hypo/deleteAll.feature@deleteRegistryImagebyId', 'registryImageId', 'registry image secret') """ function(id) { karate.call('classpath:hypo/deleteAll.feature@deleteRegistryImagebyId', { token: token, registryImageId: id }); java.lang.Thread.sleep(1000); } """ * karate.forEach(registryImageIds, deleteRegistryImageFn) * karate.log('--- CLEAN UP STEP 5: CLEAN UP REGISTRY PACKAGES---') * karate.log('--- CLEAN UP STEP 5: CLEAN UP REGISTRY PACKAGES---') * deleteEachId(registryPackageIds, 'classpath:hypo/deleteAll.feature@deleteRegistryPackagebyId', 'registryPackageId', 'registry package secret') * def deleteRegistryPackageFn = """ function(id) { karate.call('classpath:hypo/deleteAll.feature@deleteRegistryPackagebyId', { token: token, registryPackageId: id }); java.lang.Thread.sleep(1000); } """ * karate.forEach(registryPackageIds, deleteRegistryPackageFn) * karate.log('--- CLEAN UP STEP 6: CLEAN UP SERVICES ---') * karate.log('--- CLEAN UP STEP 6: CLEAN UP SERVICES ---') * deleteEachId(karate.get('serviceIdsToDelete', []), 'classpath:hypo/deleteAll.feature@deleteServicebyId', 'serviceId', 'service') * def serviceIdsToDelete = karate.get('serviceIdsToDelete', []) * karate.log('--- CLEAN UP STEP 7: CLEAN UP ORDERS ---') * deleteEachId(orderIdsToDelete, 'classpath:hypo/deleteAll.feature@deleteServiceOrder', 'orderId', 'service order') * def deleteServiceFn = """ function(id) { karate.call('classpath:hypo/deleteAll.feature@deleteServicebyId', { token: token, serviceId: id }); java.lang.Thread.sleep(1000); } """ * karate.forEach(serviceIdsToDelete, deleteServiceFn) * karate.log('--- CLEAN UP STEP 7: CLEAN UP ORDEDS ---') * def deleteOrderFn = """ function(id) { karate.call('classpath:hypo/deleteAll.feature@deleteServiceOrder', { token: token, orderId: id }); java.lang.Thread.sleep(1000); } """ * karate.forEach(orderIdsToDelete, deleteOrderFn) @cleanupTerminate @cleanupTerminate Scenario: Terminate active CFS and OSL services before cleanup Scenario: Terminate active and inactive CFS and OSL services before cleanup * def cfsActiveServiceIds = karate.get('cfsActiveServiceIds', []) * def cfsActiveServiceIds = karate.get('cfsActiveServiceIds', []) * def oslActiveServiceIds = karate.get('oslActiveServiceIds', []) * def oslActiveServiceIds = karate.get('oslActiveServiceIds', []) Loading @@ -155,7 +128,7 @@ Scenario: Terminate active CFS and OSL services before cleanup """ """ function(id) { function(id) { karate.log('Terminating active service:', id); karate.log('Terminating active service:', id); karate.call('classpath:hypo/service.feature@terminateServiceCleanUp', { auth_token: token, serviceId: id }); tryCall('classpath:hypo/service.feature@terminateServiceCleanUp', { auth_token: token, serviceId: id }, 'terminate service ' + id); java.lang.Thread.sleep(1000); java.lang.Thread.sleep(1000); } } Loading @@ -164,12 +137,45 @@ Scenario: Terminate active CFS and OSL services before cleanup * if (oslActiveServiceIds && oslActiveServiceIds.length > 0) karate.log('OSL:', oslActiveServiceIds) * if (oslActiveServiceIds && oslActiveServiceIds.length > 0) karate.log('OSL:', oslActiveServiceIds) * karate.log('--- STEP TERMINATE: TERMINATE ACTIVE CFS SERVICES ---') * karate.log('--- STEP TERMINATE: TERMINATE ACTIVE AND INACTIVE CFS SERVICES ---') * karate.forEach(cfsActiveServiceIds, terminateServiceFn) * karate.forEach(cfsActiveServiceIds, terminateServiceFn) * karate.log('--- STEP TERMINATE: TERMINATE ACTIVE OSL SERVICES ---') * karate.log('--- STEP TERMINATE: TERMINATE ACTIVE AND INACTIVE OSL SERVICES ---') * karate.forEach(oslActiveServiceIds, terminateServiceFn) * karate.forEach(oslActiveServiceIds, terminateServiceFn) # The PATCH only sets PENDING_TERMINATION and hands the teardown to sonata over Kafka. Wait until the services are # really TERMINATED before they are deleted. Timeout: 3 minutes. * def terminateTimeoutMs = 3 * 60 * 1000 * def terminatePollIntervalMs = 20000 * def isStillTerminating = """ function(id) { try { var svc = karate.call('classpath:hypo/service.feature@getServiceState', { auth_token: token, serviceId: id }); return svc.exists && svc.state != 'TERMINATED'; } catch (e) { return true; } } """ * def waitForTermination = """ function(ids) { var deadline = java.lang.System.currentTimeMillis() + terminateTimeoutMs; var pending = karate.filter(ids, isStillTerminating); while (pending.length > 0 && java.lang.System.currentTimeMillis() < deadline) { karate.log('Waiting for ' + pending.length + ' service(s) to reach TERMINATED: ' + pending); java.lang.Thread.sleep(terminatePollIntervalMs); pending = karate.filter(pending, isStillTerminating); } return pending; } """ * karate.log('--- STEP TERMINATE: WAIT UNTIL THE SERVICES ARE TERMINATED (max 3 minutes) ---') * def notTerminatedIds = waitForTermination(karate.append(cfsActiveServiceIds, oslActiveServiceIds)) # Still deleted afterwards: reported so a teardown that didn't finish is visible * karate.forEach(notTerminatedIds, function(id){ karate.set('cleanupFailures', karate.append(karate.get('cleanupFailures', []), 'terminate service ' + id + ': not TERMINATED after 3 minutes, deleted anyway')) }) # @cleanUp # @cleanUp Loading src/test/resources/hypo/deleteAll.feature +12 −3 Changes for src/test/resources/hypo/deleteAll.feature: 12 added lines, 3 removed lines. Original line number Original line Diff line number Diff line Loading @@ -46,7 +46,7 @@ Scenario: Delete service And header Authorization = 'Bearer ' + token And header Authorization = 'Bearer ' + token When method delete When method delete Then match [200, 204] contains responseStatus Then match [200, 204, 404] contains responseStatus @deleteServiceOrderAfter @deleteServiceOrderAfter Loading Loading @@ -120,7 +120,16 @@ Scenario: Delete peering And header Authorization = 'Bearer ' + token And header Authorization = 'Bearer ' + token When method delete When method delete Then match [200, 204, 404] contains responseStatus * def deleteStatus = responseStatus # peering-api answers 500 when the peering does not exist # check with GET, which returns 200 with an empty body if it is gone Given url peeringUrl And path 'peering-api', 'peering', orgId And header Authorization = 'Bearer ' + token When method get * def peeringGone = responseStatus == 200 && !response Then assert deleteStatus == 200 || deleteStatus == 204 || peeringGone @deleteRegistryImagebyId @deleteRegistryImagebyId Loading Loading @@ -148,4 +157,4 @@ Scenario: Delete Service by Id And path 'tmf-api', 'serviceInventory', V4, 'service', serviceId And path 'tmf-api', 'serviceInventory', V4, 'service', serviceId And header Authorization = 'Bearer ' + token And header Authorization = 'Bearer ' + token When method delete When method delete Then match [200, 204] contains responseStatus Then match [200, 204, 404] contains responseStatus No newline at end of file No newline at end of file src/test/resources/hypo/fabric.feature +17 Changes for src/test/resources/hypo/fabric.feature: 17 added lines, 0 removed lines. Original line number Original line Diff line number Diff line Loading @@ -24,6 +24,9 @@ Scenario: Create Fabric Network Controller * set payload_create.username = zitiUsername * set payload_create.username = zitiUsername * set payload_create.password = zitiPassword * set payload_create.password = zitiPassword # networkName is unique in fabric-api (409 on a duplicate), remove a controller left over by an earlier run * call read('classpath:hypo/fabric.feature@deleteControllersByName') { networkName: '#(payload_create.networkName)' } Given url fabricUrl Given url fabricUrl And path 'fabric-api', 'network', 'controller' And path 'fabric-api', 'network', 'controller' Loading Loading @@ -169,3 +172,17 @@ Scenario: GET All Fabric Network Controllers """ """ * def networkControllerIds = getControllerIds(response) * def networkControllerIds = getControllerIds(response) * if (networkControllerIds && networkControllerIds.length > 0) karate.log('Network Controller IDs', networkControllerIds) * if (networkControllerIds && networkControllerIds.length > 0) karate.log('Network Controller IDs', networkControllerIds) @deleteControllersByName @ignore Scenario: Delete the Fabric Network Controllers with a given networkName * karate.log('--- STEP: DELETE FABRIC NETWORK CONTROLLERS NAMED ' + networkName + ' ---') Given url fabricUrl And path 'fabric-api', 'network', 'controller' And header Authorization = 'Bearer ' + token When method get Then assert responseStatus == 200 * def leftoverIds = karate.map(karate.filter(response, function(x){ return x.networkName == networkName }), function(x){ return x.networkControllerId }) * if (leftoverIds.length > 0) karate.log('Deleting leftover Fabric Network Controller(s):', leftoverIds) * karate.forEach(leftoverIds, function(id){ karate.call('classpath:hypo/deleteAll.feature@deleteFabricNetwork', { networkControllerId: id }) }) src/test/resources/hypo/registry.feature +4 Changes for src/test/resources/hypo/registry.feature: 4 added lines, 0 removed lines. Original line number Original line Diff line number Diff line Loading @@ -23,6 +23,8 @@ Scenario: Create Registry Image * set payload_.username = registryImageUsername * set payload_.username = registryImageUsername * set payload_.password = registryImagePassword * set payload_.password = registryImagePassword * call read('classpath:hypo/deleteAll.feature@deleteRegistryImage') Given url registryUrl Given url registryUrl And path 'registry-api', 'image-pull', 'secret', 'cms-secret' And path 'registry-api', 'image-pull', 'secret', 'cms-secret' And header Content-Type = 'application/json' And header Content-Type = 'application/json' Loading @@ -46,6 +48,8 @@ Scenario: Create Registry Package * set payload_.username = registryImageUsername * set payload_.username = registryImageUsername * set payload_.password = registryImagePassword * set payload_.password = registryImagePassword * call read('classpath:hypo/deleteAll.feature@deleteRegistryPackage') Given url registryUrl Given url registryUrl And path 'registry-api', 'package-registry', 'secret', 'registry.ubitech.eu' And path 'registry-api', 'package-registry', 'secret', 'registry.ubitech.eu' And header Content-Type = 'application/json' And header Content-Type = 'application/json' Loading src/test/resources/hypo/service.feature +19 −1 Changes for src/test/resources/hypo/service.feature: 19 added lines, 1 removed line. Original line number Original line Diff line number Diff line Loading @@ -474,9 +474,18 @@ Scenario: Terminate the Service And header Authorization = 'Bearer ' + token And header Authorization = 'Bearer ' + token And request { state: 'TERMINATED' } And request { state: 'TERMINATED' } When method patch When method patch * match [200, 409] contains responseStatus * match [200, 404, 409] contains responseStatus * print 'Status returned:', responseStatus * print 'Status returned:', responseStatus @getServiceState @ignore Scenario: Get the state of a service, null if it doesn't exist Given url baseUrl And path 'tmf-api', 'serviceInventory', V4, 'service', serviceId And header Authorization = 'Bearer ' + token When method get * def state = responseStatus == 200 ? response.state : null * def exists = responseStatus != 404 @updateServiceHelmPackage @updateServiceHelmPackage Scenario: Update the Service Helm Package via PATCH Scenario: Update the Service Helm Package via PATCH * karate.log('--- STEP: UPDATE SERVICE ---') * karate.log('--- STEP: UPDATE SERVICE ---') Loading Loading @@ -566,10 +575,15 @@ Scenario: GET All Services from Inventory * def terminatedServiceIds = getIdsByState(response, 'TERMINATED') * def terminatedServiceIds = getIdsByState(response, 'TERMINATED') * def feasibilityCheckedServiceIds = getIdsByState(response, 'FEASIBILITY_CHECKED') * def feasibilityCheckedServiceIds = getIdsByState(response, 'FEASIBILITY_CHECKED') * def activeServiceIds = getIdsByState(response, 'ACTIVE') * def activeServiceIds = getIdsByState(response, 'ACTIVE') * def inactiveServiceIds = getIdsByState(response, 'INACTIVE') # The clean-up does not terminates or deletes services in any other state (e.g. PENDING_TERMINATION), it only reports them * def handledStates = ['TERMINATED', 'FEASIBILITY_CHECKED', 'ACTIVE', 'INACTIVE'] * def otherStateServices = karate.map(karate.filter(response, function(x){ return x.id && handledStates.indexOf(x.state) < 0 }), function(x){ return { id: x.id, state: x.state } }) * if (terminatedServiceIds && terminatedServiceIds.length > 0) karate.log('Terminated Service IDs:', terminatedServiceIds) * if (terminatedServiceIds && terminatedServiceIds.length > 0) karate.log('Terminated Service IDs:', terminatedServiceIds) * if (feasibilityCheckedServiceIds && feasibilityCheckedServiceIds.length > 0) karate.log('Feasibility Checked Service IDs:', feasibilityCheckedServiceIds) * if (feasibilityCheckedServiceIds && feasibilityCheckedServiceIds.length > 0) karate.log('Feasibility Checked Service IDs:', feasibilityCheckedServiceIds) * if (activeServiceIds && activeServiceIds.length > 0) karate.log('Active Service IDs:', activeServiceIds) * if (activeServiceIds && activeServiceIds.length > 0) karate.log('Active Service IDs:', activeServiceIds) * if (inactiveServiceIds && inactiveServiceIds.length > 0) karate.log('Inactive Service IDs:', inactiveServiceIds) Loading Loading @@ -604,17 +618,21 @@ Scenario: GET All Services from Inventory * def cfsTerminatedServiceIds = getIdsByNameAndState(response, 'cfs', 'TERMINATED') * def cfsTerminatedServiceIds = getIdsByNameAndState(response, 'cfs', 'TERMINATED') * def cfsFeasibilityCheckedServiceIds = getIdsByNameAndState(response, 'cfs', 'FEASIBILITY_CHECKED') * def cfsFeasibilityCheckedServiceIds = getIdsByNameAndState(response, 'cfs', 'FEASIBILITY_CHECKED') * def cfsActiveServiceIds = getIdsByNameAndState(response, 'cfs', 'ACTIVE') * def cfsActiveServiceIds = getIdsByNameAndState(response, 'cfs', 'ACTIVE') * def cfsInactiveServiceIds = getIdsByNameAndState(response, 'cfs', 'INACTIVE') * def oslTerminatedServiceIds = getIdsByNameAndState(response, 'openslice', 'TERMINATED') * def oslTerminatedServiceIds = getIdsByNameAndState(response, 'openslice', 'TERMINATED') * def oslFeasibilityCheckedServiceIds = getIdsByNameAndState(response, 'openslice', 'FEASIBILITY_CHECKED') * def oslFeasibilityCheckedServiceIds = getIdsByNameAndState(response, 'openslice', 'FEASIBILITY_CHECKED') * def oslActiveServiceIds = getIdsByNameAndState(response, 'openslice', 'ACTIVE') * def oslActiveServiceIds = getIdsByNameAndState(response, 'openslice', 'ACTIVE') * def oslInactiveServiceIds = getIdsByNameAndState(response, 'openslice', 'INACTIVE') * if (cfsTerminatedServiceIds && cfsTerminatedServiceIds.length > 0) karate.log('CFS Terminated Service IDs:', cfsTerminatedServiceIds) * if (cfsTerminatedServiceIds && cfsTerminatedServiceIds.length > 0) karate.log('CFS Terminated Service IDs:', cfsTerminatedServiceIds) * if (cfsFeasibilityCheckedServiceIds && cfsFeasibilityCheckedServiceIds.length > 0) karate.log('CFS Feasibility Checked Service IDs:', cfsFeasibilityCheckedServiceIds) * if (cfsFeasibilityCheckedServiceIds && cfsFeasibilityCheckedServiceIds.length > 0) karate.log('CFS Feasibility Checked Service IDs:', cfsFeasibilityCheckedServiceIds) * if (cfsActiveServiceIds && cfsActiveServiceIds.length > 0) karate.log('CFS Active Service IDs:', cfsActiveServiceIds) * if (cfsActiveServiceIds && cfsActiveServiceIds.length > 0) karate.log('CFS Active Service IDs:', cfsActiveServiceIds) * if (cfsInactiveServiceIds && cfsInactiveServiceIds.length > 0) karate.log('CFS Inactive Service IDs:', cfsInactiveServiceIds) * if (oslTerminatedServiceIds && oslTerminatedServiceIds.length > 0) karate.log('OSL Terminated Service IDs:', oslTerminatedServiceIds) * if (oslTerminatedServiceIds && oslTerminatedServiceIds.length > 0) karate.log('OSL Terminated Service IDs:', oslTerminatedServiceIds) * if (oslFeasibilityCheckedServiceIds && oslFeasibilityCheckedServiceIds.length > 0) karate.log('OSL Feasibility Checked Service IDs:', oslFeasibilityCheckedServiceIds) * if (oslFeasibilityCheckedServiceIds && oslFeasibilityCheckedServiceIds.length > 0) karate.log('OSL Feasibility Checked Service IDs:', oslFeasibilityCheckedServiceIds) * if (oslActiveServiceIds && oslActiveServiceIds.length > 0) karate.log('OSL Active Service IDs:', oslActiveServiceIds) * if (oslActiveServiceIds && oslActiveServiceIds.length > 0) karate.log('OSL Active Service IDs:', oslActiveServiceIds) * if (oslInactiveServiceIds && oslInactiveServiceIds.length > 0) karate.log('OSL Inactive Service IDs:', oslInactiveServiceIds) @getAllServiceOrders @getAllServiceOrders Scenario: GET All Service Orders Scenario: GET All Service Orders Loading Loading
src/test/resources/hypo/cleanUp.feature +86 −80 Changes for src/test/resources/hypo/cleanUp.feature: 86 added lines, 80 removed lines. Original line number Original line Diff line number Diff line Loading @@ -28,21 +28,38 @@ Background: } } """ """ * def cleanupFailures = [] * def tryCall = """ function(tag, args, label) { try { return karate.call(tag, args); } catch (e) { var msg = label + ' (' + tag + '): ' + String(e).split('\n')[0]; karate.log('WARNING: clean up step failed: ' + msg); karate.set('cleanupFailures', karate.append(karate.get('cleanupFailures', []), msg)); return null; } } """ @clean-up-workflow @clean-up-workflow Scenario: Workflow that terminates services and deletes services, orders, network, organization, peering, candidates, specifications and registry secrets Scenario: Workflow that terminates services and deletes services, orders, network, organization, peering, candidates, specifications and registry secrets * karate.log('###### GENERIC CLEAN-UP-WORKFLOW STARTING ######') * karate.log('###### GENERIC CLEAN-UP-WORKFLOW STARTING ######') * def orgs = call read('classpath:hypo/organization.feature@getOrganizations') { auth_token: '#(auth_token)' } # A listing that fails falls back to an empty list, so the other resources are still cleaned up * def controllers = call read('classpath:hypo/fabric.feature@getControllers') { auth_token: '#(auth_token)' } * def orgs = tryCall('classpath:hypo/organization.feature@getOrganizations', { auth_token: auth_token }, 'list organizations') || { organizationIds: [] } * def peering = call read('classpath:hypo/peering.feature@getPeerings') { auth_token: '#(auth_token)' } * def controllers = tryCall('classpath:hypo/fabric.feature@getControllers', { auth_token: auth_token }, 'list fabric controllers') || { networkControllerIds: [] } * def registries = call read('classpath:hypo/registry.feature@getRegistries') { auth_token: '#(auth_token)' } * def peering = tryCall('classpath:hypo/peering.feature@getPeerings', { auth_token: auth_token }, 'list peerings') || { peeringIds: [] } * def registries = tryCall('classpath:hypo/registry.feature@getRegistries', { auth_token: auth_token }, 'list registry secrets') || { registryImageIds: [], registryPackageIds: [] } * def allServices = call read('classpath:hypo/service.feature@getAllServices') { auth_token: '#(auth_token)' } * def allServices = tryCall('classpath:hypo/service.feature@getAllServices', { auth_token: auth_token }, 'list services') || { terminatedServiceIds: [], feasibilityCheckedServiceIds: [], activeServiceIds: [], inactiveServiceIds: [], otherStateServices: [] } * def allCfsandOslServices = call read('classpath:hypo/service.feature@getAllCfsandOslServices') { auth_token: '#(auth_token)' } * def allCfsandOslServices = tryCall('classpath:hypo/service.feature@getAllCfsandOslServices', { auth_token: auth_token }, 'list CFS and OSL services') || { cfsActiveServiceIds: [], oslActiveServiceIds: [], cfsInactiveServiceIds: [], oslInactiveServiceIds: [] } * def allOrders = call read('classpath:hypo/service.feature@getAllServiceOrders') { auth_token: '#(auth_token)' } * def allOrders = tryCall('classpath:hypo/service.feature@getAllServiceOrders', { auth_token: auth_token }, 'list service orders') || { acknowledgedOrderIds: [], completedOrderIds: [] } * def cfsToTerminate = karate.append(allCfsandOslServices.cfsActiveServiceIds, allCfsandOslServices.cfsInactiveServiceIds) * call read('classpath:hypo/cleanUp.feature@cleanupTerminate') { auth_token: '#(auth_token)', cfsActiveServiceIds: '#(allCfsandOslServices.cfsActiveServiceIds)', oslActiveServiceIds: '#(allCfsandOslServices.oslActiveServiceIds)' } * def oslToTerminate = karate.append(allCfsandOslServices.oslActiveServiceIds, allCfsandOslServices.oslInactiveServiceIds) * def terminateResult = call read('classpath:hypo/cleanUp.feature@cleanupTerminate') { auth_token: '#(auth_token)', cfsActiveServiceIds: '#(cfsToTerminate)', oslActiveServiceIds: '#(oslToTerminate)' } * eval java.lang.Thread.sleep(1000) * eval java.lang.Thread.sleep(1000) Loading @@ -51,102 +68,58 @@ Scenario: Workflow that terminates services and deletes services, orders, networ allServices.terminatedServiceIds allServices.terminatedServiceIds .concat(allServices.feasibilityCheckedServiceIds) .concat(allServices.feasibilityCheckedServiceIds) .concat(allServices.activeServiceIds) .concat(allServices.activeServiceIds) .concat(allServices.inactiveServiceIds) """ """ * def orderIdsToDelete = allOrders.acknowledgedOrderIds.concat(allOrders.completedOrderIds) * def orderIdsToDelete = allOrders.acknowledgedOrderIds.concat(allOrders.completedOrderIds) * call read('classpath:hypo/cleanUp.feature@cleanupAll'){ auth_token: '#(auth_token)', organizationIds: '#(orgs.organizationIds)', peeringIds: '#(peering.peeringIds)', networkControllerIds: '#(controllers.networkControllerIds)', registryImageIds: '#(registries.registryImageIds)', registryPackageIds: '#(registries.registryPackageIds)', serviceIdsToDelete: '#(serviceIdsToDelete)', orderIdsToDelete: '#(orderIdsToDelete)' } * def deleteResult = call read('classpath:hypo/cleanUp.feature@cleanupAll'){ auth_token: '#(auth_token)', organizationIds: '#(orgs.organizationIds)', peeringIds: '#(peering.peeringIds)', networkControllerIds: '#(controllers.networkControllerIds)', registryImageIds: '#(registries.registryImageIds)', registryPackageIds: '#(registries.registryPackageIds)', serviceIdsToDelete: '#(serviceIdsToDelete)', orderIdsToDelete: '#(orderIdsToDelete)' } * def leftInOtherStates = karate.map(allServices.otherStateServices, function(s){ return 'service ' + s.id + ' left in state ' + s.state + ': the clean-up does not terminate or delete services in this state' }) * def cleanupFailures = karate.append(cleanupFailures, terminateResult.cleanupFailures, deleteResult.cleanupFailures, leftInOtherStates) * karate.log('###### GENERIC CLEAN-UP-WORKFLOW FINISHED: ' + cleanupFailures.length + ' failed step(s) ######') * if (cleanupFailures.length > 0) karate.log('WARNING: clean up left resources behind, failed steps: ' + karate.pretty(cleanupFailures)) @cleanupAll @cleanupAll Scenario: Delete all fetched organizations, controllers, peerings, registries, services and orders Scenario: Delete all fetched organizations, controllers, peerings, registries, services and orders * karate.log('--- STEP: CLEAN UP ALL ---') * karate.log('--- STEP: CLEAN UP ALL ---') * karate.log('--- CLEAN UP STEP 1: CLEAN UP FABRIC ---') * def deleteEachId = * def deleteControllerFn = """ """ function(id) { function(ids, tag, idParam, what) { karate.call('classpath:hypo/deleteAll.feature@deleteFabricNetwork', { token: token, networkControllerId: id }); karate.forEach(ids || [], function(id) { var args = { token: token }; args[idParam] = id; tryCall(tag, args, 'delete ' + what + ' ' + id); java.lang.Thread.sleep(1000); java.lang.Thread.sleep(1000); }); } } """ """ * karate.forEach(networkControllerIds, deleteControllerFn) * karate.log('--- CLEAN UP STEP 1: CLEAN UP FABRIC ---') * deleteEachId(networkControllerIds, 'classpath:hypo/deleteAll.feature@deleteFabricNetwork', 'networkControllerId', 'fabric controller') * karate.log('--- CLEAN UP STEP 2: CLEAN UP PEERING ---') * karate.log('--- CLEAN UP STEP 2: CLEAN UP PEERING ---') * def deletePeeringFn = * deleteEachId(peeringIds, 'classpath:hypo/deleteAll.feature@deletePeeringbyId', 'orgId', 'peering') """ function(id) { karate.call('classpath:hypo/deleteAll.feature@deletePeeringbyId', { token: token, orgId: id }); java.lang.Thread.sleep(1000); } """ * karate.forEach(peeringIds, deletePeeringFn) * karate.log('--- CLEAN UP STEP 3: CLEAN UP ORGANIZATIONS ---') * karate.log('--- CLEAN UP STEP 3: CLEAN UP ORGANIZATIONS ---') * def deleteOrgFn = * deleteEachId(organizationIds, 'classpath:hypo/deleteAll.feature@deleteOrganizationbyId', 'orgId', 'organization') """ function(id) { karate.call('classpath:hypo/deleteAll.feature@deleteOrganizationbyId', { token: token, orgId: id }); java.lang.Thread.sleep(1000); } """ * karate.forEach(organizationIds, deleteOrgFn) * karate.log('--- CLEAN UP STEP 4: CLEAN UP REGISTRY IMAGES---') * karate.log('--- CLEAN UP STEP 4: CLEAN UP REGISTRY IMAGES---') * def deleteRegistryImageFn = * deleteEachId(registryImageIds, 'classpath:hypo/deleteAll.feature@deleteRegistryImagebyId', 'registryImageId', 'registry image secret') """ function(id) { karate.call('classpath:hypo/deleteAll.feature@deleteRegistryImagebyId', { token: token, registryImageId: id }); java.lang.Thread.sleep(1000); } """ * karate.forEach(registryImageIds, deleteRegistryImageFn) * karate.log('--- CLEAN UP STEP 5: CLEAN UP REGISTRY PACKAGES---') * karate.log('--- CLEAN UP STEP 5: CLEAN UP REGISTRY PACKAGES---') * deleteEachId(registryPackageIds, 'classpath:hypo/deleteAll.feature@deleteRegistryPackagebyId', 'registryPackageId', 'registry package secret') * def deleteRegistryPackageFn = """ function(id) { karate.call('classpath:hypo/deleteAll.feature@deleteRegistryPackagebyId', { token: token, registryPackageId: id }); java.lang.Thread.sleep(1000); } """ * karate.forEach(registryPackageIds, deleteRegistryPackageFn) * karate.log('--- CLEAN UP STEP 6: CLEAN UP SERVICES ---') * karate.log('--- CLEAN UP STEP 6: CLEAN UP SERVICES ---') * deleteEachId(karate.get('serviceIdsToDelete', []), 'classpath:hypo/deleteAll.feature@deleteServicebyId', 'serviceId', 'service') * def serviceIdsToDelete = karate.get('serviceIdsToDelete', []) * karate.log('--- CLEAN UP STEP 7: CLEAN UP ORDERS ---') * deleteEachId(orderIdsToDelete, 'classpath:hypo/deleteAll.feature@deleteServiceOrder', 'orderId', 'service order') * def deleteServiceFn = """ function(id) { karate.call('classpath:hypo/deleteAll.feature@deleteServicebyId', { token: token, serviceId: id }); java.lang.Thread.sleep(1000); } """ * karate.forEach(serviceIdsToDelete, deleteServiceFn) * karate.log('--- CLEAN UP STEP 7: CLEAN UP ORDEDS ---') * def deleteOrderFn = """ function(id) { karate.call('classpath:hypo/deleteAll.feature@deleteServiceOrder', { token: token, orderId: id }); java.lang.Thread.sleep(1000); } """ * karate.forEach(orderIdsToDelete, deleteOrderFn) @cleanupTerminate @cleanupTerminate Scenario: Terminate active CFS and OSL services before cleanup Scenario: Terminate active and inactive CFS and OSL services before cleanup * def cfsActiveServiceIds = karate.get('cfsActiveServiceIds', []) * def cfsActiveServiceIds = karate.get('cfsActiveServiceIds', []) * def oslActiveServiceIds = karate.get('oslActiveServiceIds', []) * def oslActiveServiceIds = karate.get('oslActiveServiceIds', []) Loading @@ -155,7 +128,7 @@ Scenario: Terminate active CFS and OSL services before cleanup """ """ function(id) { function(id) { karate.log('Terminating active service:', id); karate.log('Terminating active service:', id); karate.call('classpath:hypo/service.feature@terminateServiceCleanUp', { auth_token: token, serviceId: id }); tryCall('classpath:hypo/service.feature@terminateServiceCleanUp', { auth_token: token, serviceId: id }, 'terminate service ' + id); java.lang.Thread.sleep(1000); java.lang.Thread.sleep(1000); } } Loading @@ -164,12 +137,45 @@ Scenario: Terminate active CFS and OSL services before cleanup * if (oslActiveServiceIds && oslActiveServiceIds.length > 0) karate.log('OSL:', oslActiveServiceIds) * if (oslActiveServiceIds && oslActiveServiceIds.length > 0) karate.log('OSL:', oslActiveServiceIds) * karate.log('--- STEP TERMINATE: TERMINATE ACTIVE CFS SERVICES ---') * karate.log('--- STEP TERMINATE: TERMINATE ACTIVE AND INACTIVE CFS SERVICES ---') * karate.forEach(cfsActiveServiceIds, terminateServiceFn) * karate.forEach(cfsActiveServiceIds, terminateServiceFn) * karate.log('--- STEP TERMINATE: TERMINATE ACTIVE OSL SERVICES ---') * karate.log('--- STEP TERMINATE: TERMINATE ACTIVE AND INACTIVE OSL SERVICES ---') * karate.forEach(oslActiveServiceIds, terminateServiceFn) * karate.forEach(oslActiveServiceIds, terminateServiceFn) # The PATCH only sets PENDING_TERMINATION and hands the teardown to sonata over Kafka. Wait until the services are # really TERMINATED before they are deleted. Timeout: 3 minutes. * def terminateTimeoutMs = 3 * 60 * 1000 * def terminatePollIntervalMs = 20000 * def isStillTerminating = """ function(id) { try { var svc = karate.call('classpath:hypo/service.feature@getServiceState', { auth_token: token, serviceId: id }); return svc.exists && svc.state != 'TERMINATED'; } catch (e) { return true; } } """ * def waitForTermination = """ function(ids) { var deadline = java.lang.System.currentTimeMillis() + terminateTimeoutMs; var pending = karate.filter(ids, isStillTerminating); while (pending.length > 0 && java.lang.System.currentTimeMillis() < deadline) { karate.log('Waiting for ' + pending.length + ' service(s) to reach TERMINATED: ' + pending); java.lang.Thread.sleep(terminatePollIntervalMs); pending = karate.filter(pending, isStillTerminating); } return pending; } """ * karate.log('--- STEP TERMINATE: WAIT UNTIL THE SERVICES ARE TERMINATED (max 3 minutes) ---') * def notTerminatedIds = waitForTermination(karate.append(cfsActiveServiceIds, oslActiveServiceIds)) # Still deleted afterwards: reported so a teardown that didn't finish is visible * karate.forEach(notTerminatedIds, function(id){ karate.set('cleanupFailures', karate.append(karate.get('cleanupFailures', []), 'terminate service ' + id + ': not TERMINATED after 3 minutes, deleted anyway')) }) # @cleanUp # @cleanUp Loading
src/test/resources/hypo/deleteAll.feature +12 −3 Changes for src/test/resources/hypo/deleteAll.feature: 12 added lines, 3 removed lines. Original line number Original line Diff line number Diff line Loading @@ -46,7 +46,7 @@ Scenario: Delete service And header Authorization = 'Bearer ' + token And header Authorization = 'Bearer ' + token When method delete When method delete Then match [200, 204] contains responseStatus Then match [200, 204, 404] contains responseStatus @deleteServiceOrderAfter @deleteServiceOrderAfter Loading Loading @@ -120,7 +120,16 @@ Scenario: Delete peering And header Authorization = 'Bearer ' + token And header Authorization = 'Bearer ' + token When method delete When method delete Then match [200, 204, 404] contains responseStatus * def deleteStatus = responseStatus # peering-api answers 500 when the peering does not exist # check with GET, which returns 200 with an empty body if it is gone Given url peeringUrl And path 'peering-api', 'peering', orgId And header Authorization = 'Bearer ' + token When method get * def peeringGone = responseStatus == 200 && !response Then assert deleteStatus == 200 || deleteStatus == 204 || peeringGone @deleteRegistryImagebyId @deleteRegistryImagebyId Loading Loading @@ -148,4 +157,4 @@ Scenario: Delete Service by Id And path 'tmf-api', 'serviceInventory', V4, 'service', serviceId And path 'tmf-api', 'serviceInventory', V4, 'service', serviceId And header Authorization = 'Bearer ' + token And header Authorization = 'Bearer ' + token When method delete When method delete Then match [200, 204] contains responseStatus Then match [200, 204, 404] contains responseStatus No newline at end of file No newline at end of file
src/test/resources/hypo/fabric.feature +17 Changes for src/test/resources/hypo/fabric.feature: 17 added lines, 0 removed lines. Original line number Original line Diff line number Diff line Loading @@ -24,6 +24,9 @@ Scenario: Create Fabric Network Controller * set payload_create.username = zitiUsername * set payload_create.username = zitiUsername * set payload_create.password = zitiPassword * set payload_create.password = zitiPassword # networkName is unique in fabric-api (409 on a duplicate), remove a controller left over by an earlier run * call read('classpath:hypo/fabric.feature@deleteControllersByName') { networkName: '#(payload_create.networkName)' } Given url fabricUrl Given url fabricUrl And path 'fabric-api', 'network', 'controller' And path 'fabric-api', 'network', 'controller' Loading Loading @@ -169,3 +172,17 @@ Scenario: GET All Fabric Network Controllers """ """ * def networkControllerIds = getControllerIds(response) * def networkControllerIds = getControllerIds(response) * if (networkControllerIds && networkControllerIds.length > 0) karate.log('Network Controller IDs', networkControllerIds) * if (networkControllerIds && networkControllerIds.length > 0) karate.log('Network Controller IDs', networkControllerIds) @deleteControllersByName @ignore Scenario: Delete the Fabric Network Controllers with a given networkName * karate.log('--- STEP: DELETE FABRIC NETWORK CONTROLLERS NAMED ' + networkName + ' ---') Given url fabricUrl And path 'fabric-api', 'network', 'controller' And header Authorization = 'Bearer ' + token When method get Then assert responseStatus == 200 * def leftoverIds = karate.map(karate.filter(response, function(x){ return x.networkName == networkName }), function(x){ return x.networkControllerId }) * if (leftoverIds.length > 0) karate.log('Deleting leftover Fabric Network Controller(s):', leftoverIds) * karate.forEach(leftoverIds, function(id){ karate.call('classpath:hypo/deleteAll.feature@deleteFabricNetwork', { networkControllerId: id }) })
src/test/resources/hypo/registry.feature +4 Changes for src/test/resources/hypo/registry.feature: 4 added lines, 0 removed lines. Original line number Original line Diff line number Diff line Loading @@ -23,6 +23,8 @@ Scenario: Create Registry Image * set payload_.username = registryImageUsername * set payload_.username = registryImageUsername * set payload_.password = registryImagePassword * set payload_.password = registryImagePassword * call read('classpath:hypo/deleteAll.feature@deleteRegistryImage') Given url registryUrl Given url registryUrl And path 'registry-api', 'image-pull', 'secret', 'cms-secret' And path 'registry-api', 'image-pull', 'secret', 'cms-secret' And header Content-Type = 'application/json' And header Content-Type = 'application/json' Loading @@ -46,6 +48,8 @@ Scenario: Create Registry Package * set payload_.username = registryImageUsername * set payload_.username = registryImageUsername * set payload_.password = registryImagePassword * set payload_.password = registryImagePassword * call read('classpath:hypo/deleteAll.feature@deleteRegistryPackage') Given url registryUrl Given url registryUrl And path 'registry-api', 'package-registry', 'secret', 'registry.ubitech.eu' And path 'registry-api', 'package-registry', 'secret', 'registry.ubitech.eu' And header Content-Type = 'application/json' And header Content-Type = 'application/json' Loading
src/test/resources/hypo/service.feature +19 −1 Changes for src/test/resources/hypo/service.feature: 19 added lines, 1 removed line. Original line number Original line Diff line number Diff line Loading @@ -474,9 +474,18 @@ Scenario: Terminate the Service And header Authorization = 'Bearer ' + token And header Authorization = 'Bearer ' + token And request { state: 'TERMINATED' } And request { state: 'TERMINATED' } When method patch When method patch * match [200, 409] contains responseStatus * match [200, 404, 409] contains responseStatus * print 'Status returned:', responseStatus * print 'Status returned:', responseStatus @getServiceState @ignore Scenario: Get the state of a service, null if it doesn't exist Given url baseUrl And path 'tmf-api', 'serviceInventory', V4, 'service', serviceId And header Authorization = 'Bearer ' + token When method get * def state = responseStatus == 200 ? response.state : null * def exists = responseStatus != 404 @updateServiceHelmPackage @updateServiceHelmPackage Scenario: Update the Service Helm Package via PATCH Scenario: Update the Service Helm Package via PATCH * karate.log('--- STEP: UPDATE SERVICE ---') * karate.log('--- STEP: UPDATE SERVICE ---') Loading Loading @@ -566,10 +575,15 @@ Scenario: GET All Services from Inventory * def terminatedServiceIds = getIdsByState(response, 'TERMINATED') * def terminatedServiceIds = getIdsByState(response, 'TERMINATED') * def feasibilityCheckedServiceIds = getIdsByState(response, 'FEASIBILITY_CHECKED') * def feasibilityCheckedServiceIds = getIdsByState(response, 'FEASIBILITY_CHECKED') * def activeServiceIds = getIdsByState(response, 'ACTIVE') * def activeServiceIds = getIdsByState(response, 'ACTIVE') * def inactiveServiceIds = getIdsByState(response, 'INACTIVE') # The clean-up does not terminates or deletes services in any other state (e.g. PENDING_TERMINATION), it only reports them * def handledStates = ['TERMINATED', 'FEASIBILITY_CHECKED', 'ACTIVE', 'INACTIVE'] * def otherStateServices = karate.map(karate.filter(response, function(x){ return x.id && handledStates.indexOf(x.state) < 0 }), function(x){ return { id: x.id, state: x.state } }) * if (terminatedServiceIds && terminatedServiceIds.length > 0) karate.log('Terminated Service IDs:', terminatedServiceIds) * if (terminatedServiceIds && terminatedServiceIds.length > 0) karate.log('Terminated Service IDs:', terminatedServiceIds) * if (feasibilityCheckedServiceIds && feasibilityCheckedServiceIds.length > 0) karate.log('Feasibility Checked Service IDs:', feasibilityCheckedServiceIds) * if (feasibilityCheckedServiceIds && feasibilityCheckedServiceIds.length > 0) karate.log('Feasibility Checked Service IDs:', feasibilityCheckedServiceIds) * if (activeServiceIds && activeServiceIds.length > 0) karate.log('Active Service IDs:', activeServiceIds) * if (activeServiceIds && activeServiceIds.length > 0) karate.log('Active Service IDs:', activeServiceIds) * if (inactiveServiceIds && inactiveServiceIds.length > 0) karate.log('Inactive Service IDs:', inactiveServiceIds) Loading Loading @@ -604,17 +618,21 @@ Scenario: GET All Services from Inventory * def cfsTerminatedServiceIds = getIdsByNameAndState(response, 'cfs', 'TERMINATED') * def cfsTerminatedServiceIds = getIdsByNameAndState(response, 'cfs', 'TERMINATED') * def cfsFeasibilityCheckedServiceIds = getIdsByNameAndState(response, 'cfs', 'FEASIBILITY_CHECKED') * def cfsFeasibilityCheckedServiceIds = getIdsByNameAndState(response, 'cfs', 'FEASIBILITY_CHECKED') * def cfsActiveServiceIds = getIdsByNameAndState(response, 'cfs', 'ACTIVE') * def cfsActiveServiceIds = getIdsByNameAndState(response, 'cfs', 'ACTIVE') * def cfsInactiveServiceIds = getIdsByNameAndState(response, 'cfs', 'INACTIVE') * def oslTerminatedServiceIds = getIdsByNameAndState(response, 'openslice', 'TERMINATED') * def oslTerminatedServiceIds = getIdsByNameAndState(response, 'openslice', 'TERMINATED') * def oslFeasibilityCheckedServiceIds = getIdsByNameAndState(response, 'openslice', 'FEASIBILITY_CHECKED') * def oslFeasibilityCheckedServiceIds = getIdsByNameAndState(response, 'openslice', 'FEASIBILITY_CHECKED') * def oslActiveServiceIds = getIdsByNameAndState(response, 'openslice', 'ACTIVE') * def oslActiveServiceIds = getIdsByNameAndState(response, 'openslice', 'ACTIVE') * def oslInactiveServiceIds = getIdsByNameAndState(response, 'openslice', 'INACTIVE') * if (cfsTerminatedServiceIds && cfsTerminatedServiceIds.length > 0) karate.log('CFS Terminated Service IDs:', cfsTerminatedServiceIds) * if (cfsTerminatedServiceIds && cfsTerminatedServiceIds.length > 0) karate.log('CFS Terminated Service IDs:', cfsTerminatedServiceIds) * if (cfsFeasibilityCheckedServiceIds && cfsFeasibilityCheckedServiceIds.length > 0) karate.log('CFS Feasibility Checked Service IDs:', cfsFeasibilityCheckedServiceIds) * if (cfsFeasibilityCheckedServiceIds && cfsFeasibilityCheckedServiceIds.length > 0) karate.log('CFS Feasibility Checked Service IDs:', cfsFeasibilityCheckedServiceIds) * if (cfsActiveServiceIds && cfsActiveServiceIds.length > 0) karate.log('CFS Active Service IDs:', cfsActiveServiceIds) * if (cfsActiveServiceIds && cfsActiveServiceIds.length > 0) karate.log('CFS Active Service IDs:', cfsActiveServiceIds) * if (cfsInactiveServiceIds && cfsInactiveServiceIds.length > 0) karate.log('CFS Inactive Service IDs:', cfsInactiveServiceIds) * if (oslTerminatedServiceIds && oslTerminatedServiceIds.length > 0) karate.log('OSL Terminated Service IDs:', oslTerminatedServiceIds) * if (oslTerminatedServiceIds && oslTerminatedServiceIds.length > 0) karate.log('OSL Terminated Service IDs:', oslTerminatedServiceIds) * if (oslFeasibilityCheckedServiceIds && oslFeasibilityCheckedServiceIds.length > 0) karate.log('OSL Feasibility Checked Service IDs:', oslFeasibilityCheckedServiceIds) * if (oslFeasibilityCheckedServiceIds && oslFeasibilityCheckedServiceIds.length > 0) karate.log('OSL Feasibility Checked Service IDs:', oslFeasibilityCheckedServiceIds) * if (oslActiveServiceIds && oslActiveServiceIds.length > 0) karate.log('OSL Active Service IDs:', oslActiveServiceIds) * if (oslActiveServiceIds && oslActiveServiceIds.length > 0) karate.log('OSL Active Service IDs:', oslActiveServiceIds) * if (oslInactiveServiceIds && oslInactiveServiceIds.length > 0) karate.log('OSL Inactive Service IDs:', oslInactiveServiceIds) @getAllServiceOrders @getAllServiceOrders Scenario: GET All Service Orders Scenario: GET All Service Orders Loading