Draft: [REVIEW NEEDED] Resolve "Create Helper Basic Testplan"

Proposers

  • Miguel Ángel Adorna (Telefonica)

Description

This MR adds tests for helper service, in the /getInvokers and the /getProviders endpoints

Acknowledgements

This work is funded by the European Commission through the HORIZON-JU-SNS-2022 FIDAL project with Grant Agreement number 101096146.

Closes #181

Merge request reports

Loading
+945

File changed.

Preview size limit exceeded, changes collapsed.

+8 −5
Changes for tests/libraries/common/bodyRequests.py: 8 added lines, 5 removed lines.
Original line number Diff line number Diff line
@@ -11,29 +11,32 @@ def check_variable(input, data_type):
    print(input)
    print(type(input))
    print(data_type)
    allowed_types = [t.strip() for t in data_type.split("|")]
    if "None" in allowed_types and input is None:
        return True
    if isinstance(input, list):
        for one in input:
            check_variable(one, data_type)
        return True
    if data_type == "string":
    if "string" in allowed_types:
        if isinstance(input, str):
            return True
        else:
            raise Exception("variable is not string type")
    elif data_type == "integer":
    elif "integer" in allowed_types:
        if isinstance(input, int):
            return True
        else:
            raise Exception("variable is not integer type")
    elif data_type == "boolean":
    elif "boolean" in allowed_types:
        if isinstance(input, boolean):
            return True
        else:
            raise Exception("variable is not integer type")
    elif data_type == "URI":
    elif "URI" in allowed_types:
        check_uri(input, data_type)
        return True
    elif data_type == "URI_reference":
    elif "URI_reference" in allowed_types:
        check_uri(input, data_type)
        return True
    elif data_type not in capif_types.keys():
