summaryrefslogtreecommitdiffstats
path: root/csit/tests
diff options
context:
space:
mode:
authorDan Timoney <dtimoney@att.com>2021-05-14 14:52:24 -0400
committerDan Timoney <dtimoney@att.com>2021-05-17 14:05:19 -0400
commit1ab7133b8e2fcbda0e4ac3f2e69790506b79b952 (patch)
tree9a7c0f64d2821377a24c115c6eeb96f30ee6e189 /csit/tests
parenta07e237412fc8b5fd7f1cc79909320a69a977306 (diff)
Add CSIT test cases to sdnc/oam repo
Refactored csit tests currently in integration/csit and moved them as part of sdnc/oam project so that we can trigger csit tests as part of our docker builds. Change-Id: I3acd25c7a6f1bc0ea9b2a2bd756cedc5fb2bf701 Issue-ID: SDNC-1545 Signed-off-by: Dan Timoney <dtimoney@att.com> Former-commit-id: 16a6e0ea52a4a681ed2799612e310c867e720a61
Diffstat (limited to 'csit/tests')
-rw-r--r--csit/tests/sdnc/__init__.robot2
-rw-r--r--csit/tests/sdnc/csr/netconf_pnp_simulator_csr.env17
-rw-r--r--csit/tests/sdnc/csr/sdnc_csr.env17
-rw-r--r--csit/tests/sdnc/resources/sdnc-keywords.robot61
-rw-r--r--csit/tests/sdnc/resources/sdnc-properties.robot15
-rw-r--r--csit/tests/sdnc/sdnc_csit.robot30
6 files changed, 142 insertions, 0 deletions
diff --git a/csit/tests/sdnc/__init__.robot b/csit/tests/sdnc/__init__.robot
new file mode 100644
index 00000000..d7353060
--- /dev/null
+++ b/csit/tests/sdnc/__init__.robot
@@ -0,0 +1,2 @@
+1 *** Settings ***
+2 Documentation SDNC - keystorecheck
diff --git a/csit/tests/sdnc/csr/netconf_pnp_simulator_csr.env b/csit/tests/sdnc/csr/netconf_pnp_simulator_csr.env
new file mode 100644
index 00000000..e85ab6cc
--- /dev/null
+++ b/csit/tests/sdnc/csr/netconf_pnp_simulator_csr.env
@@ -0,0 +1,17 @@
+#Client Envs
+REQUEST_TIMEOUT=30000
+OUTPUT_PATH=/var/certs
+CA_NAME=RA
+OUTPUT_TYPE=P12
+KEYSTORE_PATH=/etc/onap/aaf/certservice/certs/certServiceClient-keystore.jks
+KEYSTORE_PASSWORD=secret
+TRUSTSTORE_PATH=/etc/onap/aaf/certservice/certs/truststore.jks
+TRUSTSTORE_PASSWORD=secret
+#CSR Config Envs
+COMMON_NAME=netconf.pnp.simulator.onap.org
+ORGANIZATION=Linux-Foundation
+ORGANIZATION_UNIT=ONAP
+LOCATION=San-Francisco
+STATE=California
+COUNTRY=US
+SANS=netconf.com:netconfsimulator.com
diff --git a/csit/tests/sdnc/csr/sdnc_csr.env b/csit/tests/sdnc/csr/sdnc_csr.env
new file mode 100644
index 00000000..5d647de6
--- /dev/null
+++ b/csit/tests/sdnc/csr/sdnc_csr.env
@@ -0,0 +1,17 @@
+#Client CSR
+REQUEST_TIMEOUT=30000
+OUTPUT_PATH=/var/certs
+CA_NAME=RA
+OUTPUT_TYPE=PEM
+KEYSTORE_PATH=/etc/onap/aaf/certservice/certs/certServiceClient-keystore.jks
+KEYSTORE_PASSWORD=secret
+TRUSTSTORE_PATH=/etc/onap/aaf/certservice/certs/truststore.jks
+TRUSTSTORE_PASSWORD=secret
+#CSR Config Envs
+COMMON_NAME=sdnc.onap.org
+ORGANIZATION=Linux-Foundation
+ORGANIZATION_UNIT=ONAP
+LOCATION=San-Francisco
+STATE=California
+COUNTRY=US
+SANS=example.com:sample.com \ No newline at end of file
diff --git a/csit/tests/sdnc/resources/sdnc-keywords.robot b/csit/tests/sdnc/resources/sdnc-keywords.robot
new file mode 100644
index 00000000..7a3df839
--- /dev/null
+++ b/csit/tests/sdnc/resources/sdnc-keywords.robot
@@ -0,0 +1,61 @@
+*** Settings ***
+
+Resource ./sdnc-properties.robot
+
+Library Collections
+Library RequestsLibrary
+Library OperatingSystem
+
+
+*** Keywords ***
+
+Create SDNC RESTCONF Session
+ [Documentation] Create session to OpenDaylight controller
+ ${auth}= Create List ${ODL_USER} ${ODL_PASSWORD}
+ Create Session sdnc_restconf ${SDNC_RESTCONF_URL} auth=${auth}
+
+Send Post Request And Validate Response
+ [Documentation] Send POST request to passed URL and validate received response
+ [Arguments] ${path} ${body} ${resp_code}
+ Create SDNC RESTCONF Session
+ &{headers}= Create Dictionary Authorization=Basic YWRtaW46S3A4Yko0U1hzek0wV1hsaGFrM2VIbGNzZTJnQXc4NHZhb0dHbUp2VXkyVQ== Content-Type=application/json Accept=application/json
+ ${resp}= POST On Session sdnc_restconf ${path} headers=${headers} json=${body} expected_status=${resp_code}
+
+Send Empty Post Request And Validate Response
+ [Documentation] Send POST request to passed URL and validate received response
+ [Arguments] ${path} ${resp_code}
+ Create SDNC RESTCONF Session
+ &{headers}= Create Dictionary Content-Type=application/json Content-Length=0 Accept=application/json
+ ${resp}= POST On Session sdnc_restconf ${path} headers=${headers} expected_status=${resp_code}
+
+Send Get Request And Validate Response Sdnc
+ [Documentation] Send request to passed url and validate received response
+ [Arguments] ${path} ${resp_code}
+ CREATE SDNC RESTCONF Session
+ &{headers}= Create Dictionary Content-Type=application/json Accept=application/json
+ ${resp}= GET On Session sdnc_restconf ${path} headers=${headers} expected_status=${resp_code}
+
+Send Get Request And Validate TLS Connection Response
+ [Documentation] Send request to passed url and validate received response
+ [Arguments] ${path} ${resp_code}
+ Create SDNC RESTCONF Session
+ ${mount}= Get File ${REQUEST_DATA_PATH}${/}mount.xml
+ &{headers}= Create Dictionary Content-Type=application/xml Accept=application/xml
+ ${resp}= PUT On Session sdnc_restconf ${path} data=${mount} headers=${headers} expected_status=201
+ Sleep 30
+ &{headers1}= Create Dictionary Content-Type=application/json Accept=application/json
+ ${resp1}= GET On Session sdnc_restconf ${PNFSIM_MOUNT_PATH} headers=${headers1} expected_status=${resp_code}
+
+
+Send Delete Request And Validate PNF Mount Deleted
+ [Documentation] Send request to passed url and validate received response
+ [Arguments] ${path} ${resp_code}
+ Create SDNC RESTCONF Session
+ ${mount}= Get File ${REQUEST_DATA_PATH}${/}mount.xml
+ &{headers}= Create Dictionary Content-Type=application/json Accept=application/json
+ ${deleteresponse}= DELETE On Session sdnc_restconf ${path} data=${mount} headers=${headers} expected_status=${resp_code}
+ Sleep 30
+ ${del_topology}= DELETE On Session sdnc_restconf ${SDNC_NETWORK_TOPOLOGY} expected_status=${resp_code}
+ ${del_keystore}= DELETE On Session sdnc_restconf ${SDNC_KEYSTORE_CONFIG_PATH}
+
+
diff --git a/csit/tests/sdnc/resources/sdnc-properties.robot b/csit/tests/sdnc/resources/sdnc-properties.robot
new file mode 100644
index 00000000..bb618eb0
--- /dev/null
+++ b/csit/tests/sdnc/resources/sdnc-properties.robot
@@ -0,0 +1,15 @@
+*** Variables ***
+
+# SDNC Configuration
+${ODL_USER} %{ODL_USER}
+${ODL_PASSWORD} %{ODL_PASSWORD}
+${REQUEST_DATA_PATH} %{REQUEST_DATA_PATH}
+${SDNC_CONTAINER_NAME} %{SDNC_CONTAINER_NAME}
+${SDNC_RESTCONF_URL} http://localhost:8282/restconf
+${SDNC_HEALTHCHECK} /operations/SLI-API:healthcheck/
+${SDNC_KEYSTORE_CONFIG_PATH} /config/netconf-keystore:keystore
+${SDNC_NETWORK_TOPOLOGY} /config/network-topology:network-topology
+${SDNC_MOUNT_PATH} /config/network-topology:network-topology/topology/topology-netconf/node/PNFDemo
+${PNFSIM_MOUNT_PATH} /config/network-topology:network-topology/topology/topology-netconf/node/PNFDemo/yang-ext:mount/turing-machine:turing-machine
+
+
diff --git a/csit/tests/sdnc/sdnc_csit.robot b/csit/tests/sdnc/sdnc_csit.robot
new file mode 100644
index 00000000..bd1479a6
--- /dev/null
+++ b/csit/tests/sdnc/sdnc_csit.robot
@@ -0,0 +1,30 @@
+*** Settings ***
+
+Documentation SDNC, Netconf-Pnp-Simulator E2E Test Case Scenarios
+
+Library RequestsLibrary
+Resource ./resources/sdnc-keywords.robot
+
+
+*** Test Cases ***
+Check SDNC health
+ [Tags] SDNC-healthcheck
+ [Documentation] Sending healthcheck
+ Send Empty Post Request And Validate Response ${SDNC_HEALTHCHECK} 200
+
+Check SDNC Keystore For PNF Simulator Certificates
+ [Tags] SDNC-PNFSIM-CERT-DEPLOYMENT
+ [Documentation] Checking Keystore after SDNC installation
+ Send Get Request And Validate Response Sdnc ${SDNC_KEYSTORE_CONFIG_PATH} 200
+
+
+Check SDNC NETCONF/TLS Connection to PNF Simulator
+ [Tags] SDNC-PNFSIM-TLS-CONNECTION-CHECK
+ [Documentation] Checking NETCONF/TLS connection to PNF Simulator
+ Send Get Request And Validate TLS Connection Response ${SDNC_MOUNT_PATH} 200
+
+Check Dropping NETCONF/TLS Connection
+ [Tags] SDNC-PNFSIM-TLS-DISCONNECT-CHECK
+ [Documentation] Checking PNF Simulator Mount Delete from SDNC
+ Send Delete Request And Validate PNF Mount Deleted ${SDNC_MOUNT_PATH} 200
+