Commit 6454f532 authored by Nikos Psaromanolakis's avatar Nikos Psaromanolakis
Browse files

add public k8s cluster and fix orchestratorPublic

parent d7fa23f6
Loading
Loading
Loading
Loading
Loading
+145
Changes for src/test/resources/hypo/orchestratorPrivateStress.feature: 145 added lines, 0 removed lines.
Original line number Diff line number Diff line
@smoke-e2e-workflow-private
Feature: End-to-end workflow 

Background:
  * configure afterScenario = read('classpath:hypo/afterScenario.js')

Scenario: Run full sequence once
 
  * def terminatedK8sService = false
  * def terminatedEndUserService = false


  # 1) Authenticate once for the whole sequence
  * def auth       = call read('classpath:hypo/auth.feature')
  * def auth_token = auth.accessToken
  * def token      = auth.accessToken

  # Steps 2–6: auth, registry, org, peering, specs (shared) 
  * def setupResults = call read('classpath:hypo/orchestrator-setup.feature') { auth_token: '#(auth_token)' }
  * def orgId = setupResults.orgId
  * def peered_org = setupResults.orgId
  # 7) Create Fabric controller

  * def fabricRes = call read('classpath:hypo/fabric.feature@createFabric') { auth_token: '#(auth_token)' }
  * def networkControllerId = fabricRes.networkControllerId
  
  # 8) Get Fabric controller
  
  * call read('classpath:hypo/fabric.feature@pollFabric') {auth_token: '#(auth_token)'}

  # 8a) Edit Domain Identity Resource
  * def identityId = 'FKfuWDxTQ'
  * call read('classpath:hypo/fabric.feature@updateDomainIdentityResource') {auth_token: '#(auth_token)', networkControllerId: '#(networkControllerId)', identityId: '#(identityId)'} 

  # 8b) Get Domain Identity Resource
  * call read('classpath:hypo/fabric.feature@getDomainIdentityResource') {auth_token: '#(auth_token)', networkControllerId: '#(networkControllerId)', identityId: '#(identityId)'} 


  # 9) servive order k8s
  # Create request
  * def createRes = call read('service.feature@createServiceOrderResourceK8s') { auth_token: '#(auth_token)', clusterType:'private-prek8s' }
  * def newId = createRes.serviceOrderIdK8s
  * print 'serviceOrderIdK8s:', newId
  * def serviceorderk8sid = newId
  # Poll for that specific ID

  * def pollCall = call read('service.feature@pollServiceOrder') { auth_token: '#(auth_token)', serviceOrderId: '#(serviceorderk8sid)', serviceName: 'K8aaS-Private:Openslice-athens' }
  # Get the K8s ID returned by the poll
  * def serviceK8sId = pollCall.serviceId
  * print 'The K8s service ID is:', serviceK8sId

  # 10) resource service  inventory
  * def invResSer = call read('service.feature@getServiceInventoryResource') { auth_token: '#(auth_token)', serviceId: '#(serviceK8sId)' }
  # Get the terminated payload for resourse service
  * def terminatedPayloadResource = invResSer.terminatedPayload
  * match invResSer.response.state == 'ACTIVE'
  # 11) servive order end-user
  # Create request
  * def createRes = call read('service.feature@createServiceOrderPre') { auth_token: '#(auth_token)', serviceK8sId: '#(serviceK8sId)', clusterType:'private-prek8s' }
  * def newIdEndUser = createRes.serviceOrderEndUserId
  * print 'serviceOrderId:', newIdEndUser
  * def serviceorderenduserid = newIdEndUser
  # Poll for that specific ID
  * def pollCall = call read('service.feature@pollServiceOrder') { auth_token: '#(auth_token)', serviceOrderId: '#(serviceorderenduserid)', serviceName: 'service-spec-end-user-cfs' }
  # Get the service ID returned by the poll
  * def serviceId = pollCall.serviceId
  * print 'The end-user service ID is:', serviceId
  
 
  # 12) servive inventory
  # Get request
  * def invSer = call read('service.feature@getServiceInventoryEndUser') { auth_token: '#(auth_token)', serviceId: '#(serviceId)' }
  * def resourceId = invSer.dashboardResourceId
  * def foundNamespace = invSer.serviceNamespace
  #* def cleanNamespace = foundNamespace.replace('[', '').replace(']', '').replace('"', '').trim()
  #* def cleanNamespace = foundNamespace.substring(2, foundNamespace.length - 2)
  * def terminatedPayloadEndUser = invSer.terminatedPayload
  * match invSer.response.state == 'ACTIVE'
  # Get the terminated payload for end user
  

  # Force the string to be parsed as JSON
  * json asJson = foundNamespace
  * def cleanNamespace = asJson[0]
  * print 'JSON Parsed Namespace:', cleanNamespace 

  * print 'dashboardResourceId is: ', resourceId
  # 13) resource inventory
  # Get request
  * def invRes = call read('service.feature@getResourceInventory') { auth_token: '#(auth_token)', resourceId: '#(resourceId)' }
  * def metricsDashboardUrl = invRes.metricsDashboardUrl
  * def logsDashboardUrl = invRes.logsDashboardUrl

  # 14) Telemetry checks
  #create and get token 
  * def grafanaTokenRes = call read('telemetry.feature@grafana-token') 
  * def grafanaToken = grafanaTokenRes.grafanaApiKey
  * def metricApiDashUrl = metricsDashboardUrl.replace('/d/', '/api/dashboards/uid/')
  * def logApiDashUrl = logsDashboardUrl.replace('/d/', '/api/dashboards/uid/')
  #check Grafana dashboard with panels
  * def metricGrafanaDashoard = call read('telemetry.feature@checkGrafanaDashboardMetrics') { grafanaToken: '#(grafanaToken)', dashboardUrl: '#(metricApiDashUrl)' }

  #check prometheus! validate that the metrics exist
  * def expression = metricGrafanaDashoard.firstExpr
  * def jobQuery = 'up{job="' + cleanNamespace + '"}'
  * call read('telemetry.feature@checkPrometheusMetric') { expression: '#(expression)' }
  * call read('telemetry.feature@checkPrometheusMetric') { expression: '#(jobQuery)' }
  #check Grafana dashboard for logs
  * call read('telemetry.feature@checkGrafanaDashboardLogs') { grafanaToken: '#(grafanaToken)', dashboardUrlLogs: '#(logApiDashUrl)' }

 
  
  # 15) Update the service (helm configuration)
  # Get the updated payload
  * def updatedPayload = invSer.updatedPayload
  * call read('service.feature@updateServiceHelmPackage') { auth_token: '#(auth_token)', serviceId: '#(serviceId)', updatedPayload: '#(updatedPayload)' }
  * eval java.lang.Thread.sleep(15000)
  * def invSerUp = call read('service.feature@getServiceInventoryStatePoll') { auth_token: '#(auth_token)', serviceId: '#(serviceId)', requiredStatus:'ACTIVE'}

  * eval java.lang.Thread.sleep(40000)
  # 16) Terminate the end-user service
  * call read('service.feature@terminateService') { auth_token: '#(auth_token)', serviceId: '#(serviceId)' }
  * eval java.lang.Thread.sleep(15000)
  * def invSerTer = call read('service.feature@getServiceInventoryStatePoll') { auth_token: '#(auth_token)', serviceId: '#(serviceId)', requiredStatus:'TERMINATED'}
  * def terminatedEndUserService = true
  
  # 17) Terminate the resource service
  * eval java.lang.Thread.sleep(20000)
  * call read('service.feature@terminateService') { auth_token: '#(auth_token)', serviceId: '#(serviceK8sId)' }
  
  * eval java.lang.Thread.sleep(15000)
  * def invSerUp = call read('service.feature@getServiceInventoryStatePoll') { auth_token: '#(auth_token)', serviceId: '#(serviceK8sId)', requiredStatus:'TERMINATED'}
  * def terminatedK8sService = true

  # Cleanup service orders (afterScenario handles the rest)

  * call read('classpath:hypo/deleteAll.feature@deleteServiceOrder') { auth_token: '#(auth_token)', orderId: '#(serviceorderenduserid)'}
  * call read('classpath:hypo/deleteAll.feature@deleteServiceOrder') { auth_token: '#(auth_token)', orderId: '#(serviceorderk8sid)'}

  # those are being triggered from 'afterScenario' 
  # * call read('classpath:hypo/deleteAll.feature@deletePeering') { auth_token: '#(auth_token)'}
  # * call read('classpath:hypo/deleteAll.feature@deleteOrganization') { auth_token: '#(auth_token)'}


