sonata-nfv / tng-vnv-tee

The 5GTANGO VnV Platform Test Execution Engine
Apache License 2.0
0 stars 4 forks source link

Cannot retrive the IP of the external IP from VNF under test #7

Open felipevicens opened 6 years ago

felipevicens commented 6 years ago

When I try to retrieve the external IP address of the VNF under tests, The tee is failing here:

No such property: virtual_deployment_units for class github.h2020_5gtango.vnv.tee.model.NetworkServiceInstance

The property is not defined in the model -> https://github.com/sonata-nfv/tng-vnv-tee/blob/master/src/main/groovy/com/github/h2020_5gtango/vnv/tee/model/NetworkServiceInstance.groovy

This is the chain used to get the external IP: EXTERNAL_IP="${nsi.virtual_deployment_units[0].vnfc_instance[0].connection_points[1].interface.address}"

This is the record that the tee is trying to parse:

{
  "created_at": "2018-07-16T14:01:37.144+00:00",
  "descriptor_reference": "765ef287-e7c5-4c53-90f3-346656fdd009",
  "descriptor_version": "vnfr-schema-01",
  "status": "normal operation",
  "updated_at": "2018-07-16T14:01:37.144+00:00",
  "version": "2",
  "virtual_deployment_units": [
    {
      "number_of_instances": 1,
      "id": "vdu01",
      "vm_image": "http://www.google.es",
      "vnfc_instance": [
        {
          "vim_id": "1111-22222222-33333333-4444",
          "connection_points": [
            {
              "interface": {
                "hardware_address": "fa:16:3e:e6:be:0c",
                "address": "10.100.32.227"
              },
              "type": "management",
              "id": "mgmt"
            },
            {
              "interface": {
                "hardware_address": "fa:16:3e:88:96:28",
                "address": "10.100.32.226"
              },
              "type": "external",
              "id": "external"
            },
            {
              "interface": {
                "hardware_address": "fa:16:3e:29:d0:92",
                "address": "172.16.1.131",
                "netmask": "255.255.255.248"
              },
              "type": "internal",
              "id": "internal"
            }
          ],
          "vc_id": "4657db84-639a-421d-b643-a07c5b04f141",
          "id": "0"
        }
      ],
      "vdu_reference": "haproxy-vnf:vdu01",
      "resource_requirements": {
        "memory": {
          "size": 4,
          "size_unit": "GB"
        },
        "cpu": {
          "vcpus": 1
        },
        "storage": {
          "size": 30,
          "size_unit": "GB"
        }
      }
    }
  ],
  "virtual_links": [
    {
      "connectivity_type": "E-LAN",
      "connection_points_reference": [
        "vdu01:mgmt",
        "cpmgmt"
      ],
      "id": "vlmgmt"
    },
    {
      "connectivity_type": "E-Line",
      "connection_points_reference": [
        "vdu01:external",
        "cpexternal"
      ],
      "id": "vlexternal"
    }
  ],
  "uuid": "8e5f3bd3-22ac-4c5e-aa86-ba951ad106b6"
}
andreoug commented 6 years ago

Can you try this please:

EXTERNAL_IP="${nsi.connectionPoints['haproxy-vnf:vdu01'].external.interface.address}"
jbonnet commented 6 years ago

@allemaos please make the change to the code, commit and pull request.

Thanks

felipevicens commented 6 years ago

@allemaos This is a general test for the http request generator. The idea is to get the external IP of the VNF. I shouldn't write the name of the VNF because the test can be used to any VNF. We will use it for squid NS, haproxy NS and squid+haproxy NS. Any other option?

jbonnet commented 6 years ago

@allemaos sorry, but this should be generic, not only for the haproxy

andreoug commented 6 years ago

Would this works for you:

EXTERNAL_IP="${nsi.connectionPoints.values().first().external.interface.address}"
felipevicens commented 6 years ago

okey @allemaos, that worked. We should find a wait to abstract this kind of configurations to the test developer because is really difficult to generate it. Let's see how can we do it