diff options
Diffstat (limited to 'plans/so/integration-etsi-testing')
7 files changed, 66 insertions, 8 deletions
diff --git a/plans/so/integration-etsi-testing/config/aai-simulator-populate-data/cloud-esr-system-info.json b/plans/so/integration-etsi-testing/config/aai-simulator-populate-data/cloud-esr-system-info.json new file mode 100644 index 00000000..43680038 --- /dev/null +++ b/plans/so/integration-etsi-testing/config/aai-simulator-populate-data/cloud-esr-system-info.json @@ -0,0 +1,14 @@ +{ + "esr-system-info-id": "e6a0b318-9756-4f11-94e8-919312d6c2bd", + "system-name": "csit cloud vim", + "type": "OPENSTACK", + "vendor": "RedHat", + "version": "1", + "service-url": "https://csit.etsicloud.com:5000/v3/", + "user-name": "bW1vcnJpcasdw==", + "password": "N0xLcHM1VDRSCCSECSVBESDU0", + "system-type": "VIM", + "port": "example-port-val-93234", + "cloud-domain": "CCP_Domain_34466", + "default-tenant": "693c7729b2364a26a3ca602e6f66187d" +} diff --git a/plans/so/integration-etsi-testing/config/aai-simulator-populate-data/esr-system-info.json b/plans/so/integration-etsi-testing/config/aai-simulator-populate-data/esr-system-info.json new file mode 100644 index 00000000..f19da917 --- /dev/null +++ b/plans/so/integration-etsi-testing/config/aai-simulator-populate-data/esr-system-info.json @@ -0,0 +1,11 @@ +{ + "esr-system-info-id": "5c067098-f2e3-40f7-a7ba-155e7c61e916", + "system-name": "vnfmSimulator", + "type": "simulator", + "vendor": "EST", + "version": "V1.0", + "service-url": "http://vnfm-simulator:9093/vnflcm/v1", + "user-name": "vnfmadapter", + "password": "123456", + "system-type": "VNFM" +} diff --git a/plans/so/integration-etsi-testing/config/aai-simulator-populate-data/esr-vnfm.json b/plans/so/integration-etsi-testing/config/aai-simulator-populate-data/esr-vnfm.json new file mode 100644 index 00000000..e37dac5b --- /dev/null +++ b/plans/so/integration-etsi-testing/config/aai-simulator-populate-data/esr-vnfm.json @@ -0,0 +1,5 @@ +{ + "vnfm-id": "c5e99cee-1996-4606-b697-838d51d4e1a3", + "vim-id": "etsiCsitVimId", + "certificate-url": "" +} diff --git a/plans/so/integration-etsi-testing/config/populate-aai-simulator.sh b/plans/so/integration-etsi-testing/config/populate-aai-simulator.sh index 3f91f0da..16dc09f6 100755 --- a/plans/so/integration-etsi-testing/config/populate-aai-simulator.sh +++ b/plans/so/integration-etsi-testing/config/populate-aai-simulator.sh @@ -58,6 +58,9 @@ populate_aai_simulator() PLATFORM_JSON_FILE=$AAI_SIMULATOR_DATA_DIR/platform.json CLOUD_REGION_JSON_FILE=$AAI_SIMULATOR_DATA_DIR/cloud-region.json TENANT_JSON_FILE=$AAI_SIMULATOR_DATA_DIR/tenant.json + ESR_VNFM_JSON_FILE=$AAI_SIMULATOR_DATA_DIR/esr-vnfm.json + ESR_SYSTEM_INFO_JSON_FILE=$AAI_SIMULATOR_DATA_DIR/esr-system-info.json + CLOUD_ESR_SYSTEM_INFO_JSON_FILE=$AAI_SIMULATOR_DATA_DIR/cloud-esr-system-info.json STATUS_CODE_ACCEPTED="202" echo "$SCRIPT_NAME $(current_timestamp): checking health of AAI Simulator" @@ -128,6 +131,31 @@ populate_aai_simulator() exit 1 fi + echo "$SCRIPT_NAME $(current_timestamp): Adding esr-vnfm" + status_code=$(curl -k --write-out %{http_code} --silent --output /dev/null -H "$BASIC_AUTHORIZATION_HEADER" -H "$ACCEPT_HEADER" -H "$CONTENT_TYPE_HEADER" $BASE_URL/external-system/esr-vnfm-list/esr-vnfm/c5e99cee-1996-4606-b697-838d51d4e1a3 -X PUT -d @$"$ESR_VNFM_JSON_FILE") + + if [[ "$status_code" -ne "$STATUS_CODE_ACCEPTED" ]] ; then + echo "$SCRIPT_NAME $(current_timestamp) ERROR: Unable to put esr-vnfm data in AAI Simulator. Status code received: $status_code" + exit 1 + fi + + echo "$SCRIPT_NAME $(current_timestamp): Adding esr-system-info" + status_code=$(curl -k --write-out %{http_code} --silent --output /dev/null -H "$BASIC_AUTHORIZATION_HEADER" -H "$ACCEPT_HEADER" -H "$CONTENT_TYPE_HEADER" $BASE_URL/external-system/esr-vnfm-list/esr-vnfm/c5e99cee-1996-4606-b697-838d51d4e1a3/esr-system-info-list/esr-system-info/5c067098-f2e3-40f7-a7ba-155e7c61e916 -X PUT -d @$"$ESR_SYSTEM_INFO_JSON_FILE") + + if [[ "$status_code" -ne "$STATUS_CODE_ACCEPTED" ]] ; then + echo "$SCRIPT_NAME $(current_timestamp) ERROR: Unable to put esr-system-info data in AAI Simulator. Status code received: $status_code" + exit 1 + fi + + echo "$SCRIPT_NAME $(current_timestamp): Adding cloud esr-system-info" + status_code=$(curl -k --write-out %{http_code} --silent --output /dev/null -H "$BASIC_AUTHORIZATION_HEADER" -H "$ACCEPT_HEADER" -H "$CONTENT_TYPE_HEADER" $BASE_URL/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/EtsiCloudRegion/esr-system-info-list/esr-system-info/e6a0b318-9756-4f11-94e8-919312d6c2bd -X PUT -d @$"$CLOUD_ESR_SYSTEM_INFO_JSON_FILE") + + if [[ "$status_code" -ne "$STATUS_CODE_ACCEPTED" ]] ; then + echo "$SCRIPT_NAME $(current_timestamp) ERROR: Unable to put cloud esr-system-info data in AAI Simulator. Status code received: $status_code" + exit 1 + fi + + echo "$SCRIPT_NAME $(current_timestamp): AAI Simulator Populated Successfully" } diff --git a/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/main/java/org/onap/so/aaisimulator/controller/ExternalSystemEsrController.java b/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/main/java/org/onap/so/aaisimulator/controller/ExternalSystemEsrController.java index efe5b207..b356006c 100644 --- a/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/main/java/org/onap/so/aaisimulator/controller/ExternalSystemEsrController.java +++ b/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/main/java/org/onap/so/aaisimulator/controller/ExternalSystemEsrController.java @@ -61,7 +61,7 @@ public class ExternalSystemEsrController { this.cacheServiceProvider = cacheServiceProvider; } - @PutMapping(value = "esr-vnfm/{vnfm-id}", consumes = {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}, + @PutMapping(value = "/esr-vnfm/{vnfm-id}", consumes = {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}, produces = {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) public ResponseEntity<?> putEsrVnfm(@RequestBody final EsrVnfm esrVnfm, @PathVariable("vnfm-id") final String vnfmId, final HttpServletRequest request) { @@ -75,7 +75,7 @@ public class ExternalSystemEsrController { return ResponseEntity.accepted().build(); } - @GetMapping(value = "esr-vnfm/{vnfm-id}", produces = {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) + @GetMapping(value = "/esr-vnfm/{vnfm-id}", produces = {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) public ResponseEntity<?> getEsrVnfm(@PathVariable("vnfm-id") final String vnfmId, final HttpServletRequest request) { LOGGER.info("Will retrieve ESR VNFM for 'vnfm id': {} ...", vnfmId); @@ -104,7 +104,7 @@ public class ExternalSystemEsrController { return ResponseEntity.ok(esrVnfmList); } - @PutMapping(value = "esr-vnfm/{vnfm-id}/esr-system-info-list/esr-system-info/{esr-system-info-id}", + @PutMapping(value = "/esr-vnfm/{vnfm-id}/esr-system-info-list/esr-system-info/{esr-system-info-id}", consumes = {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}, produces = {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) public ResponseEntity<?> putEsrSystemInfo(@RequestBody final EsrSystemInfo esrSystemInfo, @@ -127,7 +127,7 @@ public class ExternalSystemEsrController { return getRequestErrorResponseEntity(request, ESR_SYSTEM_INFO_LIST); } - @GetMapping(value = "esr-vnfm/{vnfm-id}/esr-system-info-list", + @GetMapping(value = "/esr-vnfm/{vnfm-id}/esr-system-info-list", produces = {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) public ResponseEntity<?> getEsrSystemInfoList(@PathVariable("vnfm-id") final String vnfmId, final HttpServletRequest request) { diff --git a/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/main/java/org/onap/so/aaisimulator/utils/Constants.java b/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/main/java/org/onap/so/aaisimulator/utils/Constants.java index dd644d16..b4b562be 100644 --- a/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/main/java/org/onap/so/aaisimulator/utils/Constants.java +++ b/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/main/java/org/onap/so/aaisimulator/utils/Constants.java @@ -43,11 +43,11 @@ public class Constants { public static final String PLATFORMS_URL = BUSINESS_URL + "/platforms/platform/"; - public static final String EXTERNAL_SYSTEM_ESR_VNFM_LIST_URL = "/external-system/esr-vnfm-list/"; + public static final String EXTERNAL_SYSTEM_ESR_VNFM_LIST_URL = BASE_URL + "/external-system/esr-vnfm-list"; public static final String NETWORK_URL = BASE_URL + "/network"; - public static final String GENERIC_VNFS_URL = NETWORK_URL + "/generic-vnfs/"; + public static final String GENERIC_VNFS_URL = NETWORK_URL + "/generic-vnfs"; public static final String RELATIONSHIP_LIST_RELATIONSHIP_URL = "/relationship-list/relationship"; diff --git a/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/test/java/org/onap/so/aaisimulator/utils/TestConstants.java b/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/test/java/org/onap/so/aaisimulator/utils/TestConstants.java index d0a46811..79bf624a 100644 --- a/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/test/java/org/onap/so/aaisimulator/utils/TestConstants.java +++ b/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/test/java/org/onap/so/aaisimulator/utils/TestConstants.java @@ -50,7 +50,7 @@ public class TestConstants { public static final String GENERIC_VNF_NAME = "EsyVnfInstantiationTest2"; - public static final String GENERIC_VNF_URL = Constants.GENERIC_VNFS_URL + "generic-vnf/"; + public static final String GENERIC_VNF_URL = Constants.GENERIC_VNFS_URL + "/generic-vnf/"; public static final String GENERIC_VNFS_URL = "/generic-vnfs"; @@ -68,7 +68,7 @@ public class TestConstants { public static final String TENANTS_TENANT = "/tenants/tenant/"; - public static final String ESR_VNFM_URL = EXTERNAL_SYSTEM_ESR_VNFM_LIST_URL + "esr-vnfm/"; + public static final String ESR_VNFM_URL = EXTERNAL_SYSTEM_ESR_VNFM_LIST_URL + "/esr-vnfm/"; public static final String ESR_VNFM_ID = "c5e99cee-1996-4606-b697-838d51d4e1a3"; |