+15 −10
Changes for src/test/resources/hypo/orchestratorPublic.feature: 15 added lines, 10 removed lines.
Original line number Diff line number Diff line
@smoke-e2e-workflow
@smoke-e2e-workflow-public
Feature: End-to-end workflow 

Background:
@@ -43,7 +43,7 @@ Scenario: Run full sequence once
  * print 'serviceOrderIdK8s:', newId
  * def serviceorderk8sid = newId
  # Poll for that specific ID
  * def pollCall = call read('service.feature@pollServiceOrder') { auth_token: '#(auth_token)', serviceOrderId: '#(serviceorderk8sid)', serviceName: 'K8aaS:Openslice-dev' }
  * def pollCall = call read('service.feature@pollServiceOrder') { auth_token: '#(auth_token)', serviceOrderId: '#(serviceorderk8sid)', serviceName: 'K8aaS-Public-ETSI:Openslice-athens' }
  # Get the K8s ID returned by the poll
  * def serviceK8sId = pollCall.serviceId
  * print 'The K8s service ID is:', serviceK8sId
@@ -74,14 +74,16 @@ Scenario: Run full sequence once
  * def foundNamespace = invSer.serviceNamespace
  #* def cleanNamespace = foundNamespace.replace('[', '').replace(']', '').replace('"', '').trim()
  #* def cleanNamespace = foundNamespace.substring(2, foundNamespace.length - 2)
  * match invSer.response.state == 'ACTIVE'
  # Get the terminated payload for end user
  * def terminatedPayloadEndUser = invSer.terminatedPayload
  * match invSer.response.state == 'ACTIVE'


  # Force the string to be parsed as JSON
  * json asJson = foundNamespace
  * def cleanNamespace = asJson[0]

  * print 'JSON Parsed Namespace:', cleanNamespace 
  * print 'dashboardResourceId is: ', resourceId

  # 13) resource inventory
  # Get request