+160 −3
Changes for tests/libraries/common/types.json: 160 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -50,7 +50,14 @@
      "websockNotifConfig": "WebsockNotifConfig",
      "apiList": "ServiceAPIDescription",
      "apiInvokerInformation": "string",
      "supportedFeatures": "SupportedFeatures"
      "supportedFeatures": "SupportedFeatures",
      "failureReasons": "EnrolFailReason"
    }
  },
  "EnrolFailReason":{
    "mandatory_attributes": {
      "apiName": "string",
      "failureCode": "string"
    }
  },
  "OnboardingInformation": {
@@ -59,7 +66,33 @@
    },
    "optional_attributes": {
      "apiInvokerCertificate": "string",
      "onboardingSecret": "string"
      "onboardingSecret": "string",
      "onboardingCriteria": "OnboardingCriteria"
    }
  },
  "OnboardingCriteria": {
    "mandatory_attributes": {
      "secMethods": "SecurityMethod"
    },
    "optional_attributes": {
      "relatedCriteria": "RelatedCriteria"
    }
  },
  "RelatedCriteria":{
    "mandatory_attributes": {},
    "optional_attributes": {
      "aefIds": "string",
      "apis": "ApiInfo",
      "serviceAPICategories": "string"
    },
    "oneOf": ["aefIds", "apis", "serviceAPICategories"]
  },
  "ApiInfo" : {
    "mandatory_attributes": {
      "apiName":  "string"
    },
    "optional_attributes": {
      "supportedApiVersions": "string"
    }
  },
  "WebsockNotifConfig": {
@@ -729,6 +762,130 @@
      "startTime": "string",
      "stopTime": "string"
    }
  },
  "InvokersResponse": {
    "mandatory_attributes": {},
    "optional_attributes": {
      "invokers": "InvokersResponseAPIInvokerEnrolmentDetails",
      "long": "integer",
      "sortOrder": "string | None",
      "total": "integer",
      "totalPages": "integer",
      "message": "string"
    }
  },
  "InvokersResponseAPIInvokerEnrolmentDetails": {
    "mandatory_attributes": {
      "api_invoker_id": "string",
      "onboarding_information": "InvokersResponseOnboardingInformation",
      "api_invoker_information": "string",
      "notification_destination": "URI",
      "uuid": "string"
    },
    "optional_attributes": {
      "request_test_notification": "boolean",
      "websock_notif_config": "InvokersResponseWebsockNotifConfig",
      "api_invoker_information": "string",
      "supported_features": "SupportedFeatures",
      "api_list": "ServiceAPIDescription | None",
      "exp_time": "string | None",
      "onboarding_date": "string",
      "username": "string",
      "api_invoker_certificate": "string",
      "failure_reasons": "InvokerResponseEnrolFailReason | None"
    }
  },
  "InvokerResponseEnrolFailReason":{
    "mandatory_attributes": {
      "api_ame": "string",
      "failure_ode": "string"
    },
    "optional_attributes": {}
  },
  "InvokerResponseOnboardingCriteria": {
    "mandatory_attributes": {
      "sec_methods": "SecurityMethod"
    },
    "optional_attributes": {
      "related_criteria": "InvokerResponseRelatedCriteria"
    }
  },
  "InvokerResponseRelatedCriteria":{
    "mandatory_attributes": {},
    "optional_attributes": {
      "aef_ids": "string",
      "apis": "InvokerResponseApiInfo",
      "service_api_categories": "string"
    },
    "oneOf": ["aef_ids", "apis", "service_api_categories"]
  },
  "InvokerResponseApiInfo" : {
    "mandatory_attributes": {
      "api_name":  "string"
    },
    "optional_attributes": {
      "supported_api_versions": "string"
    }
  },
  "InvokersResponseOnboardingInformation": {
    "mandatory_attributes": {
      "api_invoker_public_key": "string"
    },
    "optional_attributes": {
      "api_invoker_certificate": "string",
      "onboarding_secret": "string",
      "onboarding_criteria": "InvokerResponseOnboardingCriteria | None"
    }
  },
  "InvokersResponseWebsockNotifConfig": {
    "mandatory_attributes": {},
    "optional_attributes": {
      "websocket_uri": "URI_reference",
      "request_websocket_uri": "boolean"
    }
  },
  "ProvidersResponse": {
    "mandatory_attributes": {},
    "optional_attributes": {
      "providers": "ProvidersResponseAPIProviderEnrolmentDetails",
      "long": "integer",
      "sortOrder": "string | None",
      "total": "integer",
      "totalPages": "integer",
      "message": "string"
    }
  },
  "ProvidersResponseAPIProviderEnrolmentDetails": {
    "mandatory_attributes": {
      "reg_sec": "string",
      "api_prov_dom_id": "string"
    },
    "optional_attributes": {
      "api_prov_funcs": "ProvidersResponseAPIProviderFunctionDetails",
      "api_prov_dom_info": "string",
      "supp_feat": "SupportedFeatures",
      "fail_reason": "string",
      "api_prov_name": "string | None",
      "onboarding_date": "string",
      "username": "string",
      "uuid": "string"
    }
  },
  "ProvidersResponseAPIProviderFunctionDetails": {
    "mandatory_attributes": {
      "reg_info": "ProvidersResponseRegistrationInformation",
      "api_prov_func_role": "ApiProviderFuncRole",
      "api_prov_func_id": "string"
    },
    "optional_attributes": {
      "api_prov_func_info": "string"
    }
  },
  "ProvidersResponseRegistrationInformation": {
    "mandatory_attributes": {
      "api_prov_pub_key": "string",
      "api_prov_cert": "string"
    },
    "optional_attributes": {}
  }

}
+3 −1
Changes for tests/resources/common/basicRequests.robot: 3 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -188,6 +188,7 @@ Get Request Capif
    ...    ${verify}=${FALSE}
    ...    ${cert}=${NONE}
    ...    ${username}=${NONE}
    ...    ${params}=${NONE}

    ${headers}=    Create CAPIF Session    ${server}    ${access_token}

@@ -202,6 +203,7 @@ Get Request Capif
    ...    expected_status=any
    ...    verify=${verify}
    ...    cert=${cert}
    ...    params=${params}
    RETURN    ${resp}

Get CA Vault
@@ -970,7 +972,7 @@ Get Number Of Services

Get Capif Ccf Id
    ${resp}=    Get Request Capif
    ...    /helper/getCcfId
    ...    /helper/api/getCcfId
    ...    server=${CAPIF_HTTPS_URL}
    ...    verify=ca.crt
    ...    username=${SUPERADMIN_USERNAME}
Loading