aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/integration/nfsimulator/netconf-server/assets/pnf-simulator-data.xml4
-rw-r--r--tests/integration/nfsimulator/netconf-server/netconf-server-rest-test.robot21
-rw-r--r--tests/integration/nfsimulator/netconf-server/resources/netconf-server-keywords.robot34
-rw-r--r--tests/integration/nfsimulator/netconf-server/resources/netconf-server-properties.robot1
4 files changed, 46 insertions, 14 deletions
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
index 00000000..ff4879e5
--- /dev/null
+++ b/tests/integration/nfsimulator/netconf-server/assets/pnf-simulator-data.xml
@@ -0,0 +1,4 @@
+<config xmlns="http://onap.org/pnf-simulator">
+ <itemValue1>42</itemValue1>
+ <itemValue2>35</itemValue2>
+</config>
diff --git a/tests/integration/nfsimulator/netconf-server/netconf-server-rest-test.robot b/tests/integration/nfsimulator/netconf-server/netconf-server-rest-test.robot
index 0d3ebdec..fea34b43 100644
--- a/tests/integration/nfsimulator/netconf-server/netconf-server-rest-test.robot
+++ b/tests/integration/nfsimulator/netconf-server/netconf-server-rest-test.robot
@@ -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
+
+
diff --git a/tests/integration/nfsimulator/netconf-server/resources/netconf-server-keywords.robot b/tests/integration/nfsimulator/netconf-server/resources/netconf-server-keywords.robot
index fd54487a..9dccd048 100644
--- a/tests/integration/nfsimulator/netconf-server/resources/netconf-server-keywords.robot
+++ b/tests/integration/nfsimulator/netconf-server/resources/netconf-server-keywords.robot
@@ -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'}]
diff --git a/tests/integration/nfsimulator/netconf-server/resources/netconf-server-properties.robot b/tests/integration/nfsimulator/netconf-server/resources/netconf-server-properties.robot
index 3903da7d..c10fe24c 100644
--- a/tests/integration/nfsimulator/netconf-server/resources/netconf-server-properties.robot
+++ b/tests/integration/nfsimulator/netconf-server/resources/netconf-server-properties.robot
@@ -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