@@ -115,22 +117,25 @@ Scenario: Run full sequence once
  # Get the updated payload
  * def updatedPayload = invSer.updatedPayload
  * call read('service.feature@updateServiceHelmPackage') { auth_token: '#(auth_token)', serviceId: '#(serviceId)', updatedPayload: '#(updatedPayload)' }
  * eval java.lang.Thread.sleep(30000)
  * def invSerUp = call read('service.feature@getServiceInventoryState') { auth_token: '#(auth_token)', serviceId: '#(serviceId)', requiredStatus:'ACTIVE'}
  * eval java.lang.Thread.sleep(15000)
  * def invSerUp = call read('service.feature@getServiceInventoryStatePoll') { auth_token: '#(auth_token)', serviceId: '#(serviceId)', requiredStatus:'ACTIVE'}
  
  * eval java.lang.Thread.sleep(40000)

  # 16) Terminate the end-user service
  * call read('service.feature@terminateService') { auth_token: '#(auth_token)', serviceId: '#(serviceId)' }
  * eval java.lang.Thread.sleep(30000)
  * def invSerTer = call read('service.feature@getServiceInventoryState') { auth_token: '#(auth_token)', serviceId: '#(serviceId)', requiredStatus:'TERMINATED'}
  * eval java.lang.Thread.sleep(15000)
  * def invSerTer = call read('service.feature@getServiceInventoryStatePoll') { auth_token: '#(auth_token)', serviceId: '#(serviceId)', requiredStatus:'TERMINATED'}
  * def terminatedEndUserService = true
  # 17) Terminate the resource service
  * eval java.lang.Thread.sleep(20000)

  * print 'serviceK8sId', serviceK8sId
  * call read('service.feature@terminateService') { auth_token: '#(auth_token)', serviceId: '#(serviceK8sId)' }
  
  * eval java.lang.Thread.sleep(30000)
  * eval java.lang.Thread.sleep(15000)

  * def invSerUp = call read('service.feature@getServiceInventoryState') { auth_token: '#(auth_token)', serviceId: '#(serviceK8sId)', requiredStatus:'TERMINATED'}
  * def invSerUp = call read('service.feature@getServiceInventoryStatePoll') { auth_token: '#(auth_token)', serviceId: '#(serviceK8sId)', requiredStatus:'TERMINATED'}
  * def terminatedK8sService = true

  # Cleanup service orders (afterScenario handles the rest)
