From 47aaf95ecee286c26ee30b1acecdbcb930f9b6bf Mon Sep 17 00:00:00 2001 From: "waqas.ikram" Date: Thu, 2 Mar 2023 16:33:00 +0000 Subject: Adding CNFM testing basic setup Change-Id: I59999a001f4a861a6cc955b839180374675f5405 Issue-ID: SO-4067 Signed-off-by: waqas.ikram --- plans/so/integration-cnfm-testing/.gitignore | 22 ++ .../service-EricssonDemoService1-csar.csar | Bin 0 -> 332839 bytes plans/so/integration-cnfm-testing/config/env | 9 + .../api-handler-infra/onapheat/override.yaml | 135 ++++++++ .../bpmn-infra/onapheat/override.yaml | 370 +++++++++++++++++++++ .../catalog-db-adapter/onapheat/override.yaml | 101 ++++++ .../sdc-controller/onapheat/override.yaml | 81 +++++ .../override-files/so-cnfm/onapheat/override.yaml | 40 +++ .../so-monitoring/onapheat/override.yaml | 24 ++ .../docker-compose.local.yml | 26 ++ .../so/integration-cnfm-testing/docker-compose.yml | 287 ++++++++++++++++ plans/so/integration-cnfm-testing/setup.sh | 190 +++++++++++ plans/so/integration-cnfm-testing/teardown.sh | 52 +++ plans/so/integration-cnfm-testing/testplan.txt | 2 + .../kind-cluster/Dockerfile.kind-cluster | 4 +- .../kind-cluster/entrypoint-original.sh | 2 +- .../docker/docker-files/kind-cluster/entrypoint.sh | 1 + 17 files changed, 1343 insertions(+), 3 deletions(-) create mode 100644 plans/so/integration-cnfm-testing/.gitignore create mode 100755 plans/so/integration-cnfm-testing/config/distribution-test-zip/unzipped/unzipped_cnf_csar/v1/catalog/services/EricssonDemoService1/1.0/artifacts/service-EricssonDemoService1-csar.csar create mode 100644 plans/so/integration-cnfm-testing/config/env create mode 100644 plans/so/integration-cnfm-testing/config/override-files/api-handler-infra/onapheat/override.yaml create mode 100644 plans/so/integration-cnfm-testing/config/override-files/bpmn-infra/onapheat/override.yaml create mode 100644 plans/so/integration-cnfm-testing/config/override-files/catalog-db-adapter/onapheat/override.yaml create mode 100644 plans/so/integration-cnfm-testing/config/override-files/sdc-controller/onapheat/override.yaml create mode 100644 plans/so/integration-cnfm-testing/config/override-files/so-cnfm/onapheat/override.yaml create mode 100644 plans/so/integration-cnfm-testing/config/override-files/so-monitoring/onapheat/override.yaml create mode 100644 plans/so/integration-cnfm-testing/docker-compose.local.yml create mode 100644 plans/so/integration-cnfm-testing/docker-compose.yml create mode 100755 plans/so/integration-cnfm-testing/setup.sh create mode 100755 plans/so/integration-cnfm-testing/teardown.sh create mode 100644 plans/so/integration-cnfm-testing/testplan.txt diff --git a/plans/so/integration-cnfm-testing/.gitignore b/plans/so/integration-cnfm-testing/.gitignore new file mode 100644 index 00000000..44793d73 --- /dev/null +++ b/plans/so/integration-cnfm-testing/.gitignore @@ -0,0 +1,22 @@ +target +**/.settings +**/.classpath +**/.project +**/.buildpath +**/.factorypath +**/.springBeans +.idea +.checkstyle +.DS_Store +.*~ +*.iml +*.class +*.swp +*.log +*.tmp +**/bin/ +/.metadata/ +temp/ +**/temp/** +test_lab/ +**/test_lab/** diff --git a/plans/so/integration-cnfm-testing/config/distribution-test-zip/unzipped/unzipped_cnf_csar/v1/catalog/services/EricssonDemoService1/1.0/artifacts/service-EricssonDemoService1-csar.csar b/plans/so/integration-cnfm-testing/config/distribution-test-zip/unzipped/unzipped_cnf_csar/v1/catalog/services/EricssonDemoService1/1.0/artifacts/service-EricssonDemoService1-csar.csar new file mode 100755 index 00000000..7c8223e8 Binary files /dev/null and b/plans/so/integration-cnfm-testing/config/distribution-test-zip/unzipped/unzipped_cnf_csar/v1/catalog/services/EricssonDemoService1/1.0/artifacts/service-EricssonDemoService1-csar.csar differ diff --git a/plans/so/integration-cnfm-testing/config/env b/plans/so/integration-cnfm-testing/config/env new file mode 100644 index 00000000..9614940c --- /dev/null +++ b/plans/so/integration-cnfm-testing/config/env @@ -0,0 +1,9 @@ +NEXUS_DOCKER_REPO_MSO=nexus3.onap.org:10001 +DOCKER_ENVIRONMENT=local +TIME_OUT_DEFAULT_VALUE_SEC=600 +PROJECT_NAME=cnfmintegrationtesting +DEFAULT_NETWORK_NAME=cnfmintegrationtesting_default +SO_IMAGE_VERSION=1.9.0-SNAPSHOT +SO_ADMIN_COCKPIT_IMAGE_VERSION=1.9.0-SNAPSHOT +MARIADB_VERSION=10.5.8 +SO_CNFM_AS_LCM=1.9.0-SNAPSHOT \ No newline at end of file diff --git a/plans/so/integration-cnfm-testing/config/override-files/api-handler-infra/onapheat/override.yaml b/plans/so/integration-cnfm-testing/config/override-files/api-handler-infra/onapheat/override.yaml new file mode 100644 index 00000000..327e7987 --- /dev/null +++ b/plans/so/integration-cnfm-testing/config/override-files/api-handler-infra/onapheat/override.yaml @@ -0,0 +1,135 @@ +server: + port: 8080 + tomcat: + max-threads: 50 +ssl-enable: false + +mso: + msoKey: 07a7159d3bf51a0e53be7a8f89699be7 + logPath: logs + site-name: onapheat + adapters: + requestDb: + endpoint: http://request-db-adapter:8083 + auth: Basic YnBlbDpwYXNzd29yZDEk + catalog: + db: + spring: + endpoint: http://catalog-db-adapter:8082 + db: + auth: Basic YnBlbDpwYXNzd29yZDEk + config: + path: /src/main/resources/ + infra: + default: + alacarte: + orchestrationUri: /mso/async/services/ALaCarteOrchestrator + recipeTimeout: 180 + testApi: VNF_API + service: + macro: + default: + testApi: GR_API + camundaURL: http://bpmn-infra:8081 + camundaAuth: AE2E9BE6EF9249085AF98689C4EE087736A5500629A72F35068FFB88813A023581DD6E765071F1C04075B36EA4213A + async: + core-pool-size: 50 + max-pool-size: 50 + queue-capacity: 500 + sdc: + client: + auth: F3473596C526938329DF877495B494DC374D1C4198ED3AD305EA3ADCBBDA1862 + activate: + instanceid: test + userid: cs0008 + endpoint: http://c1.vm1.mso.simpledemo.onap.org:28090 + tenant: + isolation: + retry: + count: 3 + aai: + endpoint: https://aai-simulator:9993 + auth: 221187EFA3AD4E33600DE0488F287099934CE65C3D0697BCECC00BB58E784E07CD74A24581DC31DBC086FF63DF116378776E9BE3D1325885 + extApi: + endpoint: http://nbi.onap:8080/nbi/api/v3 + so: + operational-environment: + dmaap: + username: testuser + password: VjR5NDcxSzA= + host: http://c1.vm1.mso.simpledemo.onap.org:28090 + auth: 51EA5414022D7BE536E7516C4D1A6361416921849B72C0D6FC1C7F262FD9F2BBC2AD124190A332D9845A188AD80955567A4F975C84C221EEA8243BFD92FFE6896CDD1EA16ADD34E1E3D47D4A + publisher: + topic: com.att.ecomp.mso.operationalEnvironmentEvent + health: + auth: Basic bXNvX2FkbWlufHBhc3N3b3JkMSQ= + endpoints: + - subsystem: apih + uri: http://bpmn-infra:8081 + - subsystem: catalogdb + uri: http://catalog-db-adapter:8082 + +spring: + datasource: + hikari: + jdbcUrl: jdbc:mariadb://mariadb:3306/catalogdb + username: cataloguser + password: catalog123 + driver-class-name: org.mariadb.jdbc.Driver + pool-name: catdb-pool + registerMbeans: true + jpa: + show-sql: true + hibernate: + dialect: org.hibernate.dialect.MySQL5Dialect + ddl-auto: validate + naming-strategy: org.hibernate.cfg.ImprovedNamingStrategy + enable-lazy-load-no-trans: true + jersey: + type: filter + + security: + usercredentials: + - + username: sitecontrol + password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke' + role: SiteControl-Client + - + username: gui + password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke' + role: GUI-Client + - + username: infraportal + password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke' + role: InfraPortal-Client + - + username: InfraPortalClient + password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke' + role: InfraPortal-Client + - + username: bpel + password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke' + role: BPEL-Client + - + username: mso_admin + password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke' + role: ACTUATOR + +request: + datasource: + hikari: + jdbcUrl: jdbc:mariadb://mariadb:3306/requestdb + username: requestuser + password: request123 + driver-class-name: org.mariadb.jdbc.Driver + pool-name: reqdb-pool + registerMbeans: true +org: + onap: + so: + cloud-owner: CloudOwner + adapters: + network: + encryptionKey: 07a7159d3bf51a0e53be7a8f89699be7 +aai: + auth: 221187EFA3AD4E33600DE0488F287099934CE65C3D0697BCECC00BB58E784E07CD74A24581DC31DBC086FF63DF116378776E9BE3D1325885 diff --git a/plans/so/integration-cnfm-testing/config/override-files/bpmn-infra/onapheat/override.yaml b/plans/so/integration-cnfm-testing/config/override-files/bpmn-infra/onapheat/override.yaml new file mode 100644 index 00000000..a4389154 --- /dev/null +++ b/plans/so/integration-cnfm-testing/config/override-files/bpmn-infra/onapheat/override.yaml @@ -0,0 +1,370 @@ +aai: + auth: 221187EFA3AD4E33600DE0488F287099934CE65C3D0697BCECC00BB58E784E07CD74A24581DC31DBC086FF63DF116378776E9BE3D1325885 + dme2: + timeout: '30000' + endpoint: https://aai-simulator:9993 + workflowAaiDistributionDelay: PT30S + pnfEntryNotificationTimeout: P14D +cds: + endpoint: blueprints-processor + port: 9111 + auth: Basic Y2NzZGthcHBzOmNjc2RrYXBwcw== + timeout: 60 +camunda: + bpm: + admin-user: + id: admin + password: so_Admin123 + history-level: full + job-execution: + max-pool-size: 30 + core-pool-size: 3 +entitymanager: + packagesToScan: com +pnf: + dmaap: + host: message-router + port: 3904 + protocol: http + uriPathPrefix: events + topicName: unauthenticated.PNF_READY unauthenticated.PNF_UPDATE + consumerGroup: consumerGroup + consumerId: consumerId + topicListenerDelayInSeconds: 5 +bpelURL: http://bpmn-infra:8081 +msb-ip: msb-iag +msb-port: 80 +mso: + msoKey: 07a7159d3bf51a0e53be7a8f89699be7 + config: + path: /var/csar/ + correlation: + timeout: 60 + logPath: logs + async: + core-pool-size: 50 + max-pool-size: 50 + queue-capacity: 500 + aai: + endpoint: https://aai-simulator:9993 + adapters: + completemsoprocess: + endpoint: http://bpmn-infra:8081/CompleteMsoProcess + requestDb: + endpoint: http://request-db-adapter:8083 + auth: Basic YnBlbDpwYXNzd29yZDEk + db: + auth: 33293332AEC4930F655D8E2E8BB08937 + password: wLg4sjrAFUS8rfVfdvTXeQ== + endpoint: http://c1.vm1.mso.simpledemo.onap.org:8083/services/RequestsDbAdapter + spring: + endpoint: http://c1.vm1.mso.simpledemo.onap.org:8083 + network: + endpoint: http://c1.vm1.mso.simpledemo.onap.org:8087/services/NetworkAdapter + rest: + endpoint: http://c1.vm1.mso.simpledemo.onap.org:8087/services/rest/v1/networks + openecomp: + db: + endpoint: http://c1.vm1.mso.simpledemo.onap.org:8083/services/RequestsDbAdapter + po: + auth: 33293332AEC4930F655D8E2E8BB08937 + password: B8EBDE0311F0AF355CF3F2FD505A8CAD + sdnc: + endpoint: http://c1.vm1.mso.simpledemo.onap.org:8086/adapters/SDNCAdapter + rest: + endpoint: http://c1.vm1.mso.simpledemo.onap.org:8086/adapters/rest/v1/sdnc + timeout: PT60M + tenant: + endpoint: http://c1.vm1.mso.simpledemo.onap.org:8087/services/TenantAdapter + vnf: + endpoint: http://c1.vm1.mso.simpledemo.onap.org:8087/services/VnfAdapter + rest: + endpoint: http://c1.vm1.mso.simpledemo.onap.org:8087/services/rest/v1/vnfs + volume-groups: + rest: + endpoint: http://c1.vm1.mso.simpledemo.onap.org:8087/services/rest/v1/volume-groups + vnf-async: + endpoint: http://c1.vm1.mso.simpledemo.onap.org:8087/services/VnfAdapterAsync + vfc: + rest: + endpoint: http://c1.vm1.mso.simpledemo.onap.org:8084/services/v1/vfcadapter + workflow: + message: + endpoint: http://c1.vm1.mso.simpledemo.onap.org:8081/mso/WorkflowMessage + apihandler: + endpoint : http://so.api-handler-infra:8080 + auth: Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA== + bpmn: + process: + historyTimeToLive: '30' + callbackRetryAttempts: '5' + catalog: + db: + endpoint: http://catalog-db-adapter:8082/ecomp/mso/catalog + spring: + endpoint: http://catalog-db-adapter:8082 + db: + auth: Basic YnBlbDpwYXNzd29yZDEk + default: + adapter: + namespace: http://org.onap.mso + healthcheck: + log: + debug: 'false' + infra: + customer: + id: testCustIdInfra + po: + timeout: PT60M + request: + db: + endpoint: http://c1.vm1.mso.simpledemo.onap.org:8083/ + rollback: 'true' + sdnc: + password: 3141634BF7E070AA289CF2892C986C0B + service: + agnostic: + sniro: + endpoint: /sniro/api/v2/placement + host: http://c1.vm1.mso.simpledemo.onap.org:30253 + site-name: CamundaEngine + sniro: + auth: test:testpwd + callback: http://c1.vm1.mso.simpledemo.onap.org:8086/adapters/rest/SDNCNotify + endpoint: http://replaceme:28090/optimizationInstance/V1/create + timeout: PT30M + oof: + auth: test:testpwd + callbackEndpoint: http://bpmn-infra:8081/mso/WorkflowMessage + endpoint: http://oof.api.simpledemo.openecomp.org:8698/api/oof/v1/placement + timeout: PT30M + workflow: + CreateGenericVNFV1: + aai: + volume-group: + uri: /aai/v6/cloud-infrastructure/volume-groups/volume-group + default: + aai: + version: '14' + cloud-region: + version: '14' + generic-vnf: + version: '14' + v14: + customer: + uri: /aai/v14/business/customers/customer + generic-query: + uri: /aai/v14/search/generic-query + generic-vnf: + uri: /aai/v14/network/generic-vnfs/generic-vnf + l3-network: + uri: /aai/v14/network/l3-networks/l3-network + network-policy: + uri: /aai/v14/network/network-policies/network-policy + nodes-query: + uri: /aai/v14/search/nodes-query + route-table-reference: + uri: /aai/v14/network/route-table-references/route-table-reference + tenant: + uri: /aai/v14/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/tenants/tenant + vce: + uri: /aai/v14/network/vces/vce + vpn-binding: + uri: /aai/v14/network/vpn-bindings/vpn-binding + sp-partner: + uri: /aai/v14/business/sp-partners/sp-partner + device: + uri: /aai/v14/network/devices/device + v11: + customer: + uri: /aai/v11/business/customers/customer + generic-query: + uri: /aai/v11/search/generic-query + generic-vnf: + uri: /aai/v11/network/generic-vnfs/generic-vnf + l3-network: + uri: /aai/v11/network/l3-networks/l3-network + network-policy: + uri: /aai/v11/network/network-policies/network-policy + nodes-query: + uri: /aai/v11/search/nodes-query + route-table-reference: + uri: /aai/v11/network/route-table-references/route-table-reference + tenant: + uri: /aai/v11/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/tenants/tenant + vce: + uri: /aai/v11/network/vces/vce + vpn-binding: + uri: /aai/v11/network/vpn-bindings/vpn-binding + v8: + configuration: + uri: /aai/v11/network/configurations/configuration + customer: + uri: /aai/v8/business/customers/customer + generic-query: + uri: /aai/v8/search/generic-query + l3-network: + uri: /aai/v8/network/l3-networks/l3-network + network-policy: + uri: /aai/v8/network/network-policies/network-policy + nodes-query: + uri: /aai/v8/search/nodes-query + route-table-reference: + uri: /aai/v8/network/route-table-references/route-table-reference + tenant: + uri: /aai/v8/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/tenants/tenant + vce: + uri: /aai/v8/network/vces/vce + vpn-binding: + uri: /aai/v8/network/vpn-bindings/vpn-binding + v9: + cloud-region: + uri: /aai/v9/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner + generic-vnf: + uri: /aai/v9/network/generic-vnfs/generic-vnf + retry: + attempts: '1' + deleteCinderVolumeV1: + aai: + volume-group: + uri: /aai/v6/cloud-infrastructure/volume-groups/volume-group + global: + default: + aai: + namespace: http://org.onap.aai.inventory/ + version: 14 + message: + endpoint: http://bpmn-infra:8081/mso/WorkflowMessage + notification: + name: GenericNotificationServiceATT + sdnc: + replication: + delay: PT60S + sdncadapter: + callback: http://bpmn-infra:8081/mso/SDNCAdapterCallbackService + vnfadapter: + create: + callback: http://c1.vm1.mso.simpledemo.onap.org:8087/mso/vnfAdapterNotify + delete: + callback: http://c1.vm1.mso.simpledemo.onap.org:8087/mso/vnfAdapterNotify + query: + callback: http://c1.vm1.mso.simpledemo.onap.org:8087/mso/vnfAdapterNotify + rollback: + callback: http://c1.vm1.mso.simpledemo.onap.org:8087/mso/vnfAdapterNotify + use: + qualified: + host: false + global: + dmaap: + username: testuser + password: alRyMzJ3NUNeakxl + host: http://10.42.111.36:904 + publisher: + topic: replaceme + naming: + endpoint: http://naming.demo.onap.com:8081/web/service/v1/genNetworkElementName + auth: Basic bTA0NzY4QG5vbi1wcm9kLm1zby5lY29tcC5hdHQuY29tOkF0dG0wNDc2OExpZmUhQA== +policy: + auth: Basic dGVzdHBkcDphbHBoYTEyMw== + default: + disposition: Skip + client: + auth: Basic bTAzNzQzOnBvbGljeVIwY2sk + endpoint: https://localhost:8081/pdp/api/ + environment: TEST +sdnc: + auth: Basic YWRtaW46S3A4Yko0U1hzek0wV1hsaGFrM2VIbGNzZTJnQXc4NHZhb0dHbUp2VXkyVQ== + host: http://sdnc-simulator:9994 + path: /restconf/operations/GENERIC-RESOURCE-API + si: + svc: + types: PORT-MIRROR,PPROBE + dmaap: + host: ueb1.simpledemo.onap.org:3904 + timeout: 30000 + lcm: + path: '/restconf/operations/LCM:' + actionTimeout: 300000 + dmapp: + readTopic: SDNC-LCM-WRITE + writeTopic: SDNC-LCM-READ +appc: + client: + topic: + read: + name: APPC-LCM-WRITE + timeout: 360000 + write: APPC-LCM-READ + sdnc: + read: SDNC-LCM-WRITE + write: SDNC-LCM-READ + response: + timeout: 360000 + key: VIlbtVl6YLhNUrtU + secret: 64AG2hF4pYeG2pq7CT6XwUOT + service: ueb + poolMembers: ueb1.simpledemo.onap.org:3904,ueb2.simpledemo.onap.org:3904 +sniro: + conductor: + enabled: true + host: http://sniro-emulator:80 + uri: /v1/release-orders + headers.auth: Basic dGVzdDp0ZXN0cHdk + manager: + timeout: PT30M + host: http://sniro-emulator:80 + uri.v1: /sniro/api/v2/placement + uri.v2: /sniro/api/placement/v2 + headers.auth: Basic dGVzdDp0ZXN0cHdk + headers.patchVersion: 1 + headers.minorVersion: 1 + headers.latestVersion: 2 +server: + port: 8081 + tomcat: + max-threads: 50 +spring: + datasource: + hikari: + jdbcUrl: jdbc:mariadb://mariadb:3306/camundabpmn + username: camundauser + password: camunda123 + driver-class-name: org.mariadb.jdbc.Driver + pool-name: bpmn-pool + registerMbeans: true + security: + usercredentials: + - + username: apihBpmn + password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke' + role: BPMN-Client + - + username: sdncaBpmn + password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke' + role: BPMN-Client + - + username: poBpmn + password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke' + role: BPMN-Client + - + username: wmaBpmn + password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke' + role: BPMN-Client + - + username: sniro + password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke' + role: SNIRO-Client + - + username: mso_admin + password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke' + role: ACTUATOR +so: + vnfm: + adapter: + url: http://so-etsi-sol003-adapter.onap:9092/so/vnfm-adapter/v1/ + auth: Basic dm5mbTpwYXNzd29yZDEk +org: + onap: + so: + cloud-owner: CloudOwner + diff --git a/plans/so/integration-cnfm-testing/config/override-files/catalog-db-adapter/onapheat/override.yaml b/plans/so/integration-cnfm-testing/config/override-files/catalog-db-adapter/onapheat/override.yaml new file mode 100644 index 00000000..c4e28b3f --- /dev/null +++ b/plans/so/integration-cnfm-testing/config/override-files/catalog-db-adapter/onapheat/override.yaml @@ -0,0 +1,101 @@ +server: + port: 8082 + tomcat: + max-threads: 50 +ssl-enable: false +mso: + logPath: logs + site-name: onapheat + catalog: + db: + spring: + endpoint: http://catalog-db-adapter:8082 + db: + auth: Basic YnBlbDpwYXNzd29yZDEk +spring: + datasource: + hikari: + jdbcUrl: jdbc:mariadb://mariadb:3306/catalogdb + username: cataloguser + password: catalog123 + driver-class-name: org.mariadb.jdbc.Driver + pool-name: catdb-pool + registerMbeans: true + flyway: + baseline-on-migrate: false + url: jdbc:mariadb://mariadb:3306/catalogdb + user: cataloguser + password: catalog123 + outOfOrder: true + validateOnMigrate: false + jpa: + generate-ddl: false + show-sql: false + hibernate: + ddl-auto: validate + naming-strategy: org.hibernate.cfg.ImprovedNamingStrategy + enable-lazy-load-no-trans: true + database-platform: org.hibernate.dialect.MySQL5InnoDBDialect + security: + usercredentials: + - + username: bpel + password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke' + role: BPEL-Client + - + username: mso_admin + password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke' + role: ACTUATOR +#Actuator +management: + context-path: /manage +cloud_config: + identity_services: + RAX_KEYSTONE: + identity_url: "https://identity.api.rackspacecloud.com/v2.0" + mso_id: "RACKSPACE_ACCOUNT_ID" + mso_pass: "RACKSPACE_ACCOUNT_APIKEY" + admin_tenant: "dummy" + member_role: "admin" + tenant_metadata: true + identity_server_type: "KEYSTONE" + identity_authentication_type: "RACKSPACE_APIKEY" + project_domain_name: "PROJECT_DOMAIN_NAME" + user_domain_name: "USER_DOMAIN_NAME" + DEFAULT_KEYSTONE: + identity_url: "dummy" + mso_id: "dummy" + mso_pass: "dummy" + admin_tenant: "dummy" + member_role: "admin" + tenant_metadata: true + identity_server_type: "KEYSTONE" + identity_authentication_type: "USERNAME_PASSWORD" + project_domain_name: "dummy" + user_domain_name: "dummy" + cloud_sites: + Dallas: + region_id: "DFW" + clli: "DFW" + aic_version: "2.5" + identity_service_id: "RAX_KEYSTONE" + Northern Virginia: + region_id: "IAD" + clli: "IAD" + aic_version: "2.5" + identity_service_id: "RAX_KEYSTONE" + Chicago: + region_id: "ORD" + clli: "ORD" + aic_version: "2.5" + identity_service_id: "RAX_KEYSTONE" + RegionOne: + region_id: "RegionOne" + clli: "RegionOne" + aic_version: "2.5" + identity_service_id: "DEFAULT_KEYSTONE" + DEFAULT: + region_id: "dummyRegionId" + clli: "dummyClli" + aic_version: "2.5" + identity_service_id: "DEFAULT_KEYSTONE" \ No newline at end of file diff --git a/plans/so/integration-cnfm-testing/config/override-files/sdc-controller/onapheat/override.yaml b/plans/so/integration-cnfm-testing/config/override-files/sdc-controller/onapheat/override.yaml new file mode 100644 index 00000000..3b65530a --- /dev/null +++ b/plans/so/integration-cnfm-testing/config/override-files/sdc-controller/onapheat/override.yaml @@ -0,0 +1,81 @@ +aai: + auth: 2A11B07DB6214A839394AA1EC5844695F5114FC407FF5422625FB00175A3DCB8A1FF745F22867EFA72D5369D599BBD88DA8BED4233CF5586 +server: + port: 8085 + +spring: + datasource: + hikari: + jdbcUrl: jdbc:mariadb://mariadb:3306/catalogdb + username: cataloguser + password: catalog123 + driver-class-name: org.mariadb.jdbc.Driver + pool-name: catdb-pool + registerMbeans: false + + security: + usercredentials: + - + username: asdc + password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke' + role: Asdc-Client + - + username: mso_admin + password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke' + role: ACTUATOR + +request: + datasource: + hikari: + jdbcUrl: jdbc:mariadb://mariadb:3306/requestdb + username: requestuser + password: request123 + driver-class-name: org.mariadb.jdbc.Driver + pool-name: reqdb-pool + registerMbeans: false + +mso: + msoKey: 07a7159d3bf51a0e53be7a8f89699be7 + logPath: ./logs/asdc + catalog: + db: + spring: + endpoint: http://catalog-db-adapter:8082 + db: + auth: Basic YnBlbDpwYXNzd29yZDEk + site-name: onapheat + camundaURL: http://bpmn-infra:8081/ + adapters: + requestDb: + endpoint: http://request-db-adapter:8083 + auth: Basic YnBlbDpwYXNzd29yZDEk + aai: + endpoint: https://aai.api.simpledemo.onap.org:8443 + asdc-connections: + asdc-controller1: + user: mso + consumerGroup: SO-OpenSource-Env11 + consumerId: SO-COpenSource-Env11 + environmentName: AUTO + asdcAddress: c2.vm1.sdc.simpledemo.onap.org:8443 + password: 76966BDD3C7414A03F7037264FF2E6C8EEC6C28F2B67F2840A1ED857C0260FEE731D73F47F828E5527125D29FD25D3E0DE39EE44C058906BF1657DE77BF897EECA93BDC07FA64F + pollingInterval: 60 + pollingTimeout: 60 + relevantArtifactTypes: HEAT,HEAT_ENV,HEAT_VOL + useHttpsWithDmaap: false + activateServerTLSAuth: false + keyStorePassword: + keyStorePath: + watchDogTimeout: 100 + isFitlerInEmptyResources: true + messageBusAddress: vm1.mr.simpledemo.onap.org,vm1.mr.simpledemo.onap.org + asdc: + config: + activity: + endpoint: http://sdc-wfd-be:8080 + key: 566B754875657232314F5548556D3665 + components: + count: 0, + componentNames: + scheduling: + enabled: false \ No newline at end of file diff --git a/plans/so/integration-cnfm-testing/config/override-files/so-cnfm/onapheat/override.yaml b/plans/so/integration-cnfm-testing/config/override-files/so-cnfm/onapheat/override.yaml new file mode 100644 index 00000000..529cde22 --- /dev/null +++ b/plans/so/integration-cnfm-testing/config/override-files/so-cnfm/onapheat/override.yaml @@ -0,0 +1,40 @@ +aai: + auth: 2A11B07DB6214A839394AA1EC5844695F5114FC407FF5422625FB00175A3DCB8A1FF745F22867EFA72D5369D599BBD88DA8BED4233CF5586 + version: v19 + endpoint: https://aai-simulator:9993 +spring: + datasource: + hikari: + camunda: + jdbcUrl: jdbc:mariadb://${DB_HOST}:${DB_PORT}/camundabpmn + username: ${DB_USERNAME} + password: ${DB_PASSWORD} + driver-class-name: org.mariadb.jdbc.Driver + pool-name: bpmn-pool + registerMbeans: true + cnfm: + jdbcUrl: jdbc:mariadb://${DB_HOST}:${DB_PORT}/cnfm + username: ${DB_ADMIN_USERNAME} + password: ${DB_ADMIN_PASSWORD} + driver-class-name: org.mariadb.jdbc.Driver + pool-name: cnfm-pool + registerMbeans: true +server: + port: 9888 + tomcat: + max-threads: 50 +camunda: + bpm: + history-level: full + job-execution: + max-pool-size: 30 + core-pool-size: 3 + deployment-aware: true +sdc: + username: mso + password: 76966BDD3C7414A03F7037264FF2E6C8EEC6C28F2B67F2840A1ED857C0260FEE731D73F47F828E5527125D29FD25D3E0DE39EE44C058906BF1657DE77BF897EECA93BDC07FA64F + key: 566B754875657232314F5548556D3665 + endpoint: http://sdc-simulator:9991 + +so-cnfm-lcm: + endpoint: http://so-cnfm-lcm:9888 \ No newline at end of file diff --git a/plans/so/integration-cnfm-testing/config/override-files/so-monitoring/onapheat/override.yaml b/plans/so/integration-cnfm-testing/config/override-files/so-monitoring/onapheat/override.yaml new file mode 100644 index 00000000..62d8c9ee --- /dev/null +++ b/plans/so/integration-cnfm-testing/config/override-files/so-monitoring/onapheat/override.yaml @@ -0,0 +1,24 @@ +server: + port: 30224 + tomcat: + max-threads: 4 +ssl-enable: false +camunda: + rest: + api: + url: http://bpmn-infra:8081/sobpmnengine/engine/ + engine: default + auth: Basic YXBpaEJwbW46cGFzc3dvcmQxJA== +mso: + database: + rest: + api: + url: http://request-db-adapter:8083/infraActiveRequests/ + auth: Basic YnBlbDpwYXNzd29yZDEk +spring: + security: + usercredentials: + - + username: gui + password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke' + role: GUI-Client \ No newline at end of file diff --git a/plans/so/integration-cnfm-testing/docker-compose.local.yml b/plans/so/integration-cnfm-testing/docker-compose.local.yml new file mode 100644 index 00000000..09c7ab33 --- /dev/null +++ b/plans/so/integration-cnfm-testing/docker-compose.local.yml @@ -0,0 +1,26 @@ +version: '3' +services: +################################################################################ + mariadb: + image: mariadb:${MARIADB_VERSION} +################################################################################ + catalog-db-adapter: + image: onap/so/catalog-db-adapter:${SO_IMAGE_VERSION} +################################################################################ + request-db-adapter: + image: onap/so/request-db-adapter:${SO_IMAGE_VERSION} +################################################################################ + sdc-controller: + image: onap/so/sdc-controller:${SO_IMAGE_VERSION} +################################################################################ + bpmn-infra: + image: onap/so/bpmn-infra:${SO_IMAGE_VERSION} +################################################################################ + api-handler-infra: + image: onap/so/api-handler-infra:${SO_IMAGE_VERSION} +############################################################################# + so-admin-cockpit: + image: onap/so/so-admin-cockpit:${SO_ADMIN_COCKPIT_IMAGE_VERSION} +############################################################################# + so-cnfm-lcm: + image: onap/so/so-cnfm-as-lcm:${SO_CNFM_AS_LCM} diff --git a/plans/so/integration-cnfm-testing/docker-compose.yml b/plans/so/integration-cnfm-testing/docker-compose.yml new file mode 100644 index 00000000..d4404875 --- /dev/null +++ b/plans/so/integration-cnfm-testing/docker-compose.yml @@ -0,0 +1,287 @@ +version: '3' +services: +################################################################################ + mariadb: + image: ${NEXUS_DOCKER_REPO_MSO}/mariadb:${MARIADB_VERSION} + ports: + - "3306:3306" + volumes: + - /var/lib/mysql + - ${TEST_LAB_DIR}/volumes/mariadb/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d + - ${TEST_LAB_DIR}/volumes/mariadb/conf.d:/etc/mysql/conf.d + environment: + - MYSQL_ROOT_PASSWORD=password + - MYSQL_USER=etsicatalog + - MYSQL_PASSWORD=etsicatalog + - MYSQL_DATABASE=etsicatalog + hostname: + mariadb.so.testlab.onap.org + logging: + driver: "json-file" + options: + max-size: "30m" + max-file: "5" +################################################################################ + catalog-db-adapter: + image: ${NEXUS_DOCKER_REPO_MSO}/onap/so/catalog-db-adapter:${SO_IMAGE_VERSION} + ports: + - "8082:8082" + volumes: + - ${TEST_LAB_DIR}/volumes/so/ca-certificates/onapheat:/app/ca-certificates + - ${CONFIG_DIR_PATH_CNFM}/override-files/catalog-db-adapter/onapheat:/app/config + environment: + - APP=catalog-db-adapter + - JVM_ARGS=-Xms64m -Xmx512m + - DB_HOST=mariadb + - DB_PORT=3306 + - DB_USERNAME=so_user + - DB_PASSWORD=so_User123 + - DB_ADMIN_USERNAME=so_admin + - DB_ADMIN_PASSWORD=so_Admin123 + hostname: + catalog-db-adapter.so.testlab.onap.org + depends_on: + - mariadb + logging: + driver: "json-file" + options: + max-size: "30m" + max-file: "5" + user: root + entrypoint: /bin/sh -c '/app/wait-for.sh -q -t "300" mariadb:3306 -- "/app/start-app.sh"' +################################################################################ + request-db-adapter: + image: ${NEXUS_DOCKER_REPO_MSO}/onap/so/request-db-adapter:${SO_IMAGE_VERSION} + ports: + - "8083:8083" + volumes: + - ${TEST_LAB_DIR}/volumes/so/ca-certificates/onapheat:/app/ca-certificates + - ${TEST_LAB_DIR}/volumes/so/config/request-db-adapter/onapheat:/app/config + environment: + - APP=request-db-adapter + - JVM_ARGS=-Xms64m -Xmx512m + - DB_HOST=mariadb + - DB_PORT=3306 + - DB_USERNAME=so_user + - DB_PASSWORD=so_User123 + - DB_ADMIN_USERNAME=so_admin + - DB_ADMIN_PASSWORD=so_Admin123 + hostname: + request-db-adapter.so.testlab.onap.org + depends_on: + - mariadb + - catalog-db-adapter + logging: + driver: "json-file" + options: + max-size: "30m" + max-file: "5" + user: root + entrypoint: /bin/sh -c '/app/wait-for.sh -q -t "300" catalog-db-adapter:8082 -- "/app/start-app.sh"' +################################################################################ + sdc-controller: + image: ${NEXUS_DOCKER_REPO_MSO}/onap/so/sdc-controller:${SO_IMAGE_VERSION} + ports: + - "8085:8085" + volumes: + - ${TEST_LAB_DIR}/volumes/so/ca-certificates/onapheat:/app/ca-certificates + - ${CONFIG_DIR_PATH_CNFM}/distribution-test-zip:/distribution-test-zip + - ${CONFIG_DIR_PATH_CNFM}/override-files/sdc-controller/onapheat:/app/config + environment: + - APP=sdc-controller + - JVM_ARGS=-Xms64m -Xmx512m + - DB_HOST=mariadb + - DB_PORT=3306 + - DB_USERNAME=so_user + - DB_PASSWORD=so_User123 + - DB_ADMIN_USERNAME=so_admin + - DB_ADMIN_PASSWORD=so_Admin123 + hostname: + sdc-controller.so.testlab.onap.org + depends_on: + - mariadb + - catalog-db-adapter + - request-db-adapter + logging: + driver: "json-file" + options: + max-size: "30m" + max-file: "5" + user: root + entrypoint: /bin/sh -c 'mkdir -p /distribution-test-zip/unzipped && tar -xvzf /distribution-test-zip/zipped_cnf_csar.tar.gz -C /distribution-test-zip/unzipped && chmod 777 -R /distribution-test-zip/ && /app/wait-for.sh -q -t "300" request-db-adapter:8083 -- "/app/start-app.sh"' +################################################################################ + bpmn-infra: + image: ${NEXUS_DOCKER_REPO_MSO}/onap/so/bpmn-infra:${SO_IMAGE_VERSION} + ports: + - "8081:8081" + volumes: + - ${CONFIG_DIR_PATH_CNFM}/override-files/bpmn-infra/onapheat:/app/config + - ${CONFIG_DIR_PATH}/certificates/bpmn-infra-certs:/app/bpmn-infra-certs + - ${CONFIG_DIR_PATH}/certificates/truststore/root-ca.crt:/app/ca-certificates/root-ca.crt + environment: + - APP=bpmn-infra + - JVM_ARGS=-Xms64m -Xmx512m + - DB_HOST=mariadb + - DB_PORT=3306 + - DB_USERNAME=so_user + - DB_PASSWORD=so_User123 + - DB_ADMIN_USERNAME=so_admin + - DB_ADMIN_PASSWORD=so_Admin123 + hostname: + bpmn-infra.so.testlab.onap.org + links: + - "so-cnfm-lcm:so-cnfm-lcm.onap" + depends_on: + - mariadb + - catalog-db-adapter + - request-db-adapter + logging: + driver: "json-file" + options: + max-size: "30m" + max-file: "5" + user: root + entrypoint: /bin/sh -c '/app/wait-for.sh -q -t "300" request-db-adapter:8083 -- "/app/start-app.sh"' +################################################################################ + api-handler-infra: + image: ${NEXUS_DOCKER_REPO_MSO}/onap/so/api-handler-infra:${SO_IMAGE_VERSION} + #${NEXUS_DOCKER_REPO_MSO}/onap/so/api-handler-infra:${TAG} + ports: + - "8080:8080" + volumes: + - ${CONFIG_DIR_PATH_CNFM}/override-files/api-handler-infra/onapheat:/app/config + - ${CONFIG_DIR_PATH}/certificates/truststore/root-ca.crt:/app/ca-certificates/root-ca.crt + environment: + - APP=api-handler-infra + - JVM_ARGS=-Xms64m -Xmx512m + - DB_HOST=mariadb + - DB_PORT=3306 + - DB_USERNAME=so_user + - DB_PASSWORD=so_User123 + - DB_ADMIN_USERNAME=so_admin + - DB_ADMIN_PASSWORD=so_Admin123 + hostname: + api-handler-infra.so.testlab.onap.org + depends_on: + - mariadb + - catalog-db-adapter + - request-db-adapter + - bpmn-infra + logging: + driver: "json-file" + options: + max-size: "30m" + max-file: "5" + user: root + entrypoint: /bin/sh -c '/app/wait-for.sh -q -t "300" bpmn-infra:8081 -- "/app/start-app.sh"' +############################################################################# + so-admin-cockpit: + image: ${NEXUS_DOCKER_REPO_MSO}/onap/so/so-admin-cockpit:${SO_ADMIN_COCKPIT_IMAGE_VERSION} + ports: + - "30224:30224" + volumes: + - ${CONFIG_DIR_PATH_CNFM}/override-files/so-monitoring/onapheat:/app/config + environment: + - APP=so-admin-cockpit + - JVM_ARGS=-Xms64m -Xmx512m + hostname: + so-admin-cockpit.so.testlab.onap.org + depends_on: + - mariadb + - catalog-db-adapter + - request-db-adapter +############################################################################# + so-cnfm-lcm: + image: ${NEXUS_DOCKER_REPO_MSO}/onap/so/so-cnfm-as-lcm:${SO_CNFM_AS_LCM} + ports: + - "9888:9888" + volumes: + - ${CONFIG_DIR_PATH_CNFM}/override-files/so-cnfm/onapheat:/app/config + - ${CONFIG_DIR_PATH}/certificates/truststore/root-ca.crt:/app/ca-certificates/root-ca.crt + - ${TEST_LAB_DIR}/volumes/so/ca-certificates/onapheat:/app/ca-certificates + environment: + - APP=so-cnfm-lcm + - JVM_ARGS=-Xms64m -Xmx512m + - DB_HOST=mariadb + - DB_PORT=3306 + - DB_USERNAME=so_user + - DB_PASSWORD=so_User123 + - DB_ADMIN_USERNAME=so_admin + - DB_ADMIN_PASSWORD=so_Admin123 + hostname: + so-cnfm-lcm.so.testlab.onap.org + depends_on: + - mariadb + - catalog-db-adapter + - request-db-adapter + logging: + driver: "json-file" + options: + max-size: "30m" + max-file: "5" + user: root + entrypoint: /bin/sh -c '/app/wait-for.sh -q -t "300" bpmn-infra:8081 -- "/app/start-app.sh"' +############################################################################# + kind-cluster: + image: kind-cluster:latest + ports: + - "30001:30001" + depends_on: + - so-cnfm-lcm + user: root + privileged: true +################################################################################ + sdc-simulator: + image: simulators/sdc-simulator:latest + ports: + - "9991:9991" + environment: + - APP=SDC-SIMULATOR + - JVM_ARGS=-Xms64m -Xmx512m + hostname: + sdc-simulator + depends_on: + - mariadb + - so-cnfm-lcm + - kind-cluster + logging: + driver: "json-file" + options: + max-size: "30m" + max-file: "5" +################################################################################ + aai-simulator: + image: simulators/aai-simulator:latest + ports: + - "9993:9993" + environment: + - APP=AAI-SIMULATOR + - JVM_ARGS=-Xms64m -Xmx512m + hostname: + aai-simulator + depends_on: + - mariadb + - so-cnfm-lcm + - kind-cluster + logging: + driver: "json-file" + options: + max-size: "30m" + max-file: "5" +################################################################################ + populate-aai-config: + image: jobs/workaround-job-container:latest + ports: + - "9995:9995" + volumes: + - ${CONFIG_DIR_PATH}/populate-aai-simulator.sh:/config/populate-aai-simulator.sh + - ${CONFIG_DIR_PATH}/wait-for.sh:/config/wait-for.sh + - ${CONFIG_DIR_PATH}/aai-simulator-populate-data:/config/aai-simulator-populate-data/ + environment: + - AAI_SIMULATOR_HOST=aai-simulator + - AAI_SIMULATOR_PORT=9993 + - TIMEOUT_IN_SECONDS=300 #5 mins + depends_on: + - aai-simulator + command: + - "/config/populate-aai-simulator.sh" diff --git a/plans/so/integration-cnfm-testing/setup.sh b/plans/so/integration-cnfm-testing/setup.sh new file mode 100755 index 00000000..8f651831 --- /dev/null +++ b/plans/so/integration-cnfm-testing/setup.sh @@ -0,0 +1,190 @@ +#!/bin/bash +# +# ============LICENSE_START======================================================= +# Copyright (C) 2023 Nordix Foundation. +# ================================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 +# ============LICENSE_END========================================================= + +# @author Waqas Ikram (waqas.ikram@est.tech) + +#SO-CNFM +SCRIPT_HOME="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +SCRIPT_NAME=$(basename $0) +CONFIG_DIR_CNFM=$SCRIPT_HOME/config +ENV_FILE=$CONFIG_DIR_CNFM/env +TEMP_DIR_PATH=$SCRIPT_HOME/temp +TEST_LAB_DIR_PATH=$TEMP_DIR_PATH/test_lab +DOCKER_COMPOSE_FILE_PATH=$SCRIPT_HOME/docker-compose.yml +DOCKER_COMPOSE_LOCAL_OVERRIDE_FILE=$SCRIPT_HOME/docker-compose.local.yml +TEAR_DOWN_SCRIPT=$SCRIPT_HOME/teardown.sh + +# INTEGRATION_ETSI +INTEGRATION_ETSI_TESTING_DIR="$(realpath "$SCRIPT_HOME"/../integration-etsi-testing)" +INTEGRATION_ETSI_TESTING_CONFIG_DIR=$INTEGRATION_ETSI_TESTING_DIR/config +SIMULATOR_MAVEN_PROJECT_POM="$INTEGRATION_ETSI_TESTING_DIR/so-simulators/pom.xml" +WAIT_FOR_POPULATE_AAI_SCRIPT=$INTEGRATION_ETSI_TESTING_CONFIG_DIR/"wait-for-aai-config-job.sh" +WAIT_FOR_CONTAINER_SCRIPT=$INTEGRATION_ETSI_TESTING_CONFIG_DIR/"wait-for-container.sh" + +#CAMUNDA SQL SCRIPTS +CAMUNDA_SQL_SCRIPT_NAME=mariadb_engine_7.10.0.sql +CAMUNDA_SQL_SCRIPT_DIR=$INTEGRATION_ETSI_TESTING_CONFIG_DIR/camunda-sql +TEST_LAB_SQL_SCRIPTS_DIR=$TEST_LAB_DIR_PATH/volumes/mariadb/docker-entrypoint-initdb.d/db-sql-scripts + +#MAVEN +MAVEN_VERSION_DIR="apache-maven-3.3.9" +MAVEN_TAR_FILE="$MAVEN_VERSION_DIR-bin.tar.gz" +MAVEN_TAR_LOCATION="https://archive.apache.org/dist/maven/maven-3/3.3.9/binaries/$MAVEN_TAR_FILE" +MAVEN_DIR=$TEMP_DIR_PATH/maven +INSTALLED_MAVEN_DIR=$MAVEN_DIR/$MAVEN_VERSION_DIR +MVN=$INSTALLED_MAVEN_DIR/bin/mvn +MVN_VERSION="$MVN -v" +MVN_SETTINGS_XML="$INTEGRATION_ETSI_TESTING_DIR/settings.xml" +MVN_CLEAN_INSTALL="$MVN clean install" +SKIP_KIND_CLUSTER_FLAG="-Dskip-kind-cluster=false" + +echo "Running $SCRIPT_HOME/$SCRIPT_NAME ..." + +export $(egrep -v '^#' $ENV_FILE | xargs) + +MANDATORY_VARIABLES_NAMES=( "NEXUS_DOCKER_REPO_MSO" "DOCKER_ENVIRONMENT" "TIME_OUT_DEFAULT_VALUE_SEC" "PROJECT_NAME" "DEFAULT_NETWORK_NAME" "SO_IMAGE_VERSION" "SO_ADMIN_COCKPIT_IMAGE_VERSION" "MARIADB_VERSION" "SO_CNFM_AS_LCM") + +for var in "${MANDATORY_VARIABLES_NAMES[@]}" + do + if [ -z "${!var}" ]; then + echo "Missing mandatory attribute $var in $ENV_FILE" + exit 1 + fi +done + +if [[ ! "$TEMP_DIR_PATH" || ! -d "$TEMP_DIR_PATH" ]]; then + echo "Creating temporary directory $TEMP_DIR_PATH" + mkdir $TEMP_DIR_PATH + + if [ $? -ne 0 ]; then + echo "Could not create $TEMP_DIR_PATH" + exit 1 + fi +fi +echo "Will use ${TEMP_DIR_PATH} directory" + +if [[ ! "$MAVEN_DIR" || ! -d "$MAVEN_DIR" ]]; then + echo "Creating temporary maven directory $MAVEN_DIR" + mkdir $MAVEN_DIR + + if [ $? -ne 0 ]; then + echo "Could not create $MAVEN_DIR" + exit 1 + fi +fi +echo "Will use ${MAVEN_DIR} directory for maven install" + +if [[ ! "$INSTALLED_MAVEN_DIR" || ! -d "$INSTALLED_MAVEN_DIR" ]]; then + echo "Installing maven ..." + cd $MAVEN_DIR + + CURL=`which curl` + if [[ ! "$CURL" ]]; then + echo "curl command is not installed" + echo "Unable to execute test plan" + exit 1 + fi + + curl -O $MAVEN_TAR_LOCATION + TAR=`which tar` + if [[ ! "$TAR" ]]; then + echo "tar command is not installed" + echo "Unable to execute test plan" + exit 1 + fi + + tar -xzvf $MAVEN_TAR_FILE + echo "Finished installing maven ..." +fi +echo "Maven installed under directory $INSTALLED_MAVEN_DIR" + +$MVN_VERSION +if [ $? -ne 0 ]; then + echo "Unable to run mvn -v command" + exit 1 +fi + +echo "Will build simulator project using $MVN_CLEAN_INSTALL -f $SIMULATOR_MAVEN_PROJECT_POM --settings $MVN_SETTINGS_XML" +$MVN_CLEAN_INSTALL -f $SIMULATOR_MAVEN_PROJECT_POM --settings $MVN_SETTINGS_XML $SKIP_KIND_CLUSTER_FLAG +if [ $? -ne 0 ]; then + echo "Maven build failed" + exit 1 +fi + +echo "Will clone docker-config project ... " +if [[ -d "$TEST_LAB_DIR_PATH" ]]; then + echo "$TEST_LAB_DIR_PATH already exists" + echo "Removing $TEST_LAB_DIR_PATH directory ..." + rm -rf $TEST_LAB_DIR_PATH +fi + +git clone http://gerrit.onap.org/r/so/docker-config.git $TEST_LAB_DIR_PATH + +echo "Replacing $CAMUNDA_SQL_SCRIPT_NAME ..." +rm -rf $TEST_LAB_SQL_SCRIPTS_DIR/$CAMUNDA_SQL_SCRIPT_NAME +cp $CAMUNDA_SQL_SCRIPT_DIR/$CAMUNDA_SQL_SCRIPT_NAME $TEST_LAB_SQL_SCRIPTS_DIR + +export TEST_LAB_DIR=$TEST_LAB_DIR_PATH +export CONFIG_DIR_PATH=$INTEGRATION_ETSI_TESTING_CONFIG_DIR +export CONFIG_DIR_PATH_CNFM=$CONFIG_DIR_CNFM + +if [ "$DOCKER_ENVIRONMENT" == "remote" ]; then + echo "Starting docker containers with remote images ..." + docker-compose -f $DOCKER_COMPOSE_FILE_PATH -p $PROJECT_NAME up -d +elif [ "$DOCKER_ENVIRONMENT" == "local" ]; then + echo "Starting docker containers with local images ..." + docker-compose -f $DOCKER_COMPOSE_FILE_PATH -f $DOCKER_COMPOSE_LOCAL_OVERRIDE_FILE -p $PROJECT_NAME up -d +else + echo "DOCKER_ENVIRONMENT not set correctly in $ENV_FILE. Allowed values: local | remote" + exit 1 +fi + +echo "Sleeping for 3m" +sleep 3m + +docker ps -a + +echo "Will execute $WAIT_FOR_POPULATE_AAI_SCRIPT script" +$WAIT_FOR_POPULATE_AAI_SCRIPT +if [ $? -ne 0 ]; then + echo "ERROR: $WAIT_FOR_POPULATE_AAI_SCRIPT failed" + echo "Will stop running docker containers . . ." + $TEAR_DOWN_SCRIPT + exit 1 +fi + +PODS_NAMES=( "api-handler-infra" "so-cnfm-lcm" "kind-cluster") +for pod in "${PODS_NAMES[@]}" + do + echo "Will execute $WAIT_FOR_CONTAINER_SCRIPT to wait for $pod container to start up" + $WAIT_FOR_CONTAINER_SCRIPT -c "$pod" -t "300" -n "$DEFAULT_NETWORK_NAME" + + if [ $? -ne 0 ]; then + echo "ERROR: $WAIT_FOR_CONTAINER_SCRIPT for pod: $pod failed" + echo "Will stop running docker containers . . ." + $TEAR_DOWN_SCRIPT + exit 1 + fi +done + +REPO_IP='127.0.0.1' +ROBOT_VARIABLES="-v REPO_IP:${REPO_IP}" + +echo "Finished executing $SCRIPT_HOME/$SCRIPT_NAME" \ No newline at end of file diff --git a/plans/so/integration-cnfm-testing/teardown.sh b/plans/so/integration-cnfm-testing/teardown.sh new file mode 100755 index 00000000..2cecba5d --- /dev/null +++ b/plans/so/integration-cnfm-testing/teardown.sh @@ -0,0 +1,52 @@ +#!/bin/bash +# +# ============LICENSE_START======================================================= +# Copyright (C) 2023 Nordix Foundation. +# ================================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 +# ============LICENSE_END========================================================= + +# @author Waqas Ikram (waqas.ikram@est.tech) + +SCRIPT_HOME="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +SCRIPT_NAME=$(basename $0) +CONFIG_DIR_CNFM=$SCRIPT_HOME/config +ENV_FILE=$CONFIG_DIR_CNFM/env +TEMP_DIR_PATH=$SCRIPT_HOME/temp +TEST_LAB_DIR_PATH=$TEMP_DIR_PATH/test_lab +DOCKER_COMPOSE_FILE_PATH=$SCRIPT_HOME/docker-compose.yml +DOCKER_COMPOSE_LOCAL_OVERRIDE_FILE=$SCRIPT_HOME/docker-compose.local.yml +INTEGRATION_ETSI_TESTING_DIR="$(realpath "$SCRIPT_HOME"/../integration-etsi-testing)" +INTEGRATION_ETSI_TESTING_CONFIG_DIR=$INTEGRATION_ETSI_TESTING_DIR/config + +echo "Running $SCRIPT_HOME/$SCRIPT_NAME ..." +export $(egrep -v '^#' $ENV_FILE | xargs) +export TEST_LAB_DIR=$TEST_LAB_DIR_PATH +export CONFIG_DIR_PATH=$INTEGRATION_ETSI_TESTING_CONFIG_DIR +export CONFIG_DIR_PATH_CNFM=$CONFIG_DIR_CNFM + +if [ "$DOCKER_ENVIRONMENT" == "remote" ]; then + echo "Tearing down docker containers from remote images ..." + docker-compose -f $DOCKER_COMPOSE_FILE_PATH -p $PROJECT_NAME down +elif [ "$DOCKER_ENVIRONMENT" == "local" ]; then + echo "Tearing down docker containers from local images ..." + docker-compose -f $DOCKER_COMPOSE_FILE_PATH -f $DOCKER_COMPOSE_LOCAL_OVERRIDE_FILE -p $PROJECT_NAME down +else + echo "Couldn't find valid property for DOCKER_ENVIRONMENT in $ENV_FILE." + echo "Attempting normal teardown ..." + docker-compose -f $DOCKER_COMPOSE_FILE_PATH -p $PROJECT_NAME down +fi + +echo "Finished executing $SCRIPT_HOME/$SCRIPT_NAME" diff --git a/plans/so/integration-cnfm-testing/testplan.txt b/plans/so/integration-cnfm-testing/testplan.txt new file mode 100644 index 00000000..d9c00b0e --- /dev/null +++ b/plans/so/integration-cnfm-testing/testplan.txt @@ -0,0 +1,2 @@ +# Test suites are relative paths under [integration/csit.git]/tests/. +# Place the suites in run order. \ No newline at end of file diff --git a/plans/so/integration-etsi-testing/so-simulators/package/docker/src/main/docker/docker-files/kind-cluster/Dockerfile.kind-cluster b/plans/so/integration-etsi-testing/so-simulators/package/docker/src/main/docker/docker-files/kind-cluster/Dockerfile.kind-cluster index be2bcbb5..8d9f8c87 100644 --- a/plans/so/integration-etsi-testing/so-simulators/package/docker/src/main/docker/docker-files/kind-cluster/Dockerfile.kind-cluster +++ b/plans/so/integration-etsi-testing/so-simulators/package/docker/src/main/docker/docker-files/kind-cluster/Dockerfile.kind-cluster @@ -1,4 +1,4 @@ -FROM library/alpine:3.8 +FROM library/alpine:latest RUN apk -U upgrade && apk add ca-certificates util-linux gnupg curl make kmod procps bash && gpg --keyserver https://download.docker.com/linux/debian/gpg --recv-keys && apk update && apk add docker openrc && rm -rf /var/lib/apt/lists/* RUN update-alternatives --set iptables /usr/sbin/iptables-legacy || true && update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy || true && update-alternatives --set arptables /usr/sbin/arptables-legacy || true @@ -24,5 +24,5 @@ EXPOSE 30001 COPY entrypoint-original.sh /entrypoint-original.sh RUN chmod 777 /entrypoint-original.sh -ENTRYPOINT ["/entrypoint.sh"] +ENTRYPOINT ["/bin/bash", "-c", "/entrypoint.sh; if [ $? -eq 0 ]; then echo 'Successfully created kind cluster'; else echo 'Failed creating kind cluster'; fi"] CMD ["tail", "-f", "/dev/null"] \ No newline at end of file diff --git a/plans/so/integration-etsi-testing/so-simulators/package/docker/src/main/docker/docker-files/kind-cluster/entrypoint-original.sh b/plans/so/integration-etsi-testing/so-simulators/package/docker/src/main/docker/docker-files/kind-cluster/entrypoint-original.sh index 488f7543..21dd1982 100644 --- a/plans/so/integration-etsi-testing/so-simulators/package/docker/src/main/docker/docker-files/kind-cluster/entrypoint-original.sh +++ b/plans/so/integration-etsi-testing/so-simulators/package/docker/src/main/docker/docker-files/kind-cluster/entrypoint-original.sh @@ -40,7 +40,7 @@ fi # Check cgroupfs. # Verify the filesystem. if [ ! -d /sys/fs/cgroup/ ]; then - echo >&2 'Cgroupfs is not mounted' + echo >&2 'ERROR: Cgroupfs is not mounted' exit 1 fi diff --git a/plans/so/integration-etsi-testing/so-simulators/package/docker/src/main/docker/docker-files/kind-cluster/entrypoint.sh b/plans/so/integration-etsi-testing/so-simulators/package/docker/src/main/docker/docker-files/kind-cluster/entrypoint.sh index 4e4e75ec..a9af9a83 100644 --- a/plans/so/integration-etsi-testing/so-simulators/package/docker/src/main/docker/docker-files/kind-cluster/entrypoint.sh +++ b/plans/so/integration-etsi-testing/so-simulators/package/docker/src/main/docker/docker-files/kind-cluster/entrypoint.sh @@ -69,4 +69,5 @@ done < "$HOME/.kube/config" CONFIG_ADDRESS=$HOME/.kube/config +echo "Finished Setting up KIND cluster $CONFIG_ADDRESS" exec "$@" -- cgit 1.2.3-korg