From ab7a87456538e561d60d209fe534c175ddd0269c Mon Sep 17 00:00:00 2001 From: Sastry Isukapalli Date: Wed, 28 Mar 2018 22:21:30 -0400 Subject: Functest scripts, simulators, and payloads osdf/adapters/policy/utils.py: Removed duplicated code (group_policies and group_policies_gen are very similar, and group_policies seems to be not used osdf/optimizers/placementopt/conductor/api_builder.py: changed param name from "grouped_policies" to "flat_policies" tox.ini added starup and shutdown of simulators (flask app with mock payloads) in tox tests rest all files/changes in "test/" folder quite a few payload files Patch set 2: removed a "print()" statement from simulator code Issue-ID: OPTFRA-22 Change-Id: I0006c577fc459c7c884b55e8316c689afd151780 Signed-off-by: Sastry Isukapalli --- .../simulators/simulated-config/common_config.yaml | 63 ++++++++++++++++++++++ .../simulators/simulated-config/has_config.yaml | 24 +++++++++ .../simulators/simulated-config/osdf_config.yaml | 34 ++++++++++++ .../simulators/simulated-config/simulated-config | 1 + 4 files changed, 122 insertions(+) create mode 100644 test/functest/simulators/simulated-config/common_config.yaml create mode 100644 test/functest/simulators/simulated-config/has_config.yaml create mode 100755 test/functest/simulators/simulated-config/osdf_config.yaml create mode 120000 test/functest/simulators/simulated-config/simulated-config (limited to 'test/functest/simulators/simulated-config') diff --git a/test/functest/simulators/simulated-config/common_config.yaml b/test/functest/simulators/simulated-config/common_config.yaml new file mode 100644 index 0000000..770fef2 --- /dev/null +++ b/test/functest/simulators/simulated-config/common_config.yaml @@ -0,0 +1,63 @@ +osdf_system: + libpath: /opt/app/osdf/libs + osdf_ports: + internal: 8699 # inside the Docker container, the app listens to this port + external: 8698 # clients use this port on DockerHost + osdf_ip_default: 0.0.0.0 +# # Important Note: At deployment time, we need to ensure the port mapping is done +# ssl_context: ['./../etc/sniromanager.crt', './../etc/sniromanager.key'] + +osdf_temp: # special configuration required for "workarounds" or testing + local_policies: + global_disabled: True + local_placement_policies_enabled: True + placement_policy_files_vcpe: # workaroud for policy platform glitches (or "work-arounds" for other components) + - Affinity_vCPE_1.json + - Capacity_vGMuxInfra.json + - Capacity_vG_1.json + - Distance_vGMuxInfra_1.json + - Distance_vG_1.json + - Placement_Optimization_1.json + - QueryPolicy_vCPE.json + - hpa_policy_vGMuxInfra_1.json + - hpa_policy_vG_1.json + - vnfPolicy_vG.json + - vnfPolicy_vGMuxInfra.json +service_info: + vCPE: + vcpeHostName: requestParameters.vcpeHostName + e2eVpnKey: requestParameters.e2eVpnKey + +references: + service_name: + source: request + value: serviceInfo.serviceName + subscriber_role: + source: SubscriberPolicy + value: content.properties.subscriberRole + +policy_info: + prioritization_attributes: + policy_type: + - content.policyType + resources: + - content.resources + - content.objectiveParameter.parameterAttributes.resources + service_name: + - content.serviceName + + placement: + policy_fetch: by_scope + policy_scope: + default_scope: OSDF_R2 + vcpe_scope: OSDF_R2 + secondary_scopes: + - + - get_param: service_name + - SubscriberPolicy + - + - get_param: service_name + - get_param: subscriber_role + default: # if no explicit service related information is needed + policy_fetch: by_name + policy_scope: none diff --git a/test/functest/simulators/simulated-config/has_config.yaml b/test/functest/simulators/simulated-config/has_config.yaml new file mode 100644 index 0000000..8cbeda2 --- /dev/null +++ b/test/functest/simulators/simulated-config/has_config.yaml @@ -0,0 +1,24 @@ +policy_config_mapping: + attributes: + hypervisor: hypervisor, + cloud_version: cloudVersion, + cloud_type: cloudType, + dataplane: dataPlane, + network_roles: networkRoles, + complex: complex, + state: state, + country: country, + geo_region: geoRegion, + exclusivity_groups: exclusivityGroups, + replication_role: replicationRole, + remapping: + model-invariant-id: modelInvariantId, + model-version-id: modelVersionId + candidates: + # for (k1, v1), if k1 is in demand, set prop[k2] = _get_candidates(demand[k1]) + exclusionCandidateInfo: excluded_candidates, + requiredCandidateInfo: required_candidates + extra_fields: + # we have [k1, k2, k3, k4] type items and x is policy-content-properties + # if x[k1] == k2: set prop[k3] = k4 + - [inventoryType, cloud, region, {get_param: CHOSEN_REGION}] \ No newline at end of file diff --git a/test/functest/simulators/simulated-config/osdf_config.yaml b/test/functest/simulators/simulated-config/osdf_config.yaml new file mode 100755 index 0000000..a192b70 --- /dev/null +++ b/test/functest/simulators/simulated-config/osdf_config.yaml @@ -0,0 +1,34 @@ +osdfUserNameForSO: "" # The OSDF Manager username for MSO. +odfPasswordForSO: "" # The OSDF Manager password for MSO. + +# msoUrl: "" # The SO url for call back. This will be part of the request, so no need +soUsername: "" # SO username for call back. +soPassword: "" # SO password for call back. + +conductorUrl: "http://localhost:5000/simulated/oof/has-api/flow1-success-simple/main.json" +conductorUsername: "CONDUCTOR-USER" +conductorPassword: "CONDUCTOR-PASSWD" +conductorPingWaitTime: 2 # seconds to wait before calling the conductor retry URL +conductorMaxRetries: 5 # if we don't get something in 30 minutes, give up + +# Policy Platform -- requires ClientAuth, Authorization, and Environment +policyPlatformUrl: http://localhost:5001/simulated/policy/pdp-has-vcpe-good/pdp/getConfig # Policy Dev platform URL +policyPlatformEnv: TEST # Environment for policy platform +policyPlatformUsername: POLICY-USER # Policy platform username. +policyPlatformPassword: POLICY-PASSWD # Policy platform password. +policyClientUsername: POLICY-CLIENT-USER # For use with ClientAuth +policyClientPassword: POLICY-CLIENT-PASSWD # For use with ClientAuth + +messageReaderHosts: https://DMAAP-HOST1:3905,https://DMAAP-HOST2:3905,https://DMAAP-HOST3:3905 +messageReaderTopic: org.onap.oof.osdf.multicloud +messageReaderAafUserId: DMAAP-OSDF-MC-USER +messageReaderAafPassword: DMAAP-OSDF-MC-PASSWD + +sdcUrl: https://SDC-HOST:8443/sdc/v1/catalog +sdcUsername: SDC-OSDF-USER +sdcPassword: SDC-OSDF-PASSWD +sdcONAPInstanceID: ONAP-OSDF + +osdfPlacementUrl: "http://127.0.0.1:24699/osdf/api/v2/placement" +osdfPlacementUsername: "test" +osdfPlacementPassword: "testpwd" diff --git a/test/functest/simulators/simulated-config/simulated-config b/test/functest/simulators/simulated-config/simulated-config new file mode 120000 index 0000000..9c5a662 --- /dev/null +++ b/test/functest/simulators/simulated-config/simulated-config @@ -0,0 +1 @@ +/Users/sastry/PycharmProjects/osdf/test/functest/simulators/simulated-config \ No newline at end of file -- cgit 1.2.3-korg