diff options
Diffstat (limited to 'tests')
32 files changed, 1126 insertions, 396 deletions
diff --git a/tests/dcaegen2/prh-testcases/resources/prh_library.robot b/tests/dcaegen2/prh-testcases/resources/prh_library.robot index 1e6d3105..212dfe0b 100644 --- a/tests/dcaegen2/prh-testcases/resources/prh_library.robot +++ b/tests/dcaegen2/prh-testcases/resources/prh_library.robot @@ -57,7 +57,7 @@ Verify AAI not responding is logged ${ves_event}= Get Data From File ${test_case_directory}/ves-event.json Ensure Container Is Exited aai_simulator Set VES event in DMaaP ${ves_event} - Wait for one of PRH log entries 90s connection timed out: aai Host is unreachable: aai + Wait for one of PRH log entries 90s connection timed out: aai Host is unreachable: aai No route to host: aai [Teardown] Ensure Container Is Running aai_simulator Verify PNF re registration diff --git a/tests/dcaegen2/testcases/assets/certs/outdated.crt b/tests/dcaegen2/testcases/assets/certs/outdated.crt new file mode 100644 index 00000000..8768cff7 --- /dev/null +++ b/tests/dcaegen2/testcases/assets/certs/outdated.crt @@ -0,0 +1,24 @@ +-----BEGIN CERTIFICATE----- +MIIEGDCCAgACFFgwd9DMpQEwVkrCkzJPGRq6xW3EMA0GCSqGSIb3DQEBCwUAMEUx +CzAJBgNVBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRl +cm5ldCBXaWRnaXRzIFB0eSBMdGQwHhcNMTkxMTE4MTIyMzIyWhcNMTkxMTE5MTIy +MzIyWjBMMQswCQYDVQQGEwJQTDELMAkGA1UECAwCRGwxEDAOBgNVBAcMB1dyb2Ns +YXcxDjAMBgNVBAoMBU5va2lhMQ4wDAYDVQQLDAVOb2tpYTCCASIwDQYJKoZIhvcN +AQEBBQADggEPADCCAQoCggEBALIx4HC0SskTvE5dzcfHcrjsvBvKJeum7NkVvpk2 +4hxhcynfmhM6wJ0VJV0x6B4mHe0ja4tJZdY5IyfRMV/5Q79hiiLmwg6hgjXX7MKn +7JnFCX1iMj+zXlQzCLgXVpB6ruBAMImiBjGn2MlTIHKthsNGX6Qf+hDmJqEfoRuI +jp7SwI4BvN084ijIpNWARdxAsAQ1qJjrCLhvJ9Ob8btCqclAzv3ZPAcOD6DjORx5 +JxIMMJ6bXfHgmsECy4dbGBMnieKF1O8NNdoypVCE+NuqckSmE2JQiHIkRHZ5Bul4 +ihk+wSR2WxiNOOuMN7bp+0Yan44ritMB06wpFdp4jGMvyTsCAwEAATANBgkqhkiG +9w0BAQsFAAOCAgEAYQEi9+o6+nlMvXJlal62QPoBPOQqFKWTBd5X0Wv+L0K/5yAO +S2Sv0woQyDLydjsglNLEJB3VJuPQsoRZDGqv9aThJ0j+/BzylbkxwcReMs7P+rl2 +DIeqjdvsato3ZB0Rtp28jBDI7HrvBfmGQQFUaeBRI7eybe3AXqy8INozkdAGeeIr +FxMmrZ0z7eQj5T8CE/ebmsbdIDRPmI672V8Tojd6nQSZFAG9/9q6f/iK45Mx6Qls +Qqfl+bdL3ey0aNsUR6yWNa2DBA15HW9GvUQuMxeGDNQn0bxib0KsKgxfbX4vLYVF +RgC/c1td9LJoSMl3tURoZwRfAHFX82jDxAExtlTMvZMleMlP3O/YRB0SNieFeidE +O3OzuCHBvEpQEcDdUMxc4XfCnV1nE6QHLsBwz3Zwt4ZnL6dS8iBE0p3NN5qHVWF7 +Vxb59ZYPCrTQbgTsKlfHyX8aB2Nk0rCgDFBbov7gVevOHjIWqmDyFhrNEJEmXO+3 +MM8UrImojbr4kn89VsujMP62jMqyXifuejGzkoHf6tBuTENiNxwmPwiX+ZD5etVE +kh8c7aoRZi6zv+vMUu6U1RpYUEPGMTGZKBsuk+2IABhfD5UcneGR3kX2Vtb34EZE +8i29bJY7CmzNBUlkbubqv8axklF2hxiN7w8oRLj+tH8jnVMMP47KuHaNx+8= +-----END CERTIFICATE----- diff --git a/tests/dcaegen2/testcases/assets/certs/outdated.key b/tests/dcaegen2/testcases/assets/certs/outdated.key new file mode 100644 index 00000000..860b30fd --- /dev/null +++ b/tests/dcaegen2/testcases/assets/certs/outdated.key @@ -0,0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tgLJbo +xEN/TaFLoltW+kNaS0GzsJBzZvp8mbcmoFbx9hGdAoGAGVHjwqnpHFPgvbhP8mbD +tkB7aPrDfTKT5+Drz1CqbeFcyTUi+um84zZWJubDwHmacsQnodLcUvJPG5DOtkxf +s+ALzmGYFg78qiROKbi8VpB7jbP9sq5xuLMQo9l+X/CdhFnJgUjzSL9XNAcgCMhM +JJWpbzomkLUDwCvIaMwuIFMCgYEAwv81exAkXM1G9izC/oMVDkQvrCj8YxfHoISf +TNMBOOuZsGhyXAvxvPwG+cz/7Gf+09IJgSZsTI2ZpdkjR52vQmX1++Ca/Wwu/UDM +ZK/jMwWR+OKdcyfcpaHpy8pxekvPKEO2JnRruDnnCpiTt0H1dPLnO5tRNrexp13i +y8s9PiECgYEAzCk/b/62WIpEb7BPO19I7XR8xAT36QINiTJrOHqrh6iexD9T63Zf +0OuNsnLna2uvPRsSKnoU8a0/frEKIu45LBrUh1XqKjgRP1PMktAI6KGwRvPXTzGT +WVgznP2uU6wCyvd6obRfcX79egDeZrGfJ0xnuesaIEeYM+5CFgxqmHo= +-----END RSA PRIVATE KEY----- diff --git a/tests/dcaegen2/testcases/assets/certs/rootCA.crt b/tests/dcaegen2/testcases/assets/certs/rootCA.crt new file mode 100644 index 00000000..6a869ffc --- /dev/null +++ b/tests/dcaegen2/testcases/assets/certs/rootCA.crt @@ -0,0 +1,31 @@ +-----BEGIN CERTIFICATE----- +MIIFazCCA1OgAwIBAgIUHt/v/SBbEGqP7K3veoJTDUgmiG4wDQYJKoZIhvcNAQEL +BQAwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoM +GEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDAeFw0xODExMDcwODU5MDRaFw0yMTA4 +MjcwODU5MDRaMEUxCzAJBgNVBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEw +HwYDVQQKDBhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQwggIiMA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njqUUVG5xktmpq2Q5aEPkNhQPJEggn9hFlIybklSyRMoWyK36KUo5F +szEt0teI+T4Q6lqJTiVrV3N5w9fNlcJ4ye5uTFrMwBjMS4I0kId2PHfv6KZ+LUQc +4fu22RtNtFmcIfNAxaYyNb53EmcsDLf/v5WM/ZzietU1p0UHzxECdSTFt7cV1Ldt +yFjbWkyZ4Jdn+aMadxpUdjT/Egm31hovE+KPbZUdd9xNEbQ+JZc/kx2Cuyxw1c8a +UcFAxwPzwqU8+LpHLiXx6rZrGuZ7Nc8RpgR4ylHbyRr2ynJgi66QPyp6HhwvBEgK +ig+8qUaczUGlSbssMN11tJ235/j6FFn+V8yp3UJEU7ax7epQ9YMyiw3maY+x1L0Z +ZOXrZCkXCf1LQ3x52e1gvfGqYCBSxY217+bNNieQe3RsxPwaGd/KVv5C62GzIVG+ +r1k7gCv3gIHk8kTVeHpv22qvqrIT6lnGpUgJTAPzvtb+gZn/ByrvGHs5AnZkOkk= +-----END CERTIFICATE----- diff --git a/tests/dcaegen2/testcases/assets/certs/rootCA.key b/tests/dcaegen2/testcases/assets/certs/rootCA.key new file mode 100644 index 00000000..08347661 --- /dev/null +++ b/tests/dcaegen2/testcases/assets/certs/rootCA.key @@ -0,0 +1,54 @@ +-----BEGIN RSA PRIVATE KEY----- +Proc-Type: 4,ENCRYPTED +DEK-Info: DES-EDE3-CBC,00244E4EB5B0693C + +UYrYxcNCEiXxcrA2Me6EloFPEQ34/BZwWBtQ4WKz9Ya7FLl16SKyyuoB2BXWbRfX +3sGUCrKaLIC3BzPzwGRW5QoTlmUhOSAW5yzDWTOGN10uUlwTN9sT5CNPfWRwA211 +8eh0T3y0OyXVdGIQWDKDV9FhRStzblyZ/iZPN640dpPy/m4AldR3KFnBvErchNoL +7lUon+lHmMQMpom+sbAlW3agv5AVeDbg8rxTU+8pBNnX0kAeB/LxzSJ85fNwwswN +BPk+4zasUIrhJDgBliuCFsqPj404kHaIxnBDtiO16xLstDYiDuS67BRlChRwgpSX +k/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kyBcvSZZQZEz +Sgf/+qEfyiZt7XQY2Ysgz4bhAmSluSyIs0KO68ie1wjLBu/Oy+oDtq1F3WoFVz5F +MJIco5nwX/p+OGrNllMnOPIuLNdIoAACr4JkeurNIv7flxD0y8a4C6pYGgNqs5Yv +biLVzYZ4fpejCbHwetFRj7FTIk+y8GKAoAx15UkhXCSbUKDG6Q5TpU91CX9gxrq4 +SpcWtf6+F8sZsHstQgcOXr484fG7sd3THR0mGNVHpY1bGW/s3jymtWcECecC3DI2 +Gd6p7lWegQQrHdP8hM1WPZdoQ4Iq5rgJR8DT21SUGTd2P7Y7lpRULCoUOit9IKIy +LTYwVhZuZRnELERVKkg9Ovwofb0P1a5q5eYImOuf3+T1iLDIhFIG5Y83NkznIJxo +vduCnyyDSbXSFNp46j1hQedFZDwZooGMvU0OyHIhJYTvZ99ajRkg1UqkZfnUxJZW +nLywPHmk1isHoHhlxSVkBAHfz9cOxZKf4EpKEKgz7o87y7Sm1FMN0FvMIPTeoC/s +YBML5ghQZ7yS9wPQu7n0gfIP/KS1uuRLy02kvO0mmuzqtUXJIozfyaCbrWoqt9Qe +75yLpV/960W5MN2vzMF95g/f5JjLDz9ZGS4vBK+v+mqOLMUWG94IS7WHa2ngHdzc +9xGToNXbd/N6CjyB0+aBacCFuya7YVBfGnR2W0DJmY8/EKifTma4P0uyecghfnTi +-----END RSA PRIVATE KEY----- diff --git a/tests/dcaegen2/testcases/assets/certs/wrong.crt b/tests/dcaegen2/testcases/assets/certs/wrong.crt new file mode 100644 index 00000000..5a82cd09 --- /dev/null +++ b/tests/dcaegen2/testcases/assets/certs/wrong.crt @@ -0,0 +1,32 @@ +-----BEGIN CERTIFICATE----- +MIIFkzCCA3ugAwIBAgIUdRPd83cfkwo+IApq1ZVxHiBwVTwwDQYJKoZIhvcNAQEL +BQAwWTELMAkGA1UEBhMCUEwxCzAJBgNVBAgMAkRMMRAwDgYDVQQHDAdXcm9jbGF3 +MQ0wCwYDVQQKDARyb290MQ0wCwYDVQ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AMfmKx6lgMkwDzX4sgfXicj0A7xN68YbabQo5e+3AlxDPkhZwArMnIWf ++Jb4VANAiP4fTNGbovuSGwgq2yiMPJxJM1dBEwv4hAXOFF1RK1JdjcTliXtB7Ubo +dBi4fEyDfCWjZm4/P8qNWH3yUjoIaxSjszdv9Ebt1wUqsRU+NtM25nd06oaGwUtq +OB9hV/qdGlJqmRToGhCAnxWRFxu4HywXGimM9vqxlcqSM6gjCvua+iUcd59Qlxk8 +KWktVNKcWgJlL8hVGULDbwJtZJvhTDqou/F5qQAAEa5YNU3zBgznv2aZQZQhQssB +LQiTa9f+0e0ySGcBwEykTg3QpAUBaL40HlLGR4kpsRv9FyV/YrrTRI9kqAEM1FNh +lBi2ll47qchSBH0KRSmnt8QzfhUDWReNp2gvYSu3HVGxUu7dKGDm4tBI1ts+RLAq +9yu29Z+Db0ty7Q/PQ6jjeDCot+JNHWfBQ4S70W6CN1lo7uCwq7tnLLYL6/+Cqe9O +9A+++vkeT0ai95u0+3PSzUkWgCQ+qd3XFlV7JeEWbHV+db/zdIRk07vbRUs+MVNY +NN6BsxUsMMVm3cG5TpMeG7+kCEHwH0qXO8Ycj6EVB9GyLPGWQjDTenSUByP82Pbp +3fZkv3l/vszkaqL3f3lLZkDYh9r1X/TYbTjLkYQUHiobryBplBTy +-----END CERTIFICATE----- diff --git a/tests/dcaegen2/testcases/assets/certs/wrong.key b/tests/dcaegen2/testcases/assets/certs/wrong.key new file mode 100644 index 00000000..ba2a01e5 --- /dev/null +++ b/tests/dcaegen2/testcases/assets/certs/wrong.key @@ -0,0 +1,51 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIJKQIBAAKCAgEA3WLxGCL/jE4XFONHk7tUbYgCYegBw3cNNAWB0L07swHTVjRT +9KIArq+zH3z/xKP8L9Uib/ytZd0U/Z3lHmBHh0h2XYyj0nmCnDAO5YGTisKdC5zX +GBN9Mbvixghqioz0lTbaL6cCWk0lfD/Da4lJiBdTU6gzqZJmrBdnxQapKxUjEKVd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qQaAhQWT+vWFwirCuKdYkHxGI5SZMCB4KHOVQDc +56Z8hc+6ZHgQcZuykJcOey+tnUtN/P246BOOfsMrEDJJppH58fF8QUNffloZW/84 +foKMQQKCAQBdT5VL8xxjbw2ZqMGfIkVU1InYBZgPPdPx1GwcKCbgQ+3jDGOOcGB/ +uWks3SexJR6L3SR0dqfiE+4Q9LCorfXd2MnWQpWdv4+FPlJ2tWwuJ2L9spWm63xl +M6wqNIFmSuFw+nmWfdlJu92uy1K2z85mU1PFRbJGnu28jvuT0i5GA72qJUik+N7i +r2sdO8LwyacaMF+l+8mtgO1rbmpWhBZex+CV7+4QCcz7inO7Bnu1f28xoyzUA/rr +RKWfMOOr/yKRiaTQpdySPZehyyMfp+dH5iGVEWcdCXCl/oaU3izflmZN9JYlk5Gp +Qb6l3iHxx7TE2e5hL78dp9M5OuxekB3RAoIBAQDOYRP9alUy+32g/jwJfaSg2BR9 +1uOSDaDRw9IHM5EUyWBF4ehgSVmy32WAIfCVXdrC8RUPf8n4aNk6k3N7Mhczm41m +4KrUiDcpA+A7j51MU79yXdaGJ+e9bMR4QqadQYmHknbjDFJAQEnWZvWQxBP+CJDZ +2mhV78swBGJK+W8zUIHBbo+SUCF6KUH/1fBvVxVlzwFsSrk2niyfyIGbPaEpriPL +gCvxsZR3dH4wqVBythBMy+pdL0BWKtxNHR/UkXPpLqtD/p4XXReJjpW7ImuFMjti +B//8aludyEJo+TAiTzDrSOD1pxPtQqTiLBhZlsjD9QNfE9wsRM0SnvzpmMCs +-----END RSA PRIVATE KEY----- diff --git a/tests/dcaegen2/testcases/assets/json_events/ves7_batch_valid.json b/tests/dcaegen2/testcases/assets/json_events/ves7_batch_valid.json new file mode 100644 index 00000000..1db81eed --- /dev/null +++ b/tests/dcaegen2/testcases/assets/json_events/ves7_batch_valid.json @@ -0,0 +1,67 @@ + +{ + "eventList": [ + { + "commonEventHeader": { + "version": "4.0.1", + "vesEventListenerVersion": "7.0.1", + "domain": "fault", + "eventName": "Fault_Vscf:Acs-Ericcson_PilotNumberPoolExhaustion", + "eventId": "fault0000250", + "sequence": 1, + "priority": "High", + "reportingEntityId": "cc305d54-75b4-431b-adb2-eb6b9e541234", + "reportingEntityName": "ibcx0001vm002oam0011234", + "sourceId": "de305d54-75b4-431b-adb2-eb6b9e546014", + "sourceName": "scfx0001vm002cap001", + "nfVendorName": "Ericsson", + "nfNamingCode": "scfx", + "nfcNamingCode": "ssc", + "startEpochMicrosec": 1413378172000000, + "lastEpochMicrosec": 1413378172000000, + "timeZoneOffset": "UTC-05:30" + }, + "faultFields": { + "faultFieldsVersion": "4.0", + "alarmCondition": "PilotNumberPoolExhaustion", + "eventSourceType": "other", + "specificProblem": "Calls cannot complete - pilot numbers are unavailable", + "eventSeverity": "CRITICAL", + "vfStatus": "Active", + "alarmAdditionalInformation": { + "PilotNumberPoolSize": "1000" + } + } + }, + { + "commonEventHeader": { + "version": "4.0.1", + "vesEventListenerVersion": "7.0.1", + "domain": "fault", + "eventName": " Fault_Vscf:Acs-Ericcson_RecordingServerUnreachable", + "eventId": "fault0000251", + "sequence": 0, + "priority": "High", + "reportingEntityId": "cc305d54-75b4-431b-adb2-eb6b9e541234", + "reportingEntityName": "ibcx0001vm002oam0011234", + "sourceId": "de305d54-75b4-431b-adb2-eb6b9e546014", + "sourceName": "scfx0001vm002cap001", + "nfVendorName": "Ericsson", + "nfNamingCode": "scfx", + "nfcNamingCode": "ssc", + "startEpochMicrosec": 1413378172000010, + "lastEpochMicrosec": 1413378172000010, + "timeZoneOffset": "UTC-05:30" + }, + "faultFields": { + "faultFieldsVersion": "4.0", + "alarmCondition": "RecordingServerUnreachable", + "eventSourceType": "other", + "specificProblem": "Recording server unreachable", + "eventSeverity": "CRITICAL", + "vfStatus": "Active" + } + } + ] +} + diff --git a/tests/dcaegen2/testcases/assets/json_events/ves7_invalid.json b/tests/dcaegen2/testcases/assets/json_events/ves7_invalid.json new file mode 100644 index 00000000..74c0a92f --- /dev/null +++ b/tests/dcaegen2/testcases/assets/json_events/ves7_invalid.json @@ -0,0 +1,34 @@ +{ + "event": { + "commonEventHeader": { + "version": "4.0.1", + "vesEventListenerVersion": "30.0.1", + "domain": "fault", + "eventName": "Fault_Vscf:Acs-Ericcson_PilotNumberPoolExhaustion", + "eventId": "fault0000245", + "sequence": 1, + "priority": "High", + "reportingEntityId": "cc305d54-75b4-431b-adb2-eb6b9e541234", + "reportingEntityName": "ibcx0001vm002oam001", + "sourceId": "de305d54-75b4-431b-adb2-eb6b9e546014", + "sourceName": "scfx0001vm002cap001", + "nfVendorName": "Ericsson", + "nfNamingCode": "scfx", + "nfcNamingCode": "ssc", + "startEpochMicrosec": 1413378172000000, + "lastEpochMicrosec": 1413378172000000, + "timeZoneOffset": "UTC-05:30" + }, + "faultFields": { + "faultFieldsVersion": "4.0", + "alarmCondition": "PilotNumberPoolExhaustion", + "eventSourceType": "other", + "specificProblem": "Calls cannot complete - pilot numbers are unavailable", + "eventSeverity": "CRITICAL", + "vfStatus": "Active", + "alarmAdditionalInformation": { + "PilotNumberPoolSize": "1000" + } + } + } +} diff --git a/tests/dcaegen2/testcases/assets/json_events/ves7_missing_mandatory_domain.json b/tests/dcaegen2/testcases/assets/json_events/ves7_missing_mandatory_domain.json new file mode 100644 index 00000000..51787555 --- /dev/null +++ b/tests/dcaegen2/testcases/assets/json_events/ves7_missing_mandatory_domain.json @@ -0,0 +1,33 @@ +{ + "event": { + "commonEventHeader": { + "version": "4.0.1", + "vesEventListenerVersion": "7.0.1", + "eventName": "Fault_Vscf:Acs-Ericcson_PilotNumberPoolExhaustion", + "eventId": "ab305d54-85b4-a31b-7db2-fb6b9e546015", + "sequence": 1, + "priority": "High", + "reportingEntityId": "cc305d54-75b4-431b-adb2-eb6b9e541234", + "reportingEntityName": "ibcx0001vm002oam001", + "sourceId": "de305d54-75b4-431b-adb2-eb6b9e546014", + "sourceName": "scfx0001vm002cap001", + "nfVendorName": "Ericsson", + "nfNamingCode": "scfx", + "nfcNamingCode": "ssc", + "startEpochMicrosec": 1413378172000000, + "lastEpochMicrosec": 1413378172000000, + "timeZoneOffset": "UTC-05:30" + }, + "faultFields": { + "faultFieldsVersion": "4.0", + "alarmCondition": "PilotNumberPoolExhaustion", + "eventSourceType": "other", + "specificProblem": "Calls cannot complete - pilot numbers are unavailable", + "eventSeverity": "CRITICAL", + "vfStatus": "Active", + "alarmAdditionalInformation": { + "PilotNumberPoolSize": "1000" + } + } + } +} diff --git a/tests/dcaegen2/testcases/assets/json_events/ves7_valid.json b/tests/dcaegen2/testcases/assets/json_events/ves7_valid.json new file mode 100644 index 00000000..aabefd5c --- /dev/null +++ b/tests/dcaegen2/testcases/assets/json_events/ves7_valid.json @@ -0,0 +1,34 @@ +{ + "event": { + "commonEventHeader": { + "version": "4.0.1", + "vesEventListenerVersion": "7.0.1", + "domain": "fault", + "eventName": "Fault_Vscf:Acs-Ericcson_PilotNumberPoolExhaustion", + "eventId": "ab305d54-85b4-a31b-7db2-fb6b9e546015", + "sequence": 1, + "priority": "High", + "reportingEntityId": "cc305d54-75b4-431b-adb2-eb6b9e541234", + "reportingEntityName": "ibcx0001vm002oam001", + "sourceId": "de305d54-75b4-431b-adb2-eb6b9e546014", + "sourceName": "scfx0001vm002cap001", + "nfVendorName": "Ericsson", + "nfNamingCode": "scfx", + "nfcNamingCode": "ssc", + "startEpochMicrosec": 1413378172000000, + "lastEpochMicrosec": 1413378172000000, + "timeZoneOffset": "UTC-05:30" + }, + "faultFields": { + "faultFieldsVersion": "4.0", + "alarmCondition": "PilotNumberPoolExhaustion", + "eventSourceType": "other", + "specificProblem": "Calls cannot complete - pilot numbers are unavailable", + "eventSeverity": "CRITICAL", + "vfStatus": "Active", + "alarmAdditionalInformation": { + "PilotNumberPoolSize": "1000" + } + } + } +} diff --git a/tests/dcaegen2/testcases/dcae_ves.robot b/tests/dcaegen2/testcases/dcae_ves.robot index f457f2ce..e12097e2 100644 --- a/tests/dcaegen2/testcases/dcae_ves.robot +++ b/tests/dcaegen2/testcases/dcae_ves.robot @@ -1,171 +1,188 @@ *** Settings *** -Documentation Testing DCAE VES Listener with various event feeds from VoLTE, vDNS, vFW and cCPE use scenarios -Library RequestsLibrary +Documentation Run healthchecks for DCAE VES +... Testing /eventListener/v7 and /eventListener/v7/eventBatch endpoints for DCEA VES v7. +... Testing /eventListener/v5 and /eventListener/v5/eventBatch for DCEA VES v5 with various event feeds from VoLTE, vFW and PNF +Library RequestsLibrary Library OperatingSystem Library Collections Library DcaeLibrary -Resource resources/dcae_keywords.robot -Resource ../../common.robot -Test Setup Cleanup VES Events -Suite Setup Run keywords VES Collector Suite Setup DMaaP Create sessions Create header -Suite Teardown VES Collector Suite Shutdown DMaaP - -*** Variables *** -${VESC_URL_HTTPS} https://%{VESC_IP}:8443 -${VESC_URL} http://%{VESC_IP}:8080 -${VES_ANY_EVENT_PATH} /eventListener/v5 -${VES_BATCH_EVENT_PATH} /eventListener/v5/eventBatch -${VES_THROTTLE_STATE_EVENT_PATH} /eventListener/v5/clientThrottlingState -${EVENT_DATA_FILE} %{WORKSPACE}/tests/dcaegen2/testcases/assets/json_events/ves_volte_single_fault_event.json -${EVENT_MEASURE_FILE} %{WORKSPACE}/tests/dcaegen2/testcases/assets/json_events/ves_vfirewall_measurement.json -${EVENT_DATA_FILE_BAD} %{WORKSPACE}/tests/dcaegen2/testcases/assets/json_events/ves_volte_single_fault_event_bad.json -${EVENT_BATCH_DATA_FILE} %{WORKSPACE}/tests/dcaegen2/testcases/assets/json_events/ves_volte_fault_eventlist_batch.json -${EVENT_THROTTLING_STATE_DATA_FILE} %{WORKSPACE}/tests/dcaegen2/testcases/assets/json_events/ves_volte_fault_provide_throttle_state.json -${EVENT_PNF_REGISTRATION} %{WORKSPACE}/tests/dcaegen2/testcases/assets/json_events/ves_pnf_registration_event.json - -#DCAE Health Check -${CONFIG_BINDING_URL} http://localhost:8443 -${CB_HEALTHCHECK_PATH} /healthcheck -${CB_SERVICE_COMPONENT_PATH} /service_component/ -${VES_Service_Name1} dcae-controller-ves-collector -${VES_Service_Name2} ves-collector-not-exist +Resource ./resources/dcae_keywords.robot + +Test Teardown Cleanup VES Events +Suite Setup Run keywords VES Collector Suite Setup DMaaP Generate Certs Create sessions Create header +Suite Teardown Run keywords VES Collector Suite Shutdown DMaaP Remove Certs *** Test Cases *** -VES Collector Health Check + +#No authentication tests + +VES Collector HTTP Health Check [Tags] DCAE-VESC-R1 - [Documentation] Ves Collector Health Check - ${uuid}= Generate UUID - ${headers}= Create Dictionary Accept=*/* X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID} - ${resp}= Get Request ${suite_dcae_vesc_url_session} /healthcheck headers=${headers} - Should Be Equal As Strings ${resp.status_code} 200 + [Documentation] Run healthcheck + Run Healthcheck + +Publish Single VES VNF Measurement Event API V7 + [Tags] DCAE-VESC-R1 + [Documentation] Post single event with valid data to /eventListener/v7 endpoint and expect 202 Response Status Code + Send Request And Validate Response Publish Event To VES Collector ${http_session} ${VES_EVENTLISTENER_V7} ${VES_VALID_JSON_V7} 202 ab305d54-85b4-a31b-7db2-fb6b9e546015 + +Publish Single VES VNF Measurement Event with wrong JSON + [Tags] DCAE-VESC-R1 + [Documentation] Post single event with invalid data to /eventListener/v7 endpoint and expect 400 Response Status Code + Send Request And Validate Response Publish Event To VES Collector ${http_session} ${VES_EVENTLISTENER_V7} ${VES_INVALID_JSON_V7} 400 + +Publish Single VES VNF Measurement Event with missing mandatory parameter domain + [Tags] DCAE-VESC-R1 + [Documentation] Post single event with lack of one of the mandatory parameters "domain" to /eventListener/v7 endpoint and expect 400 Response Status Code + Send Request And Validate Response Publish Event To VES Collector ${http_session} ${VES_EVENTLISTENER_V7} ${VES_MISSING_MANDATORY_DOMAIN_V7} 400 + +Publish Single VES VNF Measurement Event with No Auth over HTTPS + [Tags] DCAE-VESC-R1 + [Documentation] Post single event over HTTPS with authentication disabled and expect ConnectionError + @{err_content} Create List Errno 111 + Send Request And Expect Error Publish Event To VES Collector ${https_basic_auth_session} ${VES_EVENTLISTENER_V7} ${VES_VALID_JSON_V7} ConnectionError:* @{err_content} Publish Single VES VoLTE Fault Event [Tags] DCAE-VESC-R1 - [Documentation] Post single event and expect 200 Response - ${evtdata}= Get Data From File ${EVENT_DATA_FILE} - ${resp}= Publish Event To VES Collector No Auth ${VES_ANY_EVENT_PATH} ${evtdata} - Log Receive HTTP Status code ${resp.status_code} - Should Be Equal As Strings ${resp.status_code} 200 - ${isEmpty}= Is Json Empty ${resp} - Run Keyword If '${isEmpty}' == False Log ${resp.json()} - ${ret}= DMaaP Message Receive ab305d54-85b4-a31b-7db2-fb6b9e546015 - Should Be Equal As Strings ${ret} true - -Publish Single VES VNF Measurement Event - [Tags] DCAE-VESC-R1 - [Documentation] Post single event and expect 200 Response - ${evtdata}= Get Data From File ${EVENT_MEASURE_FILE} - ${resp}= Publish Event To VES Collector No Auth ${VES_ANY_EVENT_PATH} ${evtdata} - Log Receive HTTP Status code ${resp.status_code} - Should Be Equal As Strings ${resp.status_code} 200 - ${isEmpty}= Is Json Empty ${resp} - Run Keyword If '${isEmpty}' == False Log ${resp.json()} - ${ret}= DMaaP Message Receive 0b2b5790-3673-480a-a4bd-5a00b88e5af6 - Should Be Equal As Strings ${ret} true + [Documentation] Post single event with valid data to /eventListener/v5 endpoint and expect 202 Response Status Code + Send Request And Validate Response Publish Event To VES Collector ${http_session} ${VES_ANY_EVENT_PATH} ${EVENT_DATA_FILE} 202 ab305d54-85b4-a31b-7db2-fb6b9e546015 + +Publish Single VES VNF Measurement Event API V5 + [Tags] DCAE-VESC-R1 + [Documentation] Post single measurement event with valid data to /eventListener/v5 endpoint and expect 202 Response Status Code + Send Request And Validate Response Publish Event To VES Collector ${http_session} ${VES_ANY_EVENT_PATH} ${EVENT_MEASURE_FILE} 202 0b2b5790-3673-480a-a4bd-5a00b88e5af6 Publish VES VoLTE Fault Batch Events [Tags] DCAE-VESC-R1 - [Documentation] Post batched events and expect 200 Response - ${evtdata}= Get Data From File ${EVENT_BATCH_DATA_FILE} - ${resp}= Publish Event To VES Collector No Auth ${VES_BATCH_EVENT_PATH} ${evtdata} - Should Be Equal As Strings ${resp.status_code} 200 - #${ret}= DMaaP Message Receive ab305d54-85b4-a31b-7db2-fb6b9e546016 - ${ret}= DMaaP Message Receive ab305d54-85b4-a31b-7db2-fb6b9e546025 - Should Be Equal As Strings ${ret} true - -Publish Single VES VoLTE Fault Event With Bad Data - [Tags] DCAE-VESC-R1 - [Documentation] Run with JSON Envent with missing comma to expect 400 response - ${evtdata}= Get Data From File ${EVENT_DATA_FILE_BAD} - Log Send HTTP Request with invalid Json Event Data - ${resp}= Publish Event To VES Collector No Auth ${VES_ANY_EVENT_PATH} ${evtdata} - Log Receive HTTP Status code ${resp.status_code} - Should Be Equal As Strings ${resp.status_code} 400 - ${isEmpty}= Is Json Empty ${resp} - Run Keyword If '${isEmpty}' == False Log ${resp.json()} - + [Documentation] Post single event with valid data to /eventListener/v5/eventBatch endpoint and expect 202 Response Status Code + Send Request And Validate Response Publish Event To VES Collector ${http_session} ${VES_BATCH_EVENT_PATH} ${EVENT_BATCH_DATA_FILE} 202 ab305d54-85b4-a31b-7db2-fb6b9e546025 + Publish VES Event With Invalid Method [Tags] DCAE-VESC-R1 - [Documentation] Use invalid Put instead of Post method to expect 405 response - ${evtdata}= Get Data From File ${EVENT_DATA_FILE} + [Documentation] Use invalid Put instead of Post method to expect 405 Response Status Code Log Send HTTP Request with invalid method Put instead of Post - ${resp}= Publish Event To VES Collector With Put Method No Auth ${VES_ANY_EVENT_PATH} ${evtdata} - Log Receive HTTP Status code ${resp.status_code} - Should Be Equal As Strings ${resp.status_code} 404 - + Send Request And Validate Response Publish Event To VES Collector With Put Method ${http_session} ${VES_ANY_EVENT_PATH} ${EVENT_DATA_FILE} 405 + Publish VES Event With Invalid URL Path [Tags] DCAE-VESC-R1 - [Documentation] Use invalid url path to expect 404 response - ${evtdata}= Get Data From File ${EVENT_DATA_FILE} + [Documentation] Post single event to invalid url path and expect 404 Response Status Code Log Send HTTP Request with invalid /listener/v5/ instead of /eventListener/v5 path - ${resp}= Publish Event To VES Collector No Auth /listener/v5/ ${evtdata} - Log Receive HTTP Status code ${resp.status_code} - Should Be Equal As Strings ${resp.status_code} 404 - -#Enable VESC HTTPS And Basic Auth - #[Tags] DCAE-VESC-R1 - #[Documentation] Enable VESC Https and Authentication, Disable Http and Run Health Check - #Enable VESC Https Auth - # - #${auth}= Create List ${VESC_HTTPS_USER} ${VESC_HTTPS_PD} - #${session}= Create Session dcaegen2-r1 ${VESC_URL_HTTPS} auth=${auth} disable_warnings=1 - #${headers}= Create Dictionary Accept=*/* X-FromAppId=${GLOBAL_APPLICATION_ID} - #${resp}= Get Request dcaegen2-r1 /healthcheck headers=${headers} - #Should Be Equal As Strings ${resp.status_code} 200 + Send Request And Validate Response Publish Event To VES Collector ${http_session} /listener/v5/ ${EVENT_DATA_FILE} 404 + +Publish PNF Registration Event + [Tags] DCAE-VESC-R1 + [Documentation] Post PNF registration event and expect 200 Response Status Code + Send Request And Validate Response Publish Event To VES Collector ${http_session} ${VES_ANY_EVENT_PATH} ${EVENT_PNF_REGISTRATION} 202 QTFCOC540002E-reg + +# Auth by certificate and basic auth username / password + +Enable VESC HTTPS with certBasicAuth + [Tags] DCAE-VESC-R1 + [Documentation] Enable VESC Https and Authentication and Run Health Check + Enable VESC with certBasicAuth + Run Healthcheck + +Healthcheck with Outdated Cert + [Tags] DCAE-VESC-R1 + [Documentation] Run healthcheck with outdated cert + ${uuid}= Generate UUID + ${headers}= Create Dictionary Accept=*/* X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID} + ${err_msg}= Run Keyword And Expect Error SSLError:* Get Request ${https_outdated_cert_session} /healthcheck headers=${headers} + Should Contain ${err_msg} certificate unknown + Log Recieved error message ${err_msg} Publish Single VES Fault Event Over HTTPS [Tags] DCAE-VESC-R1 - [Documentation] Post single event and expect 200 Response - ${evtdata}= Get Data From File ${EVENT_DATA_FILE} + [Documentation] Post single event with valid data to /eventListener/v5 endpoint over HTTPS and expect 202 Response Status Code Log Login User=${VESC_HTTPS_USER}, Pd=${VESC_HTTPS_PD} - ${resp}= Publish Event To VES Collector ${VES_ANY_EVENT_PATH} ${evtdata} - Log Receive HTTP Status code ${resp.status_code} - Should Be Equal As Strings ${resp.status_code} 200 - ${isEmpty}= Is Json Empty ${resp} - Run Keyword If '${isEmpty}' == False Log ${resp.json()} - ${ret}= DMaaP Message Receive ab305d54-85b4-a31b-7db2-fb6b9e546015 - Should Be Equal As Strings ${ret} true - + Send Request And Validate Response Publish Event To VES Collector ${https_basic_auth_session} ${VES_ANY_EVENT_PATH} ${EVENT_DATA_FILE} 202 ab305d54-85b4-a31b-7db2-fb6b9e546015 + Publish Single VES Measurement Event Over HTTPS [Tags] DCAE-VESC-R1 - [Documentation] Post single event and expect 200 Response - ${evtdata}= Get Data From File ${EVENT_MEASURE_FILE} - ${resp}= Publish Event To VES Collector ${VES_ANY_EVENT_PATH} ${evtdata} - Log Receive HTTP Status code ${resp.status_code} - Should Be Equal As Strings ${resp.status_code} 200 - ${isEmpty}= Is Json Empty ${resp} - Run Keyword If '${isEmpty}' == False Log ${resp.json()} - ${ret}= DMaaP Message Receive 0b2b5790-3673-480a-a4bd-5a00b88e5af6 - Should Be Equal As Strings ${ret} true + [Documentation] Post single measurement event with valid data to /eventListener/v5 endpoint over HTTPS and expect 202 Response Status Code + Send Request And Validate Response Publish Event To VES Collector ${https_basic_auth_session} ${VES_ANY_EVENT_PATH} ${EVENT_MEASURE_FILE} 202 0b2b5790-3673-480a-a4bd-5a00b88e5af6 Publish VES Fault Batch Events Over HTTPS [Tags] DCAE-VESC-R1 - [Documentation] Post batched events and expect 202 Response - ${evtdata}= Get Data From File ${EVENT_BATCH_DATA_FILE} - ${resp}= Publish Event To VES Collector ${VES_BATCH_EVENT_PATH} ${evtdata} - Should Be Equal As Strings ${resp.status_code} 200 - #${ret}= DMaaP Message Receive ab305d54-85b4-a31b-7db2-fb6b9e546016 - ${ret}= DMaaP Message Receive ab305d54-85b4-a31b-7db2-fb6b9e546025 - Should Be Equal As Strings ${ret} true + [Documentation] Post single event with valid data to /eventListener/v5/eventBatch endpoint over HTTPS and expect 202 Response Status Code + Send Request And Validate Response Publish Event To VES Collector ${https_basic_auth_session} ${VES_BATCH_EVENT_PATH} ${EVENT_BATCH_DATA_FILE} 202 ab305d54-85b4-a31b-7db2-fb6b9e546025 Publish VES Event With Invalid URL Path HTTPS [Tags] DCAE-VESC-R1 - [Documentation] Use invalid url path to expect 404 response - ${evtdata}= Get Data From File ${EVENT_DATA_FILE} + [Documentation] Post single event to invalid url path over HTTPS and expect 404 response Status Code Log Send HTTP Request with invalid /eventlistener/v5/ instead of /eventListener/v5 path - ${resp}= Publish Event To VES Collector /eventlistener/v5 ${evtdata} - Log Receive HTTP Status code ${resp.status_code} - Should Be Equal As Strings ${resp.status_code} 404 - -Publish PNF Registration Event - [Tags] DCAE-VESC-R1 - [Documentation] Post PNF registration event and expect 200 Response - ${evtdata}= Get Data From File ${EVENT_PNF_REGISTRATION} - ${resp}= Publish Event To VES Collector No Auth ${VES_ANY_EVENT_PATH} ${evtdata} - Log Receive HTTP Status code ${resp.status_code} - Should Be Equal As Strings ${resp.status_code} 200 - ${isEmpty}= Is Json Empty ${resp} - Run Keyword If '${isEmpty}' == False Log ${resp.json()} - ${ret}= DMaaP Message Receive QTFCOC540002E-reg - Should Be Equal As Strings ${ret} true -
\ No newline at end of file + Send Request And Validate Response Publish Event To VES Collector ${https_basic_auth_session} /eventlistener/v5 ${EVENT_DATA_FILE} 404 + +Publish Single VES VNF Measurement Event over HTTP + [Tags] DCAE-VESC-R1 + [Documentation] Post single event over HTTP with authentication enabled and expect 400 Response Status Code + Send Request And Validate Response Publish Event To VES Collector ${http_session} ${VES_EVENTLISTENER_V7} ${VES_VALID_JSON_V7} 400 + +Publish Single VES VNF Measurement Event with certBasicAuth over HTTPS + [Tags] DCAE-VESC-R1 + [Documentation] Post single event with valid data and valid username/password to /eventListener/v7 endpoint over HTTPS and expect 202 Response Status Code + Send Request And Validate Response Publish Event To VES Collector ${https_basic_auth_session} ${VES_EVENTLISTENER_V7} ${VES_VALID_JSON_V7} 202 ab305d54-85b4-a31b-7db2-fb6b9e546015 + +Publish Single VES VNF Measurement Event over HTTPS with wrong JSON + [Tags] DCAE-VESC-R1 + [Documentation] Post single event with invalid data and valid username/password to /eventListener/v7 endpoint over HTTPS and expect 400 Response Status Code + Send Request And Validate Response Publish Event To VES Collector ${https_basic_auth_session} ${VES_EVENTLISTENER_V7} ${VES_INVALID_JSON_V7} 400 + +Publish Single VES VNF Measurement Event With Wrong Auth + [Tags] DCAE-VESC-R1 + [Documentation] Post single event with valid data and invalid username/password to /eventListener/v7 endpoint over HTTPS and expect 401 Response Status Code + Send Request And Validate Response Publish Event To VES Collector ${https_wrong_auth_session} ${VES_EVENTLISTENER_V7} ${VES_VALID_JSON_V7} 401 + +Publish Single VES VNF Measurement Event With Cert + [Tags] DCAE-VESC-R1 + [Documentation] Post single event with valid data and valid certificate to /eventListener/v7 endpoint over HTTPS and expect 202 Response Status Code + Send Request And Validate Response Publish Event To VES Collector ${https_valid_cert_session} ${VES_EVENTLISTENER_V7} ${VES_VALID_JSON_V7} 202 ab305d54-85b4-a31b-7db2-fb6b9e546015 + +Publish Single VES VNF Measurement Event With Wrong Cert + [Tags] DCAE-VESC-R1 + [Documentation] Post single event with valid data and invalid certificate to /eventListener/v7 endpoint over HTTPS and expect SSLError with certificate unknown + @{err_content} Create List certificate unknown + Send Request And Expect Error Publish Event To VES Collector ${https_invalid_cert_session} ${VES_EVENTLISTENER_V7} ${VES_VALID_JSON_V7} SSLError:* @{err_content} + +Publish Single VES VNF Measurement Event With Outdated Cert + [Tags] DCAE-VESC-R1 + [Documentation] Post single event with valid data and outdated certificate to /eventListener/v7 endpoint over HTTPS and expect SSLError with certificate unknown + @{err_content} Create List certificate unknown + Send Request And Expect Error Publish Event To VES Collector ${https_outdated_cert_session} ${VES_EVENTLISTENER_V7} ${VES_VALID_JSON_V7} SSLError:* @{err_content} + +Publish Single VES VNF Measurement Event Without Auth And Cert + [Tags] DCAE-VESC-R1 + [Documentation] Post single event with valid data and without certificate or username/password to /eventListener/v7 endpoint over HTTPS and expect 401 Response Status Code + Send Request And Validate Response Publish Event To VES Collector ${https_no_cert_no_auth_session} ${VES_EVENTLISTENER_V7} ${VES_VALID_JSON_V7} 401 + +Publish V7 Batch Event with certBasicAuth over HTTPS + [Tags] DCAE-VESC-R1 + [Documentation] Post single event with valid data and valid username/password to /eventListener/v7/eventBatch endpoint over HTTPS and expect 202 Response Status Code + Send Request And Validate Response Publish Event To VES Collector ${https_basic_auth_session} ${VES_BATCH_EVENT_ENDPOINT_V7} ${VES_VALID_BATCH_JSON_V7} 202 Fault_Vscf:Acs-Ericcson_PilotNumberPoolExhaustion + +Publish V7 Batch Event With Wrong Auth + [Tags] DCAE-VESC-R1 + [Documentation] Post single event with valid data and invalid username/password to /eventListener/v7/eventBatch endpoint over HTTPS and expect 401 Response Status Code + Send Request And Validate Response Publish Event To VES Collector ${https_wrong_auth_session} ${VES_BATCH_EVENT_ENDPOINT_V7} ${VES_VALID_BATCH_JSON_V7} 401 + +Publish V7 Batch Event With Cert + [Tags] DCAE-VESC-R1 + [Documentation] Post single event with valid data and valid certificate to /eventListener/v7/eventBatch endpoint over HTTPS and expect 202 Response + Send Request And Validate Response Publish Event To VES Collector ${https_valid_cert_session} ${VES_BATCH_EVENT_ENDPOINT_V7} ${VES_VALID_BATCH_JSON_V7} 202 Fault_Vscf:Acs-Ericcson_PilotNumberPoolExhaustion + +Publish V7 Batch With Wrong Cert + [Tags] DCAE-VESC-R1 + [Documentation] Post single event with valid data and invalid certificate to /eventListener/v7/eventBatch endpoint over HTTPS and expect SSLError with certificate unknown + @{err_content} Create List certificate unknown + Send Request And Expect Error Publish Event To VES Collector ${https_invalid_cert_session} ${VES_BATCH_EVENT_ENDPOINT_V7} ${VES_VALID_BATCH_JSON_V7} SSLError:* @{err_content} + +Publish V7 Batch Event With Outdated Cert + [Tags] DCAE-VESC-R1 + [Documentation] Post single event with valid data and outdated certificate to /eventListener/v7/eventBatch endpoint over HTTPS and expect SSLError with certificate unknown + @{err_content} Create List certificate unknown + Send Request And Expect Error Publish Event To VES Collector ${https_outdated_cert_session} ${VES_BATCH_EVENT_ENDPOINT_V7} ${VES_VALID_BATCH_JSON_V7} SSLError:* @{err_content} + +Publish V7 Batch Event Without Auth And Cert + [Tags] DCAE-VESC-R1 + [Documentation] Post single event with valid data and without certificate or username/password to /eventListener/v7/eventBatch endpoint over HTTPS and expect 401 Response Status Code + Send Request And Validate Response Publish Event To VES Collector ${https_no_cert_no_auth_session} ${VES_BATCH_EVENT_ENDPOINT_V7} ${VES_VALID_BATCH_JSON_V7} 401 diff --git a/tests/dcaegen2/testcases/resources/CertsLibrary.py b/tests/dcaegen2/testcases/resources/CertsLibrary.py new file mode 100644 index 00000000..b8189422 --- /dev/null +++ b/tests/dcaegen2/testcases/resources/CertsLibrary.py @@ -0,0 +1,42 @@ + +import os +import subprocess +import time + +from robot.api import logger + + +class CertsLibrary(object): + + def __init__(self): + pass + + + + @staticmethod + def generate_certs(): + ws = os.environ['WORKSPACE'] + script2run = ws + "/tests/dcaegen2/testcases/resources/gen-certs.sh" + logger.info("Running script: " + script2run) + logger.console("Running script: " + script2run) + subprocess.call([script2run, ws]) + time.sleep(5) + return + + @staticmethod + def remove_certs(): + ws = os.environ['WORKSPACE'] + script2run = ws + "/tests/dcaegen2/testcases/resources/rm-certs.sh" + logger.info("Running script: " + script2run) + logger.console("Running script: " + script2run) + subprocess.call([script2run, ws]) + time.sleep(5) + return + + + + + + + + diff --git a/tests/dcaegen2/testcases/resources/DMaaP.py b/tests/dcaegen2/testcases/resources/DMaaP.py index 092b6081..779397e4 100644 --- a/tests/dcaegen2/testcases/resources/DMaaP.py +++ b/tests/dcaegen2/testcases/resources/DMaaP.py @@ -17,8 +17,6 @@ import jsonschema import json import DcaeVariables import SimpleHTTPServer -from robot.api import logger - try: from cStringIO import StringIO @@ -42,10 +40,6 @@ def enque_event(evt): if DcaeVariables.VESEventQ is not None: try: DcaeVariables.VESEventQ.put(evt) - if DcaeVariables.IsRobotRun: - logger.console("DMaaP Event enqued - size=" + str(len(evt))) - else: - print ("DMaaP Event enqueued - size=" + str(len(evt))) return True except Exception as e: print (str(e)) @@ -55,18 +49,14 @@ def enque_event(evt): def deque_event(wait_sec=25): if DcaeVariables.IsRobotRun: - logger.console("Enter DequeEvent") + pass try: evt = DcaeVariables.VESEventQ.get(True, wait_sec) - if DcaeVariables.IsRobotRun: - logger.console("DMaaP Event dequeued - size=" + str(len(evt))) - else: - print("DMaaP Event dequeued - size=" + str(len(evt))) return evt except Exception as e: if DcaeVariables.IsRobotRun: - logger.console(str(e)) - logger.console("DMaaP Event dequeue timeout") + pass + else: print("DMaaP Event dequeue timeout") return None @@ -79,7 +69,6 @@ class DMaaPHandler(BaseHTTPServer.BaseHTTPRequestHandler): return def do_POST(self): - resp_code = 0 # Parse the form data posted ''' @@ -120,12 +109,6 @@ class DMaaPHandler(BaseHTTPServer.BaseHTTPRequestHandler): content_len = int(self.headers.getheader('content-length', 0)) post_body = self.rfile.read(content_len) - if DcaeVariables.IsRobotRun: - logger.console("\n" + "DMaaP Receive Event:\n" + post_body) - else: - print("\n" + "DMaaP Receive Event:") - print (post_body) - indx = post_body.index("{") if indx != 0: post_body = post_body[indx:] @@ -168,7 +151,6 @@ class DMaaPHandler(BaseHTTPServer.BaseHTTPRequestHandler): self.send_response(200) self.send_header('Content-Type', 'application/json') self.end_headers() - # self.wfile.write("{'responses' : {'200' : {'description' : 'Success'}}}") self.wfile.write("{'count': 1, 'serverTimeMs': 3}") self.wfile.close() else: diff --git a/tests/dcaegen2/testcases/resources/DcaeLibrary.py b/tests/dcaegen2/testcases/resources/DcaeLibrary.py index d4188e30..6b96826c 100644 --- a/tests/dcaegen2/testcases/resources/DcaeLibrary.py +++ b/tests/dcaegen2/testcases/resources/DcaeLibrary.py @@ -64,7 +64,7 @@ class DcaeLibrary(object): return "false" @staticmethod - def enable_vesc_https_auth(): + def enable_vesc_with_certBasicAuth(): global client if 'Windows' in platform.system(): try: @@ -85,14 +85,13 @@ class DcaeLibrary(object): logger.console("Running script: " + script2run) subprocess.call(script2run) time.sleep(5) - return - + return + @staticmethod def dmaap_message_receive(evtobj, action='contain'): evt_str = DMaaP.deque_event() while evt_str != None: - logger.console("DMaaP receive VES Event:\n" + evt_str) if action == 'contain': if evtobj in evt_str: logger.info("DMaaP Receive Expected Publish Event:\n" + evt_str) diff --git a/tests/dcaegen2/testcases/resources/collector.properties b/tests/dcaegen2/testcases/resources/collector.properties index 1c5c8411..c555e485 100755 --- a/tests/dcaegen2/testcases/resources/collector.properties +++ b/tests/dcaegen2/testcases/resources/collector.properties @@ -11,64 +11,55 @@ ## Normally: ## ## - 8080 is http service -## - https is disabled by default (-1) +## - https is disabled by default ## ## - At this time, the server always binds to 0.0.0.0 ## -## The default port when header.authflag is disabled (0) -#collector.service.port=8080 +## +collector.service.port=8080 -## The secure port is required if header.authflag is set to 1 (true) ## Authentication is only supported via secure port ## When enabled - require valid keystore defined collector.service.secure.port=8443 +# auth.method flags: +# +# noAuth - default option - no security (http) +# certOnly - auth by certificate (https) +# basicAuth - auth by basic auth username and password (https) +# certBasicAuth - auth by certificate and basic auth username / password (https) +auth.method=certBasicAuth + +## Combination of userid,hashPassword encoded pwd list to be supported +## userid and pwd comma separated; pipe delimitation between each pair +## Password is generated by crypt-password library using BCrypt algorithm stored in dcaegen2/sdk package +## or https://nexus.onap.org/#nexus-search;quick~crypt-password +header.authlist=sample1,$2a$10$0buh.2WeYwN868YMwnNNEuNEAMNYVU9.FSMJGyIKV3dGET/7oGOi6 + ## The keystore must be setup per installation when secure port is configured -collector.keystore.file.location=../etc/keystore -collector.keystore.passwordfile=./etc/passwordfile -collector.keystore.alias=tomcat +collector.keystore.file.location=etc/keystore +collector.keystore.passwordfile=etc/passwordfile +collector.cert.subject.matcher=etc/certSubjectMatcher.properties -############################################################################### -## Processing -## -## If there's a problem that prevents the collector from processing alarms, -## it's normally better to apply back pressure to the caller than to try to -## buffer beyond a reasonable size limit. With a limit, the server won't crash -## due to being out of memory, and the caller will get a 5xx reply saying the -## server is in trouble. -collector.inputQueue.maxPending=8096 +## The truststore must be setup per installation when mutual tls support is configured +collector.truststore.file.location=etc/truststore +collector.truststore.passwordfile=etc/trustpasswordfile ## Schema Validation checkflag ## default no validation checkflag (-1) ## If enabled (1) - schemafile location must be specified collector.schema.checkflag=1 -collector.schema.file={\"v1\":\"./etc/CommonEventFormat_27.2.json\",\"v2\":\"./etc/CommonEventFormat_27.2.json\",\"v3\":\"./etc/CommonEventFormat_27.2.json\",\"v4\":\"./etc/CommonEventFormat_27.2.json\",\"v5\":\"./etc/CommonEventFormat_28.3.json\"} +collector.schema.file={\"v1\":\"./etc/CommonEventFormat_27.2.json\",\"v2\":\"./etc/CommonEventFormat_27.2.json\",\"v3\":\"./etc/CommonEventFormat_27.2.json\",\"v4\":\"./etc/CommonEventFormat_27.2.json\",\"v5\":\"./etc/CommonEventFormat_28.4.1.json\",\"v7\":\"./etc/CommonEventFormat_30.0.1.json\"} -## List all streamid per domain to be supported. The streamid should match to channel name on dmaapfile -collector.dmaap.streamid=fault=sec_fault|syslog=sec_syslog|heartbeat=sec_heartbeat|measurementsForVfScaling=sec_measurement|mobileFlow=sec_mobileflow|other=sec_other|stateChange=sec_statechange|thresholdCrossingAlert=sec_thresholdCrossingAlert|voiceQuality=ves_voicequality|sipSignaling=ves_sipsignaling +## List all streamid per domain to be supported. The streamid should match to channel name on dmaapfile +collector.dmaap.streamid=fault=ves-fault|syslog=ves-syslog|heartbeat=ves-heartbeat|measurementsForVfScaling=ves-measurement|mobileFlow=ves-mobileflow|other=ves-other|stateChange=ves-statechange|thresholdCrossingAlert=ves-thresholdCrossingAlert|voiceQuality=ves-voicequality|sipSignaling=ves-sipsignaling|notification=ves-notification|pnfRegistration=ves-pnfRegistration collector.dmaapfile=./etc/DmaapConfig.json -## Custom ExceptionConfiguration -exceptionConfig=./etc/ExceptionConfig.json - -## authflag control authentication by the collector -## If enabled (1) - then authlist has to be defined -## When authflag is enabled, only secure port will be supported -## To disable enter 0 -header.authflag=1 -## Combination of userid,base64 encoded pwd list to be supported -## userid and pwd comma separated; pipe delimitation between each pair -header.authlist=sample1,c2FtcGxlMQ==|vdnsagg,dmRuc2FnZw== - ## Event transformation Flag - when set expects configurable transformation ## defined under ./etc/eventTransform.json ## Enabled by default; to disable set to 0 event.transform.flag=0 -############################################################################### -## -## Tomcat control -## -#tomcat.maxthreads=(tomcat default, which is usually 200) - +# Describes at what frequency (measured in minutes) should application try to fetch config from CBS +collector.dynamic.config.update.frequency=5 diff --git a/tests/dcaegen2/testcases/resources/dcae_keywords.robot b/tests/dcaegen2/testcases/resources/dcae_keywords.robot index 013f6f03..0011ab88 100644 --- a/tests/dcaegen2/testcases/resources/dcae_keywords.robot +++ b/tests/dcaegen2/testcases/resources/dcae_keywords.robot @@ -1,23 +1,36 @@ *** Settings *** Documentation The main interface for interacting with DCAE. It handles low level stuff like managing the http request library and DCAE required fields Library RequestsLibrary -Library DcaeLibrary +Library DcaeLibrary Library OperatingSystem Library Collections +Library CertsLibrary Variables ../resources/DcaeVariables.py +Resource ../../../common.robot Resource ../resources/dcae_properties.robot -*** Variables *** -${DCAE_HEALTH_CHECK_BODY} %{WORKSPACE}/tests/dcae/testcases/assets/json_events/dcae_healthcheck.json - *** Keywords *** Create sessions [Documentation] Create all required sessions - Create Session dcae_vesc_url ${VESC_URL} - Set Suite Variable ${suite_dcae_vesc_url_session} dcae_vesc_url ${auth}= Create List ${VESC_HTTPS_USER} ${VESC_HTTPS_PD} + ${wrong_auth}= Create List ${VESC_HTTPS_WRONG_USER} ${VESC_HTTPS_WRONG_PD} + ${certs}= Create List ${VESC_CERT} ${VESC_KEY} + ${wrong_certs}= Create List ${VESC_WRONG_CERT} ${VESC_WRONG_KEY} + ${outdated_certs}= Create List ${VESC_OUTDATED_CERT} ${VESC_OUTDATED_KEY} + Create Session dcae_vesc_url ${VESC_URL} + Set Suite Variable ${http_session} dcae_vesc_url Create Session dcae_vesc_url_https ${VESC_URL_HTTPS} auth=${auth} disable_warnings=1 - Set Suite Variable ${suite_dcae_vesc_url_https_session} dcae_vesc_url_https + Set Suite Variable ${https_basic_auth_session} dcae_vesc_url_https + Create Session dcae_vesc_url_https_wrong_auth ${VESC_URL_HTTPS} auth=${wrong_auth} disable_warnings=1 + Set Suite Variable ${https_wrong_auth_session} dcae_vesc_url_https_wrong_auth + Create Client Cert Session dcae_vesc_url_https_cert ${VESC_URL_HTTPS} client_certs=${certs} disable_warnings=1 + Set Suite Variable ${https_valid_cert_session} dcae_vesc_url_https_cert + Create Client Cert Session dcae_vesc_url_https_wrong_cert ${VESC_URL_HTTPS} client_certs=${wrong_certs} disable_warnings=1 verify=${False} + Set Suite Variable ${https_invalid_cert_session} dcae_vesc_url_https_wrong_cert + Create Client Cert Session dcae_vesc_url_https_outdated_cert ${VESC_URL_HTTPS} client_certs=${outdated_certs} disable_warnings=1 verify=${False} + Set Suite Variable ${https_outdated_cert_session} dcae_vesc_url_https_outdated_cert + Create Session dcae_vesc_url_https_wo_auth ${VESC_URL_HTTPS} disable_warnings=1 + Set Suite Variable ${https_no_cert_no_auth_session} dcae_vesc_url_https_wo_auth Create header ${headers}= Create Dictionary Content-Type=application/json @@ -25,7 +38,6 @@ Create header Get DCAE Nodes [Documentation] Get DCAE Nodes from Consul Catalog - #Log Creating session ${GLOBAL_DCAE_CONSUL_URL} ${session}= Create Session dcae ${GLOBAL_DCAE_CONSUL_URL} ${uuid}= Generate UUID ${headers}= Create Dictionary Accept=application/json Content-Type=application/json X-Consul-Token=abcd1234 X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID} @@ -33,8 +45,8 @@ Get DCAE Nodes Log Received response from dcae consul: ${resp.json()} Should Be Equal As Strings ${resp.status_code} 200 ${NodeList}= Get Json Value List ${resp.text} Node - ${NodeListLength}= Get Length ${NodeList} - ${len}= Get Length ${NodeList} + ${NodeListLength}= Get Length ${NodeList} + ${len}= Get Length ${NodeList} Should Not Be Equal As Integers ${len} 0 [Return] ${NodeList} @@ -52,11 +64,10 @@ DCAE Node Health Check ${len}= Get Length ${StatusList} Should Not Be Equal As Integers ${len} 0 DCAE Check Health Status ${NodeName} ${StatusList[0]} Serf Health Status - #Run Keyword if ${len} > 1 DCAE Check Health Status ${NodeName} ${StatusList[1]} Serf Health Status DCAE Check Health Status [Arguments] ${NodeName} ${ItemStatus} ${CheckType} - Should Be Equal As Strings ${ItemStatus} passing + Should Be Equal As Strings ${ItemStatus} passing Log Node: ${NodeName} ${CheckType} check pass ok VES Collector Suite Setup DMaaP @@ -76,11 +87,11 @@ Check DCAE Results @{headers}= Get From Dictionary ${json['returns']} columns # Retrieve column names from headers ${columns}= Create List - :for ${header} in @{headers} + :for ${header} IN @{headers} \ ${colName}= Get From Dictionary ${header} colName \ Append To List ${columns} ${colName} # Process each row making sure status=GREEN - :for ${row} in @{rows} + :for ${row} IN @{rows} \ ${cells}= Get From Dictionary ${row} cells \ ${dict}= Make A Dictionary ${cells} ${columns} \ Dictionary Should Contain Item ${dict} healthTestStatus GREEN @@ -91,15 +102,15 @@ Make A Dictionary ${dict}= Create Dictionary ${collength}= Get Length ${columns} ${namelength}= Get Length ${names} - :for ${index} in range 0 ${collength} + :for ${index} IN RANGE 0 ${collength} \ ${name}= Evaluate ${names}[${index}] \ ${valued}= Evaluate ${columns}[${index}] \ ${value}= Get From Dictionary ${valued} ${valueName} - \ Set To Dictionary ${dict} ${name} ${value} + \ Set To Dictionary ${dict} ${name} ${value} [Return] ${dict} Json String To Dictionary - [Arguments] ${json_string} + [Arguments] ${json_string} ${json_dict}= evaluate json.loads('''${json_string}''') json [Return] ${json_dict} @@ -110,36 +121,53 @@ Dictionary To Json String Get DCAE Service Component Status [Documentation] Get the status of a DCAE Service Component - [Arguments] ${url} ${urlpath} ${usr} ${passwd} + [Arguments] ${url} ${urlpath} ${usr} ${passwd} ${auth}= Create List ${usr} ${passwd} ${session}= Create Session dcae-service-component ${url} auth=${auth} ${resp}= Get Request dcae-service-component ${urlpath} [Return] ${resp} -Publish Event To VES Collector No Auth - [Documentation] Send an event to VES Collector - [Arguments] ${evtpath} ${evtdata} - ${resp}= Post Request ${suite_dcae_vesc_url_session} ${evtpath} data=${evtdata} headers=${suite_headers} - #Log Received response from dcae ${resp.json()} - [Return] ${resp} - Publish Event To VES Collector [Documentation] Send an event to VES Collector - [Arguments] ${evtpath} ${evtdata} - ${resp}= Post Request ${suite_dcae_vesc_url_https_session} ${evtpath} data=${evtdata} headers=${suite_headers} - #Log Received response from dcae ${resp.json()} + [Arguments] ${session} ${evtpath} ${evtdata} + ${resp}= Post Request ${session} ${evtpath} data=${evtdata} headers=${suite_headers} [Return] ${resp} Publish Event To VES Collector With Put Method [Documentation] Send an event to VES Collector - [Arguments] ${evtpath} ${evtdata} - ${resp}= Put Request ${suite_dcae_vesc_url_https_session} ${evtpath} data=${evtdata} headers=${suite_headers} - #Log Received response from dcae ${resp.json()} + [Arguments] ${session} ${evtpath} ${evtdata} + ${resp}= Put Request ${session} ${evtpath} data=${evtdata} headers=${suite_headers} [Return] ${resp} -Publish Event To VES Collector With Put Method No Auth - [Documentation] Send an event to VES Collector - [Arguments] ${evtpath} ${evtdata} - ${resp}= Put Request ${suite_dcae_vesc_url_session} ${evtpath} data=${evtdata} headers=${suite_headers} - #Log Received response from dcae ${resp.json()} - [Return] ${resp} +Send Request And Validate Response + [Documentation] Post singel event to passed url with passed data and validate received response + [Arguments] ${keyword} ${session} ${evtpath} ${evtjson} ${resp_code} ${msg_code}=None + ${evtdata}= Get Data From File ${evtjson} + ${resp}= Run Keyword ${keyword} ${session} ${evtpath} ${evtdata} + Log Receive HTTPS Status code ${resp.status_code} + Should Be Equal As Strings ${resp.status_code} ${resp_code} + ${isEmpty}= Is Json Empty ${resp} + Run Keyword If '${isEmpty}' == False Log ${resp.json()} + Run Keyword If '${msg_code}' != 'None' Check Whether Message Received ${msg_code} + +Check Whether Message Received + [Documentation] Validare if message has been received + [Arguments] ${msg_code} + ${ret}= DMaaP Message Receive ${msg_code} + Should Be Equal As Strings ${ret} true + +Send Request And Expect Error + [Documentation] Post singel event to passed url with passed data and expect error + [Arguments] ${keyword} ${session} ${evtpath} ${evtjson} ${error_type} @{error_content} + ${evtdata}= Get Data From File ${evtjson} + ${err_msg}= Run Keyword And Expect Error ${error_type} ${keyword} ${session} ${evtpath} ${evtdata} + :FOR ${content} IN @{error_content} + \ Should Contain ${err_msg} ${content} + Log Recieved error message ${err_msg} + +Run Healthcheck + [Documentation] Run Healthcheck + ${uuid}= Generate UUID + ${headers}= Create Dictionary Accept=*/* X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID} + ${resp}= Get Request ${http_session} /healthcheck headers=${headers} + Should Be Equal As Strings ${resp.status_code} 200 diff --git a/tests/dcaegen2/testcases/resources/dcae_properties.robot b/tests/dcaegen2/testcases/resources/dcae_properties.robot index 135ff263..5262330b 100644 --- a/tests/dcaegen2/testcases/resources/dcae_properties.robot +++ b/tests/dcaegen2/testcases/resources/dcae_properties.robot @@ -4,11 +4,47 @@ Documentation store all properties that can change or are used in multipl ... make sure you prepend them with GLOBAL so that other files can easily see it is from this file. *** Variables *** -${GLOBAL_APPLICATION_ID} robot-dcaegen2 -${GLOBAL_DCAE_CONSUL_URL} http://135.205.228.129:8500 -${GLOBAL_DCAE_CONSUL_URL1} http://135.205.228.170:8500 -${GLOBAL_DCAE_VES_URL} http://localhost:8443/eventlistener/v5 -${GLOBAL_DCAE_USERNAME} console -${GLOBAL_DCAE_PASSWORD} ZjJkYjllMjljMTI2M2Iz -${VESC_HTTPS_USER} sample1 -${VESC_HTTPS_PD} sample1 + +${GLOBAL_APPLICATION_ID} robot-dcaegen2 +${GLOBAL_DCAE_CONSUL_URL} http://135.205.228.129:8500 +${GLOBAL_DCAE_CONSUL_URL1} http://135.205.228.170:8500 +${GLOBAL_DCAE_VES_URL} http://localhost:8443/eventlistener/v5 +${GLOBAL_DCAE_USERNAME} console +${GLOBAL_DCAE_PASSWORD} ZjJkYjllMjljMTI2M2Iz +${VESC_HTTPS_USER} sample1 +${VESC_HTTPS_PD} sample1 +${VESC_HTTPS_WRONG_PD} sample +${VESC_HTTPS_WRONG_USER} sample +${VESC_CERT} %{WORKSPACE}/tests/dcaegen2/testcases/assets/certs/temporary.crt +${VESC_KEY} %{WORKSPACE}/tests/dcaegen2/testcases/assets/certs/temporary.key +${VESC_WRONG_CERT} %{WORKSPACE}/tests/dcaegen2/testcases/assets/certs/wrong.crt +${VESC_WRONG_KEY} %{WORKSPACE}/tests/dcaegen2/testcases/assets/certs/wrong.key +${VESC_OUTDATED_CERT} %{WORKSPACE}/tests/dcaegen2/testcases/assets/certs/outdated.crt +${VESC_OUTDATED_KEY} %{WORKSPACE}/tests/dcaegen2/testcases/assets/certs/outdated.key + +${VESC_URL_HTTPS} https://%{VESC_IP}:8443 +${VESC_URL} http://%{VESC_IP}:8080 +${VES_ANY_EVENT_PATH} /eventListener/v5 +${VES_BATCH_EVENT_PATH} /eventListener/v5/eventBatch +${VES_THROTTLE_STATE_EVENT_PATH} /eventListener/v5/clientThrottlingState +${VES_EVENTLISTENER_V7} /eventListener/v7 +${VES_BATCH_EVENT_ENDPOINT_V7} /eventListener/v7/eventBatch +${VES_VALID_JSON_V7} %{WORKSPACE}/tests/dcaegen2/testcases/assets/json_events/ves7_valid.json +${VES_INVALID_JSON_V7} %{WORKSPACE}/tests/dcaegen2/testcases/assets/json_events/ves7_invalid.json +${VES_MISSING_MANDATORY_DOMAIN_V7} %{WORKSPACE}/tests/dcaegen2/testcases/assets/json_events/ves7_missing_mandatory_domain.json +${VES_VALID_BATCH_JSON_V7} %{WORKSPACE}/tests/dcaegen2/testcases/assets/json_events/ves7_batch_valid.json +${EVENT_DATA_FILE} %{WORKSPACE}/tests/dcaegen2/testcases/assets/json_events/ves_volte_single_fault_event.json +${EVENT_MEASURE_FILE} %{WORKSPACE}/tests/dcaegen2/testcases/assets/json_events/ves_vfirewall_measurement.json +${EVENT_DATA_FILE_BAD} %{WORKSPACE}/tests/dcaegen2/testcases/assets/json_events/ves_volte_single_fault_event_bad.json +${EVENT_BATCH_DATA_FILE} %{WORKSPACE}/tests/dcaegen2/testcases/assets/json_events/ves_volte_fault_eventlist_batch.json +${EVENT_THROTTLING_STATE_DATA_FILE} %{WORKSPACE}/tests/dcaegen2/testcases/assets/json_events/ves_volte_fault_provide_throttle_state.json +${EVENT_PNF_REGISTRATION} %{WORKSPACE}/tests/dcaegen2/testcases/assets/json_events/ves_pnf_registration_event.json +${DCAE_HEALTH_CHECK_BODY} %{WORKSPACE}/tests/dcae/testcases/assets/json_events/dcae_healthcheck.json + +#DCAE Health Check +${CONFIG_BINDING_URL} http://localhost:8443 +${CB_HEALTHCHECK_PATH} /healthcheck +${CB_SERVICE_COMPONENT_PATH} /service_component/ +${VES_Service_Name1} dcae-controller-ves-collector +${VES_Service_Name2} ves-collector-not-exist + diff --git a/tests/dcaegen2/testcases/resources/gen-certs.sh b/tests/dcaegen2/testcases/resources/gen-certs.sh new file mode 100755 index 00000000..f3f358f9 --- /dev/null +++ b/tests/dcaegen2/testcases/resources/gen-certs.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +WS=$1 +dir=$WS/tests/dcaegen2/testcases/assets/certs + +openssl genrsa -out "$dir/temporary.key" 2048 + +openssl req -new -key "$dir/temporary.key" -subj "/C=PL/ST=DL/O=Nokia/CN=dcaegen2" -out "$dir/temporary.csr" + +openssl x509 -req -in "$dir/temporary.csr" -CA "$dir/rootCA.crt" -CAkey "$dir/rootCA.key" -passin pass:collector -CAcreateserial -out "$dir/temporary.crt" -days 1 -sha256 diff --git a/tests/dcaegen2/testcases/resources/rm-certs.sh b/tests/dcaegen2/testcases/resources/rm-certs.sh new file mode 100755 index 00000000..827849c7 --- /dev/null +++ b/tests/dcaegen2/testcases/resources/rm-certs.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +WS=$1 +dir=$WS/tests/dcaegen2/testcases/assets/certs + +rm "$dir/temporary.crt" "$dir/temporary.csr" "$dir/temporary.key" "$dir/rootCA.srl"
\ No newline at end of file diff --git a/tests/dcaegen2/testcases/resources/vesc_enable_https_auth.sh b/tests/dcaegen2/testcases/resources/vesc_enable_https_auth.sh index 0755f077..29700bc5 100755 --- a/tests/dcaegen2/testcases/resources/vesc_enable_https_auth.sh +++ b/tests/dcaegen2/testcases/resources/vesc_enable_https_auth.sh @@ -14,10 +14,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -docker exec -it vesc /opt/app/VESCollector/bin/VESrestfulCollector.sh stop -sleep 2 +docker exec vesc /opt/app/VESCollector/bin/appController.sh stop +sleep 2 docker cp ${WORKSPACE}/tests/dcaegen2/testcases/resources/collector.properties vesc:/opt/app/VESCollector/etc -sleep 10 -docker exec -id vesc /opt/app/VESCollector/bin/VESrestfulCollector.sh start +sleep 10 +docker exec vesc /opt/app/VESCollector/bin/appController.sh start sleep 5 -echo "VES Collector Restarted" +echo "VES Collector Restarted with certBasicAuth" diff --git a/tests/policy/apex-pdp/apex-pdp-test.robot b/tests/policy/apex-pdp/apex-pdp-test.robot index dcdf2d80..9956731d 100644 --- a/tests/policy/apex-pdp/apex-pdp-test.robot +++ b/tests/policy/apex-pdp/apex-pdp-test.robot @@ -60,7 +60,7 @@ DeployOperationalPolicy Log Creating session https://${POLICY_PAP_IP}:6969 ${session}= Create Session policy https://${POLICY_PAP_IP}:6969 auth=${auth} ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${resp}= Post Request policy /policy/pap/v1/pdps data=${postjson} headers=${headers} + ${resp}= Post Request policy /policy/pap/v1/pdps/deployments/batch data=${postjson} headers=${headers} Log Received response from policy5 ${resp.text} ${postjsonobject} To Json ${postjson} Should Be Equal As Strings ${resp.status_code} 200 diff --git a/tests/policy/apex-pdp/data/pdp_update.json b/tests/policy/apex-pdp/data/pdp_update.json index ee485998..e880d5ed 100644 --- a/tests/policy/apex-pdp/data/pdp_update.json +++ b/tests/policy/apex-pdp/data/pdp_update.json @@ -2,110 +2,14 @@ "groups": [ { "name": "defaultGroup", - "description": "The default group that registers all supported policy types and pdps.", - "pdpGroupState": "ACTIVE", - "properties": {}, - "pdpSubgroups": [ + "deploymentSubgroups": [ { "pdpType": "apex", - "supportedPolicyTypes": [ - { - "name": "onap.policies.controlloop.operational.Apex", - "version": "1.0.0" - } - ], + "action": "POST", "policies": [{ "name": "onap.policies.controlloop.Operational.apex.sampledomain", "version": "1.0.0" - }], - "currentInstanceCount": 1, - "desiredInstanceCount": 1, - "properties": {}, - "pdpInstances": [] - }, - { - "pdpType": "drools", - "supportedPolicyTypes": [ - { - "name": "onap.policies.controlloop.Operational", - "version": "1.0.0" - } - ], - "policies": [], - "currentInstanceCount": 0, - "desiredInstanceCount": 1, - "properties": {}, - "pdpInstances": [] - }, - { - "pdpType": "xacml", - "supportedPolicyTypes": [ - { - "name": "onap.policies.controlloop.guard.FrequencyLimiter", - "version": "1.0.0" - }, - { - "name": "onap.policies.controlloop.guard.MinMax", - "version": "1.0.0" - }, - { - "name": "onap.policies.controlloop.guard.Blacklist", - "version": "1.0.0" - }, - { - "name": "onap.policies.controlloop.guard.coordination.FirstBlocksSecond", - "version": "1.0.0" - }, - { - "name": "onap.policies.monitoring.cdap.tca.hi.lo.app", - "version": "1.0.0" - }, - { - "name": "onap.policies.monitoring.dcaegen2.collectors.datafile.datafile-app-server", - "version": "1.0.0" - }, - { - "name": "onap.policies.optimization.AffinityPolicy", - "version": "1.0.0" - }, - { - "name": "onap.policies.optimization.DistancePolicy", - "version": "1.0.0" - }, - { - "name": "onap.policies.optimization.HpaPolicy", - "version": "1.0.0" - }, - { - "name": "onap.policies.optimization.OptimizationPolicy", - "version": "1.0.0" - }, - { - "name": "onap.policies.optimization.PciPolicy", - "version": "1.0.0" - }, - { - "name": "onap.policies.optimization.QueryPolicy", - "version": "1.0.0" - }, - { - "name": "onap.policies.optimization.SubscriberPolicy", - "version": "1.0.0" - }, - { - "name": "onap.policies.optimization.Vim_fit", - "version": "1.0.0" - }, - { - "name": "onap.policies.optimization.VnfPolicy", - "version": "1.0.0" - } - ], - "policies": [], - "currentInstanceCount": 0, - "desiredInstanceCount": 1, - "properties": {}, - "pdpInstances": [] + }] } ] } diff --git a/tests/policy/api/api-test.robot b/tests/policy/api/api-test.robot index 7f108d01..19aa18ab 100644 --- a/tests/policy/api/api-test.robot +++ b/tests/policy/api/api-test.robot @@ -7,7 +7,7 @@ Library json *** Test Cases *** Healthcheck [Documentation] Runs Policy Api Health check - ${auth}= Create List healthcheck zb!XztG34 + ${auth}= Create List healthcheck zb!XztG34 Log Creating session https://${POLICY_API_IP}:6969 ${session}= Create Session policy https://${POLICY_API_IP}:6969 auth=${auth} ${headers}= Create Dictionary Accept=application/json Content-Type=application/json @@ -18,7 +18,7 @@ Healthcheck Statistics [Documentation] Runs Policy Api Statistics - ${auth}= Create List healthcheck zb!XztG34 + ${auth}= Create List healthcheck zb!XztG34 Log Creating session https://${POLICY_API_IP}:6969 ${session}= Create Session policy https://${POLICY_API_IP}:6969 auth=${auth} ${headers}= Create Dictionary Accept=application/json Content-Type=application/json @@ -29,7 +29,7 @@ Statistics RetrievePolicyTypes [Documentation] Gets Policy Types - ${auth}= Create List healthcheck zb!XztG34 + ${auth}= Create List healthcheck zb!XztG34 Log Creating session https://${POLICY_API_IP}:6969 ${session}= Create Session policy https://${POLICY_API_IP}:6969 auth=${auth} ${headers}= Create Dictionary Accept=application/json Content-Type=application/json @@ -38,10 +38,21 @@ RetrievePolicyTypes Should Be Equal As Strings ${resp.status_code} 200 Should Be Equal As Strings ${resp.json()['version']} 1.0.0 -CreateTCAPolicyType - [Documentation] Create TCA Policy Type - ${auth}= Create List healthcheck zb!XztG34 - ${postjson}= Get file ${CURDIR}/data/onap.policy.monitoring.cdap.tca.hi.lo.app.json +CreateTCAPolicyTypeV1 + [Documentation] Create TCA Policy Type Version 1 + ${auth}= Create List healthcheck zb!XztG34 + ${postjson}= Get file ${CURDIR}/data/onap.policy.monitoring.cdap.tca.hi.lo.app.v1.json + Log Creating session https://${POLICY_API_IP}:6969 + ${session}= Create Session policy https://${POLICY_API_IP}:6969 auth=${auth} + ${headers}= Create Dictionary Accept=application/json Content-Type=application/json + ${resp}= Post Request policy /policy/api/v1/policytypes data=${postjson} headers=${headers} + Log Received response from policy ${resp.text} + Should Be Equal As Strings ${resp.status_code} 406 + +CreateTCAPolicyTypeV2 + [Documentation] Create TCA Policy Type Version 2 + ${auth}= Create List healthcheck zb!XztG34 + ${postjson}= Get file ${CURDIR}/data/onap.policy.monitoring.cdap.tca.hi.lo.app.v2.json Log Creating session https://${POLICY_API_IP}:6969 ${session}= Create Session policy https://${POLICY_API_IP}:6969 auth=${auth} ${headers}= Create Dictionary Accept=application/json Content-Type=application/json @@ -49,12 +60,12 @@ CreateTCAPolicyType Log Received response from policy ${resp.text} Should Be Equal As Strings ${resp.status_code} 200 ${postjsonobject} To Json ${postjson} - Dictionary Should Contain Key ${resp.json()} tosca_definitions_version - Dictionary Should Contain Key ${postjsonobject} tosca_definitions_version + Dictionary Should Contain Key ${resp.json()} tosca_definitions_version + Dictionary Should Contain Key ${postjsonobject} tosca_definitions_version RetrieveMonitoringPolicyTypes [Documentation] Retrieve Monitoring related Policy Types - ${auth}= Create List healthcheck zb!XztG34 + ${auth}= Create List healthcheck zb!XztG34 Log Creating session https://${POLICY_API_IP}:6969 ${session}= Create Session policy https://${POLICY_API_IP}:6969 auth=${auth} ${headers}= Create Dictionary Accept=application/json Content-Type=application/json @@ -64,10 +75,10 @@ RetrieveMonitoringPolicyTypes List Should Contain Value ${resp.json()['policy_types']} onap.policies.Monitoring -CreateNewMonitoringPolicy - [Documentation] Create a new Monitoring TCA policy - ${auth}= Create List healthcheck zb!XztG34 - ${postjson}= Get file ${CURDIR}/data/vCPE.policy.monitoring.input.tosca.json +CreateNewMonitoringPolicyV1 + [Documentation] Create a new Monitoring TCA policy version 1 + ${auth}= Create List healthcheck zb!XztG34 + ${postjson}= Get file ${CURDIR}/data/vCPE.policy.monitoring.input.tosca.v1.json Log Creating session https://${POLICY_API_IP}:6969 ${session}= Create Session policy https://${POLICY_API_IP}:6969 auth=${auth} ${headers}= Create Dictionary Accept=application/json Content-Type=application/json @@ -78,10 +89,21 @@ CreateNewMonitoringPolicy Dictionary Should Contain Key ${resp.json()['topology_template']['policies'][0]} onap.restart.tca Dictionary Should Contain Key ${postjsonobject['topology_template']['policies'][0]} onap.restart.tca -SimpleCreateNewMonitoringPolicy - [Documentation] Create a new Monitoring TCA policiy using simple endpoint - ${auth}= Create List healthcheck zb!XztG34 - ${postjson}= Get file ${CURDIR}/data/vCPE.policy.monitoring.input.tosca.json +SimpleCreateNewMonitoringPolicyV1 + [Documentation] Create a new Monitoring TCA policiy version 1 using simple endpoint + ${auth}= Create List healthcheck zb!XztG34 + ${postjson}= Get file ${CURDIR}/data/vCPE.policy.monitoring.input.tosca.v1.json + Log Creating session https://${POLICY_API_IP}:6969 + ${session}= Create Session policy https://${POLICY_API_IP}:6969 auth=${auth} + ${headers}= Create Dictionary Accept=application/json Content-Type=application/json + ${resp}= Post Request policy /policy/api/v1/policies data=${postjson} headers=${headers} + Log Received response from policy ${resp.text} + Should Be Equal As Strings ${resp.status_code} 406 + +SimpleCreateNewMonitoringPolicyV2 + [Documentation] Create a new Monitoring TCA policiy version 2 using simple endpoint + ${auth}= Create List healthcheck zb!XztG34 + ${postjson}= Get file ${CURDIR}/data/vCPE.policy.monitoring.input.tosca.v2.json Log Creating session https://${POLICY_API_IP}:6969 ${session}= Create Session policy https://${POLICY_API_IP}:6969 auth=${auth} ${headers}= Create Dictionary Accept=application/json Content-Type=application/json @@ -95,7 +117,7 @@ SimpleCreateNewMonitoringPolicy RetrievePoliciesOfType [Documentation] Retrieve all Policies Created for a specific Policy Type ${auth}= Create List healthcheck zb!XztG34 - ${expjson}= Get file ${CURDIR}/data/vCPE.policy.monitoring.input.tosca.json + ${expjson}= Get file ${CURDIR}/data/vCPE.policy.monitoring.input.tosca.v1.json Log Creating session https://${POLICY_API_IP}:6969 ${session}= Create Session policy https://${POLICY_API_IP}:6969 auth=${auth} ${headers}= Create Dictionary Accept=application/json Content-Type=application/json @@ -106,8 +128,8 @@ RetrievePoliciesOfType Dictionary Should Contain Key ${resp.json()['topology_template']['policies'][0]} onap.restart.tca Dictionary Should Contain Key ${expjsonobject['topology_template']['policies'][0]} onap.restart.tca -DeleteSpecificPolicy - [Documentation] Delete Policy of a Type +DeleteSpecificPolicyV1 + [Documentation] Delete the Monitoring Policy Version 1 of the TCA Policy Type ${auth}= Create List healthcheck zb!XztG34 Log Creating session https://${POLICY_API_IP}:6969 ${session}= Create Session policy https://${POLICY_API_IP}:6969 auth=${auth} @@ -117,3 +139,39 @@ DeleteSpecificPolicy Should Be Equal As Strings ${resp.status_code} 200 ${resp}= Delete Request policy /policy/api/v1/policytypes/onap.policies.monitoring.cdap.tca.hi.lo.app/versions/1.0.0/policies/onap.restart.tca/versions/1.0.0 headers=${headers} Should Be Equal As Strings ${resp.status_code} 404 + +DeleteSpecificPolicyV2 + [Documentation] Delete the Monitoring Policy Version 2 of the TCA Policy Type + ${auth}= Create List healthcheck zb!XztG34 + Log Creating session https://${POLICY_API_IP}:6969 + ${session}= Create Session policy https://${POLICY_API_IP}:6969 auth=${auth} + ${headers}= Create Dictionary Accept=application/json Content-Type=application/json + ${resp}= Delete Request policy /policy/api/v1/policytypes/onap.policies.monitoring.cdap.tca.hi.lo.app/versions/1.0.0/policies/onap.restart.tca/versions/2.0.0 headers=${headers} + Log Received response from policy ${resp.text} + Should Be Equal As Strings ${resp.status_code} 200 + ${resp}= Delete Request policy /policy/api/v1/policytypes/onap.policies.monitoring.cdap.tca.hi.lo.app/versions/1.0.0/policies/onap.restart.tca/versions/2.0.0 headers=${headers} + Should Be Equal As Strings ${resp.status_code} 404 + +DeleteSpecificPolicyTypeV1 + [Documentation] Delete the TCA Policy Type Version 1 + ${auth}= Create List healthcheck zb!XztG34 + Log Creating session https://${POLICY_API_IP}:6969 + ${session}= Create Session policy https://${POLICY_API_IP}:6969 auth=${auth} + ${headers}= Create Dictionary Accept=application/json Content-Type=application/json + ${resp}= Delete Request policy /policy/api/v1/policytypes/onap.policies.monitoring.cdap.tca.hi.lo.app/versions/1.0.0 headers=${headers} + Log Received response from policy ${resp.text} + Should Be Equal As Strings ${resp.status_code} 200 + ${resp}= Delete Request policy /policy/api/v1/policytypes/onap.policies.monitoring.cdap.tca.hi.lo.app/versions/1.0.0 headers=${headers} + Should Be Equal As Strings ${resp.status_code} 404 + +DeleteSpecificPolicyTypeV2 + [Documentation] Delete the TCA Policy Type Version 2 + ${auth}= Create List healthcheck zb!XztG34 + Log Creating session https://${POLICY_API_IP}:6969 + ${session}= Create Session policy https://${POLICY_API_IP}:6969 auth=${auth} + ${headers}= Create Dictionary Accept=application/json Content-Type=application/json + ${resp}= Delete Request policy /policy/api/v1/policytypes/onap.policies.monitoring.cdap.tca.hi.lo.app/versions/2.0.0 headers=${headers} + Log Received response from policy ${resp.text} + Should Be Equal As Strings ${resp.status_code} 200 + ${resp}= Delete Request policy /policy/api/v1/policytypes/onap.policies.monitoring.cdap.tca.hi.lo.app/versions/2.0.0 headers=${headers} + Should Be Equal As Strings ${resp.status_code} 404 diff --git a/tests/policy/api/data/onap.policy.monitoring.cdap.tca.hi.lo.app.json b/tests/policy/api/data/onap.policy.monitoring.cdap.tca.hi.lo.app.v1.json index f06247d7..f06247d7 100644 --- a/tests/policy/api/data/onap.policy.monitoring.cdap.tca.hi.lo.app.json +++ b/tests/policy/api/data/onap.policy.monitoring.cdap.tca.hi.lo.app.v1.json diff --git a/tests/policy/api/data/onap.policy.monitoring.cdap.tca.hi.lo.app.v2.json b/tests/policy/api/data/onap.policy.monitoring.cdap.tca.hi.lo.app.v2.json new file mode 100644 index 00000000..0076e829 --- /dev/null +++ b/tests/policy/api/data/onap.policy.monitoring.cdap.tca.hi.lo.app.v2.json @@ -0,0 +1,209 @@ +{ + "tosca_definitions_version": "tosca_simple_yaml_1_0_0", + "policy_types": { + "onap.policies.monitoring.cdap.tca.hi.lo.app": { + "derived_from": "onap.policies.Monitoring", + "version": "2.0.0", + "properties": { + "tca_policy": { + "type": "map", + "description": "TCA Policy JSON", + "entry_schema": { + "type": "onap.datatypes.monitoring.tca_policy" + } + } + } + } + }, + "data_types": { + "onap.datatypes.monitoring.metricsPerEventName": { + "derived_from": "tosca.datatypes.Root", + "properties": { + "controlLoopSchemaType": { + "type": "string", + "required": true, + "description": "Specifies Control Loop Schema Type for the event Name e.g. VNF, VM", + "constraints": [ + { + "valid_values": [ + "VM", + "VNF" + ] + } + ] + }, + "eventName": { + "type": "string", + "required": true, + "description": "Event name to which thresholds need to be applied" + }, + "policyName": { + "type": "string", + "required": true, + "description": "TCA Policy Scope Name" + }, + "policyScope": { + "type": "string", + "required": true, + "description": "TCA Policy Scope" + }, + "policyVersion": { + "type": "string", + "required": true, + "description": "TCA Policy Scope Version" + }, + "thresholds": { + "type": "list", + "required": true, + "description": "Thresholds associated with eventName", + "entry_schema": { + "type": "onap.datatypes.monitoring.thresholds" + } + } + } + }, + "onap.datatypes.monitoring.tca_policy": { + "derived_from": "tosca.datatypes.Root", + "properties": { + "domain": { + "type": "string", + "required": true, + "description": "Domain name to which TCA needs to be applied", + "default": "measurementsForVfScaling", + "constraints": [ + { + "equal": "measurementsForVfScaling" + } + ] + }, + "metricsPerEventName": { + "type": "list", + "required": true, + "description": "Contains eventName and threshold details that need to be applied to given eventName", + "entry_schema": { + "type": "onap.datatypes.monitoring.metricsPerEventName" + } + } + } + }, + "onap.datatypes.monitoring.thresholds": { + "derived_from": "tosca.datatypes.Root", + "properties": { + "closedLoopControlName": { + "type": "string", + "required": true, + "description": "Closed Loop Control Name associated with the threshold" + }, + "closedLoopEventStatus": { + "type": "string", + "required": true, + "description": "Closed Loop Event Status of the threshold", + "constraints": [ + { + "valid_values": [ + "ONSET", + "ABATED" + ] + } + ] + }, + "direction": { + "type": "string", + "required": true, + "description": "Direction of the threshold", + "constraints": [ + { + "valid_values": [ + "LESS", + "LESS_OR_EQUAL", + "GREATER", + "GREATER_OR_EQUAL", + "EQUAL" + ] + } + ] + }, + "fieldPath": { + "type": "string", + "required": true, + "description": "Json field Path as per CEF message which needs to be analyzed for TCA", + "constraints": [ + { + "valid_values": [ + "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedTotalPacketsDelta", + "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedOctetsDelta", + "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedUnicastPacketsDelta", + "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedMulticastPacketsDelta", + "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsDelta", + "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedDiscardedPacketsDelta", + "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedErrorPacketsDelta", + "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedTotalPacketsAccumulated", + "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedOctetsAccumulated", + "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedUnicastPacketsAccumulated", + "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedMulticastPacketsAccumulated", + "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsAccumulated", + "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedDiscardedPacketsAccumulated", + "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedErrorPacketsAccumulated", + "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedTotalPacketsDelta", + "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedOctetsDelta", + "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedUnicastPacketsDelta", + "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedMulticastPacketsDelta", + "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedBroadcastPacketsDelta", + "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedDiscardedPacketsDelta", + "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedErrorPacketsDelta", + "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedTotalPacketsAccumulated", + "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedOctetsAccumulated", + "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedUnicastPacketsAccumulated", + "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedMulticastPacketsAccumulated", + "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedBroadcastPacketsAccumulated", + "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedDiscardedPacketsAccumulated", + "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedErrorPacketsAccumulated", + "$.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuIdle", + "$.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageInterrupt", + "$.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageNice", + "$.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageSoftIrq", + "$.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageSteal", + "$.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageSystem", + "$.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuWait", + "$.event.measurementsForVfScalingFields.cpuUsageArray[*].percentUsage", + "$.event.measurementsForVfScalingFields.meanRequestLatency", + "$.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryBuffered", + "$.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryCached", + "$.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryConfigured", + "$.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryFree", + "$.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryUsed", + "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value" + ] + } + ] + }, + "severity": { + "type": "string", + "required": true, + "description": "Threshold Event Severity", + "constraints": [ + { + "valid_values": [ + "CRITICAL", + "MAJOR", + "MINOR", + "WARNING", + "NORMAL" + ] + } + ] + }, + "thresholdValue": { + "type": "integer", + "required": true, + "description": "Threshold value for the field Path inside CEF message" + }, + "version": { + "type": "string", + "required": true, + "description": "Version number associated with the threshold" + } + } + } + } +} diff --git a/tests/policy/api/data/vCPE.policy.monitoring.input.tosca.json b/tests/policy/api/data/vCPE.policy.monitoring.input.tosca.v1.json index a8ffe520..56bb18dd 100644 --- a/tests/policy/api/data/vCPE.policy.monitoring.input.tosca.json +++ b/tests/policy/api/data/vCPE.policy.monitoring.input.tosca.v1.json @@ -6,7 +6,7 @@ "onap.restart.tca": { "type": "onap.policies.monitoring.cdap.tca.hi.lo.app", "version": "1.0.0", - "type_version": "1.0.0", + "type_version": "1.0.0", "metadata": { "policy-id": "onap.restart.tca" }, diff --git a/tests/policy/api/data/vCPE.policy.monitoring.input.tosca.v2.json b/tests/policy/api/data/vCPE.policy.monitoring.input.tosca.v2.json new file mode 100644 index 00000000..371b9801 --- /dev/null +++ b/tests/policy/api/data/vCPE.policy.monitoring.input.tosca.v2.json @@ -0,0 +1,51 @@ +{ + "tosca_definitions_version": "tosca_simple_yaml_1_0_0", + "topology_template": { + "policies": [ + { + "onap.restart.tca": { + "type": "onap.policies.monitoring.cdap.tca.hi.lo.app", + "version": "2.0.0", + "type_version": "1.0.0", + "metadata": { + "policy-id": "onap.restart.tca" + }, + "properties": { + "tca_policy" : { + "domain": "measurementsForVfScaling", + "metricsPerEventName": [ + { + "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" + } + ] + } + ] + } + } + } + } + ] + } +} diff --git a/tests/policy/pap/data/create.group.request.json b/tests/policy/pap/data/create.group.request.json index b0937f7f..ea04c0e5 100644 --- a/tests/policy/pap/data/create.group.request.json +++ b/tests/policy/pap/data/create.group.request.json @@ -17,12 +17,7 @@ "version": "1.0.0" } ], - "policies": [ - { - "name": "onap.restart.tca", - "version": "1.0.0" - } - ] + "policies": [] }, { "pdpType": "pdpTypeB", diff --git a/tests/policy/pap/data/deploy.group.request.json b/tests/policy/pap/data/deploy.group.request.json new file mode 100644 index 00000000..7f3694de --- /dev/null +++ b/tests/policy/pap/data/deploy.group.request.json @@ -0,0 +1,19 @@ +{ + "groups": [ + { + "name": "create.group.request", + "deploymentSubgroups": [ + { + "pdpType": "pdpTypeA", + "action": "POST", + "policies": [ + { + "name": "onap.restart.tca", + "version": "1.0.0" + } + ] + } + ] + } + ] +} diff --git a/tests/policy/pap/pap-test.robot b/tests/policy/pap/pap-test.robot index f2dd61da..36b593c7 100644 --- a/tests/policy/pap/pap-test.robot +++ b/tests/policy/pap/pap-test.robot @@ -34,7 +34,7 @@ CreatePdpGroups ${postjson}= Get file ${CURDIR}/data/create.group.request.json ${session}= Create Session policy https://${POLICY_PAP_IP}:6969 auth=${auth} ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${resp}= Post Request policy /policy/pap/v1/pdps data=${postjson} headers=${headers} + ${resp}= Post Request policy /policy/pap/v1/pdps/groups/batch data=${postjson} headers=${headers} Log Received response from policy ${resp.text} Should Be Equal As Strings ${resp.status_code} 200 @@ -61,6 +61,17 @@ QueryPdpGroups Should Be Equal As Strings ${resp.json()['groups'][0]['pdpGroupState']} ACTIVE Should Be Equal As Strings ${resp.json()['groups'][1]['name']} defaultGroup +DeployPdpGroups + [Documentation] Runs Policy PAP Deploy Policies to PDP Groups + ${auth}= Create List healthcheck zb!XztG34 + Log Creating session https://${POLICY_PAP_IP}:6969 + ${postjson}= Get file ${CURDIR}/data/deploy.group.request.json + ${session}= Create Session policy https://${POLICY_PAP_IP}:6969 auth=${auth} + ${headers}= Create Dictionary Accept=application/json Content-Type=application/json + ${resp}= Post Request policy /policy/pap/v1/pdps/deployments/batch data=${postjson} headers=${headers} + Log Received response from policy ${resp.text} + Should Be Equal As Strings ${resp.status_code} 200 + UndeployPolicy [Documentation] Runs Policy PAP Undeploy a Policy from PDP Groups ${auth}= Create List healthcheck zb!XztG34 diff --git a/tests/policy/xacml-pdp/xacml-pdp-test.robot b/tests/policy/xacml-pdp/xacml-pdp-test.robot index 8227996f..0305af8e 100644 --- a/tests/policy/xacml-pdp/xacml-pdp-test.robot +++ b/tests/policy/xacml-pdp/xacml-pdp-test.robot @@ -28,7 +28,6 @@ Statistics Should Be Equal As Strings ${resp.json()['code']} 200 ExecuteXacmlPolicy - Wait Until Keyword Succeeds 2 min 5 sec CreateMonitorPolicyType Wait Until Keyword Succeeds 2 min 5 sec CreateNewMonitorPolicy Wait Until Keyword Succeeds 2 min 5 sec DeployMonitorPolicy Wait Until Keyword Succeeds 2 min 10 sec GetAbbreviatedDecisionResult @@ -36,20 +35,6 @@ ExecuteXacmlPolicy *** Keywords *** -CreateMonitorPolicyType - [Documentation] Create Monitoring Policy Type - ${auth}= Create List healthcheck zb!XztG34 - ${postjson}= Get file ${CURDIR}/data/onap.policies.monitoring.cdap.tca.hi.lo.app.json - Log Creating session https://${POLICY_API_IP}:6969 - ${session}= Create Session policy https://${POLICY_API_IP}:6969 auth=${auth} - ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${resp}= Post Request policy /policy/api/v1/policytypes data=${postjson} headers=${headers} - Log Received response from policy2 ${resp.text} - Should Be Equal As Strings ${resp.status_code} 200 - ${postjsonobject} To Json ${postjson} - Dictionary Should Contain Key ${resp.json()} tosca_definitions_version - Dictionary Should Contain Key ${postjsonobject} tosca_definitions_version - CreateNewMonitorPolicy [Documentation] Create a new Monitoring policy ${auth}= Create List healthcheck zb!XztG34 |