diff options
author | Alex Shatov <alexs@att.com> | 2018-05-04 12:26:17 -0400 |
---|---|---|
committer | Alex Shatov <alexs@att.com> | 2018-05-04 12:26:17 -0400 |
commit | a46339420faefc49cb48adf2989a0884ff961278 (patch) | |
tree | 3862914b2996f355982085784bdea3f77ba0fd85 /tests | |
parent | f8cab3eebdcee288332e16bda5bd6b2fa17e02ac (diff) |
fixed 500 "value" argument is out of bounds
- convert the EOL to linux "\n" in the blueprint
before zipping and sending to cloudify to avoid crashing
when the blueprint is windows "\r\n" or mac "\r" based
- on catching the exception - log the stack
- added logger.info that replaced the logger.debug
in a variety of places
- external version 2.1.2, internal version 4.4.2
- unit test code coverage
Statements : 84.26% ( 942/1118 )
Branches : 64.14% ( 322/502 )
Functions : 81.68% ( 156/191 )
Lines : 84.32% ( 930/1103 )
Change-Id: I9f5f28ddd5d143ca4903316c9199df7d27682143
Signed-off-by: Alex Shatov <alexs@att.com>
Issue-ID: DCAEGEN2-487
Diffstat (limited to 'tests')
-rw-r--r-- | tests/mock_deployment_handler.js | 3 | ||||
-rw-r--r-- | tests/test_dcae-deployments.js | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/tests/mock_deployment_handler.js b/tests/mock_deployment_handler.js index ee42511..7407e55 100644 --- a/tests/mock_deployment_handler.js +++ b/tests/mock_deployment_handler.js @@ -88,7 +88,8 @@ const run_dh = function() { } }) .catch(function(e) { - const error = "test of deployment-handler exiting due to test problem: " + e.message; + const error = "test of deployment-handler exiting due to test problem: " + e.message + + " " + (e.stack || "").replace(/\n/g, " "); console.error(error); throw e; }); diff --git a/tests/test_dcae-deployments.js b/tests/test_dcae-deployments.js index ae95e06..ea81278 100644 --- a/tests/test_dcae-deployments.js +++ b/tests/test_dcae-deployments.js @@ -103,7 +103,7 @@ const Inventory = { "owner": "dcaeorch", "typeName": "svc-type-000", "typeVersion": 1, - "blueprintTemplate": "tosca_definitions_version: cloudify_dsl_1_2\nimports:\n - http://www.getcloudify.org/spec/cloudify/3.3/types.yaml\n - https://nexus01.research.att.com:8443/repository/solutioning01-mte2-raw/type_files/dti_inputs.yaml\nnode_templates:\n type-00:\n type: cloudify.nodes.Root", + "blueprintTemplate": "--- \r\ntosca_definitions_version: cloudify_dsl_1_3\r\nimports: \r\n - \"http://www.getcloudify.org/spec/cloudify/3.4/types.yaml\"\r\n - \"https://nexus.onap.org/service/local/repositories/raw/content/org.onap.dcaegen2.platform.plugins/R2/dockerplugin/3.2.0/dockerplugin_types.yaml\"\r\n - \"https://nexus.onap.org/service/local/repositories/raw/content/org.onap.dcaegen2.platform.plugins/R2/relationshipplugin/1.0.0/relationshipplugin_types.yaml\"\r\n - \"https://nexus.onap.org/service/local/repositories/raw/content/org.onap.dcaegen2.platform.plugins/R2/dcaepolicyplugin/2.3.0/dcaepolicyplugin_types.yaml\"\r\ninputs: \r\n aaiEnrichmentHost: \r\n default: none\r\n type: string\r\n aaiEnrichmentPort: \r\n default: 8443\r\n type: string\r\n cbs_host: \r\n default: config-binding-service.dcae\r\n type: string\r\n cbs_port: \r\n default: \"10000\"\r\n type: string\r\n consul_host: \r\n default: consul-server.onap-consul\r\n type: string\r\n consul_port: \r\n default: \"8500\"\r\n type: string\r\n dh_location_id: \r\n default: zone1\r\n type: string\r\n dh_override: \r\n default: component_dockerhost\r\n type: string\r\n dmaap_host: \r\n default: dmaap.onap-message-router\r\n type: string\r\n dmaap_port: \r\n default: 3904\r\n type: string\r\n enableAAIEnrichment: \r\n default: false\r\n type: string\r\n enableRedisCaching: \r\n default: false\r\n type: string\r\n external_port: \r\n default: \"32014\"\r\n description: \"Port for CDAPgui to be exposed\"\r\n type: string\r\n policy_id: \r\n default: none\r\n type: string\r\n redisHosts: \r\n type: string\r\n tag_version: \r\n default: \"nexus3.onap.org:10001/onap//onap/org.onap.dcaegen2.deployments.tca-cdap-container:1.0.0\"\r\n type: string\r\nnode_templates: \r\n docker_service_host: \r\n properties: \r\n docker_host_override: \r\n get_input: dh_override\r\n location_id: \r\n get_input: dh_location_id\r\n type: dcae.nodes.SelectedDockerHost\r\n tca_docker: \r\n interfaces: \r\n cloudify.interfaces.lifecycle: \r\n start: \r\n inputs: \r\n envs: \r\n AAIHOST: \r\n get_input: aaiEnrichmentHost\r\n AAIPORT: \r\n get_input: aaiEnrichmentPort\r\n CBS_HOST: \r\n get_input: cbs_host\r\n CBS_PORT: \r\n get_input: cbs_port\r\n CONFIG_BINDING_SERVICE: config_binding_service\r\n CONSUL_HOST: \r\n get_input: consul_host\r\n CONSUL_PORT: \r\n get_input: consul_port\r\n DMAAPHOST: \r\n get_input: dmaap_host\r\n DMAAPPORT: \r\n get_input: dmaap_port\r\n DMAAPPUBTOPIC: unauthenticated.DCAE_CL_OUTPUT\r\n DMAAPSUBTOPIC: unauthenticated.SEC_MEASUREMENT_OUTPUT\r\n# SERVICE_11011_IGNORE: \"true\"\r\n SERVICE_11015_IGNORE: \"true\"\r\n ports:\r\n - concat: [\"11011:\", { get_input: external_port }] \r\n stop: \r\n inputs: \r\n cleanup_image: true\r\n properties: \r\n application_config: \r\n app_config: \r\n appDescription: \"DCAE Analytics Threshold Crossing Alert Application\"\r\n appName: dcae-tca\r\n tcaAlertsAbatementTableName: TCAAlertsAbatementTable\r\n tcaAlertsAbatementTableTTLSeconds: \"1728000\"\r\n tcaSubscriberOutputStreamName: TCASubscriberOutputStream\r\n tcaVESAlertsTableName: TCAVESAlertsTable\r\n tcaVESAlertsTableTTLSeconds: \"1728000\"\r\n tcaVESMessageStatusTableName: TCAVESMessageStatusTable\r\n tcaVESMessageStatusTableTTLSeconds: \"86400\"\r\n thresholdCalculatorFlowletInstances: \"2\"\r\n app_preferences: \r\n aaiEnrichmentHost: \r\n get_input: aaiEnrichmentHost\r\n aaiEnrichmentIgnoreSSLCertificateErrors: \"true\"\r\n aaiEnrichmentPortNumber: \"8443\"\r\n aaiEnrichmentProtocol: https\r\n aaiEnrichmentUserName: DCAE\r\n aaiEnrichmentUserPassword: DCAE\r\n aaiVMEnrichmentAPIPath: /aai/v11/search/nodes-query\r\n aaiVNFEnrichmentAPIPath: /aai/v11/network/generic-vnfs/generic-vnf\r\n enableAAIEnrichment: \r\n get_input: enableAAIEnrichment\r\n enableAlertCEFFormat: \"false\"\r\n enableRedisCaching: \r\n get_input: enableRedisCaching\r\n publisherContentType: application/json\r\n publisherHostName: \r\n get_input: dmaap_host\r\n publisherHostPort: \r\n get_input: dmaap_port\r\n publisherMaxBatchSize: \"1\"\r\n publisherMaxRecoveryQueueSize: \"100000\"\r\n publisherPollingInterval: \"20000\"\r\n publisherProtocol: http\r\n publisherTopicName: unauthenticated.DCAE_CL_OUTPUT\r\n redisHosts: \r\n get_input: redisHosts\r\n subscriberConsumerGroup: OpenDCAE-c12\r\n subscriberConsumerId: c12\r\n subscriberContentType: application/json\r\n subscriberHostName: \r\n get_input: dmaap_host\r\n subscriberHostPort: \r\n get_input: dmaap_port\r\n subscriberMessageLimit: \"-1\"\r\n subscriberPollingInterval: \"30000\"\r\n subscriberProtocol: http\r\n subscriberTimeoutMS: \"-1\"\r\n subscriberTopicName: unauthenticated.SEC_MEASUREMENT_OUTPUT\r\n tca_policy: \"{\\\"domain\\\":\\\"measurementsForVfScaling\\\",\\\"metricsPerEventName\\\":[{\\\"eventName\\\":\\\"vFirewallBroadcastPackets\\\",\\\"controlLoopSchemaType\\\":\\\"VNF\\\",\\\"policyScope\\\":\\\"DCAE\\\",\\\"policyName\\\":\\\"DCAE.Config_tca-hi-lo\\\",\\\"policyVersion\\\":\\\"v0.0.1\\\",\\\"thresholds\\\":[{\\\"closedLoopControlName\\\":\\\"ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a\\\",\\\"version\\\":\\\"1.0.2\\\",\\\"fieldPath\\\":\\\"$.event.measurementsForVfScalingFields.vNicUsageArray[*].receivedTotalPacketsDelta\\\",\\\"thresholdValue\\\":300,\\\"direction\\\":\\\"LESS_OR_EQUAL\\\",\\\"severity\\\":\\\"MAJOR\\\",\\\"closedLoopEventStatus\\\":\\\"ONSET\\\"},{\\\"closedLoopControlName\\\":\\\"ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a\\\",\\\"version\\\":\\\"1.0.2\\\",\\\"fieldPath\\\":\\\"$.event.measurementsForVfScalingFields.vNicUsageArray[*].receivedTotalPacketsDelta\\\",\\\"thresholdValue\\\":700,\\\"direction\\\":\\\"GREATER_OR_EQUAL\\\",\\\"severity\\\":\\\"CRITICAL\\\",\\\"closedLoopEventStatus\\\":\\\"ONSET\\\"}]},{\\\"eventName\\\":\\\"vLoadBalancer\\\",\\\"controlLoopSchemaType\\\":\\\"VM\\\",\\\"policyScope\\\":\\\"DCAE\\\",\\\"policyName\\\":\\\"DCAE.Config_tca-hi-lo\\\",\\\"policyVersion\\\":\\\"v0.0.1\\\",\\\"thresholds\\\":[{\\\"closedLoopControlName\\\":\\\"ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3\\\",\\\"version\\\":\\\"1.0.2\\\",\\\"fieldPath\\\":\\\"$.event.measurementsForVfScalingFields.vNicUsageArray[*].receivedTotalPacketsDelta\\\",\\\"thresholdValue\\\":300,\\\"direction\\\":\\\"GREATER_OR_EQUAL\\\",\\\"severity\\\":\\\"CRITICAL\\\",\\\"closedLoopEventStatus\\\":\\\"ONSET\\\"}]},{\\\"eventName\\\":\\\"Measurement_vGMUX\\\",\\\"controlLoopSchemaType\\\":\\\"VNF\\\",\\\"policyScope\\\":\\\"DCAE\\\",\\\"policyName\\\":\\\"DCAE.Config_tca-hi-lo\\\",\\\"policyVersion\\\":\\\"v0.0.1\\\",\\\"thresholds\\\":[{\\\"closedLoopControlName\\\":\\\"ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e\\\",\\\"version\\\":\\\"1.0.2\\\",\\\"fieldPath\\\":\\\"$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value\\\",\\\"thresholdValue\\\":0,\\\"direction\\\":\\\"EQUAL\\\",\\\"severity\\\":\\\"MAJOR\\\",\\\"closedLoopEventStatus\\\":\\\"ABATED\\\"},{\\\"closedLoopControlName\\\":\\\"ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e\\\",\\\"version\\\":\\\"1.0.2\\\",\\\"fieldPath\\\":\\\"$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value\\\",\\\"thresholdValue\\\":0,\\\"direction\\\":\\\"GREATER\\\",\\\"severity\\\":\\\"CRITICAL\\\",\\\"closedLoopEventStatus\\\":\\\"ONSET\\\"}]}]}\"\r\n docker_config: \r\n healthcheck: \r\n endpoint: /\r\n interval: 15s\r\n timeout: 1s\r\n type: http\r\n image: \r\n get_input: tag_version\r\n service_component_type: dcaegen2-analytics_tca\r\n relationships: \r\n - \r\n target: docker_service_host\r\n type: dcae.relationships.component_contained_in\r\n - \r\n target: tca_policy\r\n type: cloudify.relationships.depends_on\r\n type: dcae.nodes.DockerContainerForComponentsUsingDmaap\r\n tca_policy: \r\n properties: \r\n policy_id: \r\n get_input: policy_id\r\n type: dcae.nodes.policy\r\n", "serviceIds": null, "vnfTypes": ["TESTVNF000"], "serviceLocations": null, |