+1 −1
Changes for src/test/resources/hypo/service.feature: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -90,7 +90,7 @@ Scenario: Create Service Order Resource K8s
    function(type) {
      if (type.contains('private')) return read('classpath:payloads/services/service-order-resource-k8s-private-pub.json');
      if (type.contains('ocm')) return read('classpath:payloads/services/service-order-resource-ocm.json');
      return read('classpath:payloads/services/service-order-resource-k8s.json');
      return read('classpath:payloads/services/service-order-resource-k8s-etsi.json');
    }
    """
  
+1 −1
Changes for src/test/resources/payloads/peering/peering-organization-pub.json: 1 added line, 1 removed line.
Original line number Diff line number Diff line
{
    "organization":   "#(peered_organization)",
    "serviceSpecs": {"30ef4343-5b8f-413b-a3e7-801d003cfb93": "K8aaS-Private", "0117c9e7-f9b1-48ae-a64e-bc904692b6dc": "K8aaS-OCM-ETSI"},
    "serviceSpecs": {"30ef4343-5b8f-413b-a3e7-801d003cfb93": "K8aaS-Private", "0117c9e7-f9b1-48ae-a64e-bc904692b6dc": "K8aaS-OCM-ETSI", "d8240849-a623-46b3-abb9-7486c3c7ce88": "K8aaS-Public-ETSI"},
    "peeredSpecs": {},
    "serviceCatalogs": []
}
 No newline at end of file
+98
Changes for src/test/resources/payloads/services/service-order-resource-k8s-etsi.json: 98 added lines, 0 removed lines.
Original line number Diff line number Diff line
{
  "id": "#(serviceOrderId)",
  "orderDate": "#(currentTime)",
  "completionDate": null,
  "expectedCompletionDate": "#(futureTime)",
  "requestedCompletionDate": "#(futureTime)",
  "requestedStartDate": "#(currentTime)",
  "startDate": "#(currentTime)",
  "@baseType": "BaseRootEntity",
  "state": "INITIAL",
  "@schemaLocation": null,
  "@type": "ServiceOrder",
  "href": null,
  "category": null,
  "description": "A service order for a wordpress-mysql service, which includes one maestro service specification (service-spec-end-user-cfs).",
  "externalId": null,
  "notificationContact": null,
  "priority": null,
  "note": [],
  "serviceOrderItem": [
    {
      "@baseType": "BaseEntity",
      "@schemaLocation": null,
      "@type": null,
      "href": null,
      "action": "add",
      "orderItemRelationship": [],
      "state": "ACKNOWLEDGED",
      "service": {
        "serviceSpecification": {
          "@baseType": "BaseEntity",
          "@schemaLocation": null,
          "@type": null,
          "href": null,
          "name": "K8aaS-Public-ETSI:Openslice-athens",
          "version": "1.2.0",
          "targetServiceSchema": null,
          "@referredType": null,
          "id": "d8240849-a623-46b3-abb9-7486c3c7ce88"
        },
        "@baseType": "BaseEntity",
        "@schemaLocation": null,
        "@type": null,
        "href": null,
        "name": "K8aaS-Public-ETSI:Openslice-athens",
        "category": null,
        "serviceType": null,
        "place": [],
        "relatedParty": [],
        "serviceCharacteristic": [
          {
            "@baseType": "BaseRootEntity",
            "@schemaLocation": null,
            "@type": null,
            "href": null,
            "name": "Flavor of Nodes",
            "valueType": "ENUM",
            "value": {
              "value": "cpu4.m8192.d20g",
              "alias": null
            }
          },
          {
            "@baseType": "BaseRootEntity",
            "@schemaLocation": null,
            "@type": null,
            "href": null,
            "name": "Number of worker nodes",
            "valueType": "TEXT",
            "value": {
              "value": "1",
              "alias": null
            }
          }
        ],
        "state": "feasibilityChecked",
        "supportingResource": [],
        "serviceRelationship": [],
        "supportingService": []
      },
      "appointment": null
    }
  ],
  "orderRelationship": [],
  "relatedParty": [
    {
      "@baseType": "BaseRootEntity",
      "@schemaLocation": null,
      "@type": null,
      "href": null,
      "name": "UBITECH",
      "role": "REQUESTER",
      "@referredType": "SimpleUsername_Individual",
      "id": "2c034f2b-4ecc-44cc-9af3-6633aa96b217",
      "extendedInfo": null
    }
  ]
}
 No newline at end of file