From d3cdace51db473c93540229da3a0fd061120957c Mon Sep 17 00:00:00 2001 From: SantoshB Date: Thu, 15 Oct 2020 14:57:57 +0530 Subject: cds-bash script package Issue-ID: CCSDK-2913 Change-Id: I2f97b0c78314019d5002e8563c4e433ae5e816b9 Signed-off-by: SantoshB Signed-off-by: mrichomme --- .../failing-script/expected-response.json | 25 ++++++++++++++++++++++ .../failing-script/request-payload.json | 16 ++++++++++++++ .../test/py-executor/failing-script/test.sh | 25 ++++++++++++++++++++++ 3 files changed, 66 insertions(+) create mode 100644 cds-regression-test/test/py-executor/failing-script/expected-response.json create mode 100644 cds-regression-test/test/py-executor/failing-script/request-payload.json create mode 100644 cds-regression-test/test/py-executor/failing-script/test.sh (limited to 'cds-regression-test/test/py-executor/failing-script') diff --git a/cds-regression-test/test/py-executor/failing-script/expected-response.json b/cds-regression-test/test/py-executor/failing-script/expected-response.json new file mode 100644 index 0000000..17148b0 --- /dev/null +++ b/cds-regression-test/test/py-executor/failing-script/expected-response.json @@ -0,0 +1,25 @@ +{ + "commonHeader": { + "timestamp": "2020-05-19T17:24:33.353Z", + "originatorId": "System", + "requestId": "123456", + "subRequestId": "1234-12234", + "flags": null + }, + "actionIdentifiers": { + "blueprintName": "RT-py-executor", + "blueprintVersion": "1.0.0", + "actionName": "failing-remote-python", + "mode": "sync" + }, + "status": { + "code": 500, + "eventType": "EVENT_COMPONENT_FAILURE", + "timestamp": "2020-05-19T17:24:33.370Z", + "errorMessage": "Failed in ComponentRemoteScriptExecutor : UNKNOWN: Exception iterating responses: Script raised an exception, failed to get execution property(node_templates/execute-failing-remote-python/attributes/status)", + "message": "failure" + }, + "payload": { + "failing-remote-python-response": {} + } +} diff --git a/cds-regression-test/test/py-executor/failing-script/request-payload.json b/cds-regression-test/test/py-executor/failing-script/request-payload.json new file mode 100644 index 0000000..bacd876 --- /dev/null +++ b/cds-regression-test/test/py-executor/failing-script/request-payload.json @@ -0,0 +1,16 @@ +{ + "commonHeader": { + "originatorId": "System", + "requestId": "123456", + "subRequestId": "1234-12234" + }, + "actionIdentifiers": { + "blueprintName": "RT-py-executor", + "blueprintVersion": "1.0.0", + "actionName": "failing-remote-python", + "mode": "sync" + }, + "payload": { + "failing-remote-python-request": {} + } +} diff --git a/cds-regression-test/test/py-executor/failing-script/test.sh b/cds-regression-test/test/py-executor/failing-script/test.sh new file mode 100644 index 0000000..4386e09 --- /dev/null +++ b/cds-regression-test/test/py-executor/failing-script/test.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +CBA_NAME="py-executor" +TEST_NAME="failing-script" +TEST_NUMBER=$RANDOM + +mkdir -p "$RESPONSES_DIRECTORY/$CBA_NAME/$TEST_NAME/$TEST_NUMBER/" +RESPONSE_HEADERS_FILE="$RESPONSES_DIRECTORY/$CBA_NAME/$TEST_NAME/$TEST_NUMBER/response-headers" +RESPONSE_PAYLOAD_FILE="$RESPONSES_DIRECTORY/$CBA_NAME/$TEST_NAME/$TEST_NUMBER/response-payload" + +REQUEST_PAYLOAD_FILE="$TEST_DIRECTORY/$CBA_NAME/$TEST_NAME/request-payload.json" +EXPECTED_PAYLOAD_FILE="$TEST_DIRECTORY/$CBA_NAME/$TEST_NAME/expected-response.json" + +. ./$TEST_DIRECTORY/utils.sh + +echo "Running test: $CBA_NAME:$TEST_NUMBER:$TEST_NAME" + +echo 'Calling CDS process' +process_cba $REQUEST_PAYLOAD_FILE $RESPONSE_PAYLOAD_FILE $RESPONSE_HEADERS_FILE + +echo 'Assert statuscode' +assert_status_code 500 $RESPONSE_HEADERS_FILE + +echo 'Assert payload' +assert_cds_response_equals $EXPECTED_PAYLOAD_FILE $RESPONSE_PAYLOAD_FILE -- cgit 1.2.3-korg