Add CSIT for Kafka 77/120077/3
authorBogumil Zebek <bogumil.zebek@nokia.com>
Thu, 1 Apr 2021 06:04:53 +0000 (08:04 +0200)
committerZebek Bogumil <bogumil.zebek@nokia.com>
Thu, 1 Apr 2021 11:55:28 +0000 (13:55 +0200)
Change-Id: I13417a8a5e56784762fdb5f474d737b776ba132f
Issue-ID: INT-1869
Signed-off-by: Zebek Bogumil <bogumil.zebek@nokia.com>
scripts/integration/nfsimulator/netconf-server/docker-compose.yml
tests/integration/nfsimulator/netconf-server/assets/pnf-simulator-data.xml [new file with mode: 0644]
tests/integration/nfsimulator/netconf-server/netconf-server-rest-test.robot
tests/integration/nfsimulator/netconf-server/resources/netconf-server-keywords.robot
tests/integration/nfsimulator/netconf-server/resources/netconf-server-properties.robot

diff --git a/tests/integration/nfsimulator/netconf-server/assets/pnf-simulator-data.xml b/tests/integration/nfsimulator/netconf-server/assets/pnf-simulator-data.xml
new file mode 100644 (file)
index 0000000..ff4879e
--- /dev/null
@@ -0,0 +1,4 @@
+<config xmlns="http://onap.org/pnf-simulator">
+  <itemValue1>42</itemValue1>
+  <itemValue2>35</itemValue2>
+</config>
index 0d3ebde..fea34b4 100644 (file)
@@ -6,12 +6,21 @@ Resource          ./resources/netconf-server-keywords.robot
 
 *** Test Cases ***
 
-Netconf Server Rest API Health Check
+Netconf Server Healthy Check
     [Tags]      Netconf-Server
-    [Documentation]   Run healthcheck
-    Run Healthcheck
+    [Documentation]   Server Should be healthy
+    Verify That Server Is Healthy
 
-Netconf Server Rest API Readiness Check
+Netconf Server Readiness Check
     [Tags]      Netconf-Server
-    [Documentation]   Run readiness
-    Run Readiness 
\ No newline at end of file
+    [Documentation]   Server Should be ready
+    Verify That Server Is Ready
+
+Netconf Module Configuration Update
+    [Tags]      Netconf-Server
+    [Documentation]   Update Should Be Distributed
+    Update NetConf Module Configuration  pnf-simulator  ${PNF_SIMULATOR_DATA_XML}  202
+    Sleep   20s     Wait for message distribution in Kafka
+    Verify That Change Is Available In NetConf Module Change Configuration History  200
+
+
index fd54487..9dccd04 100644 (file)
@@ -1,21 +1,39 @@
 *** Settings ***
-Library              RequestsLibrary
+Library           RequestsLibrary
+Resource          ../../../../common.robot
 Resource          ./netconf-server-properties.robot
 
 *** Keywords ***
 
-Run Healthcheck
-    [Documentation]  Run Healthcheck
+Verify That Server Is Healthy
+    [Documentation]  Verify that server is healthy
     Create Session    netconf_server_session    ${NETCONF_SERVER_URL}
     ${resp}=  GET On Session  netconf_server_session  /healthcheck
-    Should Be Equal As Strings         ${resp.status_code}  200
+    Should Be Equal As Strings  ${resp.status_code}  200
     Should Be Equal As Strings  ${resp.text}  UP
 
-Run Readiness 
-    [Documentation]  Run Readiness
+Verify That Server Is Ready
+    [Documentation]  Verify that server is ready
     Create Session    netconf_server_session    ${NETCONF_SERVER_URL}
-    ${resp}=  GET On Session  netconf_server_session  /readiness 
-    Should Be Equal As Strings         ${resp.status_code}  200
+    ${resp}=  GET On Session  netconf_server_session  /readiness
+    Should Be Equal As Strings  ${resp.status_code}  200
     Should Be Equal As Strings  ${resp.text}  Ready
 
+Update NetConf Module Configuration
+    [Documentation]  Update module configuration
+    [Arguments]   ${module}  ${path_to_data}  ${resp_code}
+    ${data}=  Get Data From File  ${path_to_data}
 
+    Create Session    netconf_server_session    ${NETCONF_SERVER_URL}
+    ${resp}=    POST On Session    netconf_server_session    /change_config/${module}   data=${data}
+    Should Be Equal As Strings    ${resp.status_code}    ${resp_code}
+
+Verify That Change Is Available In NetConf Module Change Configuration History
+    [Documentation]  Verify that configuration was distributed to Kafka
+    [Arguments]   ${resp_code}
+
+    Create Session    netconf_server_session    ${NETCONF_SERVER_URL}
+    ${resp}=    GET On Session    netconf_server_session    /change_history
+    Should Be Equal As Strings    ${resp.status_code}    ${resp_code}
+    ${actual_data}=  Convert To String  ${resp.json()}
+    Should Be Equal  ${actual_data}  [{u'new': {u'path': u'/pnf-simulator:config/itemValue1', u'value': 42}, u'type': u'ChangeCreated'}, {u'new': {u'path': u'/pnf-simulator:config/itemValue2', u'value': 35}, u'type': u'ChangeCreated'}]
index 3903da7..c10fe24 100644 (file)
@@ -1,3 +1,4 @@
 *** Variables ***
 
 ${NETCONF_SERVER_URL}                           http://%{NETCONF_SERVER_IP}:%{NETCONF_SERVER_REST_PORT}
+${PNF_SIMULATOR_DATA_XML}                     %{WORKSPACE}/tests/integration/nfsimulator/netconf-server/assets/pnf-simulator-data.xml