INTTEST-70 : Fix JsonRpc test 14/87714/7
authorRichard Kosegi <richard.kosegi@gmail.com>
Fri, 14 Feb 2020 13:31:58 +0000 (14:31 +0100)
committerRichard Kosegi <richard.kosegi@gmail.com>
Mon, 17 Feb 2020 21:45:39 +0000 (22:45 +0100)
Basic suite of JSONRPC was assuming presence of ietf-interfaces
YANG model in global schema context. This is no longer case for some time.
Instead, test service should depend on YANG model provided by JSONRPC,
such as jsonrpc-config.

Signed-off-by: Richard Kosegi <richard.kosegi@gmail.com>
Change-Id: Iac960d771cdff4a9dc814751ad3094f9320fcbc2

csit/libraries/JsonrpcKeywords.robot
csit/suites/jsonrpc/010-mdsal-jsonrpc-basic.robot
csit/variables/jsonrpc/JsonrpcVariables.robot
csit/variables/jsonrpc/interfaces_data.json [deleted file]
csit/variables/jsonrpc/interfaces_module.json [deleted file]
csit/variables/jsonrpc/jsonrpcconfig_data.json [new file with mode: 0644]
csit/variables/jsonrpc/jsonrpcconfig_module.json [new file with mode: 0644]
csit/variables/jsonrpc/odl-jsonrpc-test-read
csit/variables/jsonrpc/readservice_peer_payload.json

index d8bd1dbb513f583d58ad958ed999d42b631c399c..5eedc9047c5eddfcccb8db29b955d2e6d6c36f9f 100644 (file)
@@ -27,8 +27,8 @@ Run Read Service Python Script on Controller Vm
     ${stdout}    ${stderr}    ${rc}=    SSHLibrary.Execute Command    sudo pip install zmq pyzmq    return_stdout=True    return_stderr=True
     ...    return_rc=True
     Log    ${stdout}
-    ${module}    OperatingSystem.Get File    ${INTERFACES_MODULE_JSON}
-    ${data}    OperatingSystem.Get File    ${INTERFACES_DATA_JSON}
+    ${module}    OperatingSystem.Get File    ${JSONRPCCONFIG_MODULE_JSON}
+    ${data}    OperatingSystem.Get File    ${JSONRPCCONFIG_DATA_JSON}
     ${cmd}    Builtin.Set Variable    nohup python ${WORKSPACE}/${BUNDLEFOLDER}/odl-jsonrpc-test-read tcp://0.0.0.0:${DEFAULT_PORT} 'config' ${DEFAULT_ENDPOINT} '${module}' '${data}'
     Log    ${cmd}
     ${stdout}    SSHLibrary.Write    echo | rm -rf nohup.out
@@ -53,10 +53,9 @@ Verify Data On Mounted Endpoint
     ${resp}    ClusterManagement.Get_From_Member    ${READ_SERVICE_PEER_GET_1}${endpoint}${READ_SERVICE_PEER_GET_2}    ${controller_index}
     ${response_json}    Builtin.Convert To String    ${resp}
     Log    ${response_json}
-    Verify Restconf Get On Mounted Endpoint    ${response_json}    ${READSERVICE_NAME}    ${INTERFACE_MODULE_DEFAULT_DATA}
+    Verify Restconf Get On Mounted Endpoint    ${response_json}    ${READSERVICE_NAME}
 
 Verify Restconf Get On Mounted Endpoint
-    [Arguments]    ${output}    ${name}    ${type}
+    [Arguments]    ${output}    ${name}
     [Documentation]    This keyword parses restconf get of mountpoint
     Builtin.Should Match Regexp    ${output}    "name":"${name}"
-    Builtin.Should Match Regexp    ${output}    "type":"${type}"
index 93bcdfdf1ed57509a2c794f242a34615edecf6b4..d0410a1f4d95a59076496ade7f9800749024a886 100644 (file)
@@ -5,11 +5,14 @@ Suite Teardown    Delete All Sessions
 Library           OperatingSystem
 Library           DateTime
 Resource          ../../libraries/JsonrpcKeywords.robot
+Resource          ../../libraries/KarafKeywords.robot
 
 *** Test Cases ***
 Push MDSAL data and Verify Through Restconf
     [Documentation]    Push data using python utility and verify using restconf
     [Tags]    Basic data
+    KarafKeywords.Setup_Karaf_Keywords
+    KarafKeywords.Execute_Controller_Karaf_Command_On_Background    log:set DEBUG org.opendaylight.jsonrpc
     JsonrpcKeywords.Mount Read Service Endpoint
     JsonrpcKeywords.Run Read Service Python Script on Controller Vm
     JsonrpcKeywords.Verify Data On Mounted Endpoint
index 12ee61874b9fd4985db5551bc3efaefee09149b4..bcd2b4a54658cb2e7306edd2508ca1a841d03037 100644 (file)
@@ -2,18 +2,17 @@
 Documentation     Resource consisting purely of variable definitions useful for multiple project suites.
 
 *** Variables ***
-${INTERFACES_MODULE_JSON}    ${CURDIR}/interfaces_module.json
-${INTERFACES_DATA_JSON}    ${CURDIR}/interfaces_data.json
+${JSONRPCCONFIG_MODULE_JSON}    ${CURDIR}/jsonrpcconfig_module.json
+${JSONRPCCONFIG_DATA_JSON}    ${CURDIR}/jsonrpcconfig_data.json
 ${READ_SERVICE_PEER_PUT_URL}    /restconf/config/jsonrpc:config/configured-endpoints/
 ${READ_SERVICE_PEER_PAYLOAD}    ${CURDIR}/readservice_peer_payload.json
 ${READ_SERVICE_PEER_GET_1}    /restconf/config/jsonrpc:config/configured-endpoints/
-${READ_SERVICE_PEER_GET_2}    /yang-ext:mount/ietf-interfaces:interfaces/
+${READ_SERVICE_PEER_GET_2}    /yang-ext:mount/jsonrpc:config/
 ${DEFAULT_ENDPOINT}    foo
 ${DEFAULT_PORT}    4444
-${DEFAULT_PUT_MODULE}    ietf-interfaces
 ${FIRST_CONTROLLER_INDEX}    1
 ${CENTOS_PIP}     sudo yum -y install python-pip
 ${UB_PIP}         sudo apt-get install -y python-pip
 ${READ_SERVICE_SCRIPT}    ${CURDIR}/odl-jsonrpc-test-read
-${INTERFACE_MODULE_DEFAULT_DATA}    ietf-interfaces:other
-${READSERVICE_NAME}    test
+${JSONRPCCONFIG_MODULE_DEFAULT_DATA}    jsonrpc:config
+${READSERVICE_NAME}    foo
diff --git a/csit/variables/jsonrpc/interfaces_data.json b/csit/variables/jsonrpc/interfaces_data.json
deleted file mode 100644 (file)
index ac253ea..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "interface": [{
-  "name": "test",
-  "type": "other"
- }]
-}
diff --git a/csit/variables/jsonrpc/interfaces_module.json b/csit/variables/jsonrpc/interfaces_module.json
deleted file mode 100644 (file)
index 7155454..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "ietf-interfaces:interfaces": {}
-}
diff --git a/csit/variables/jsonrpc/jsonrpcconfig_data.json b/csit/variables/jsonrpc/jsonrpcconfig_data.json
new file mode 100644 (file)
index 0000000..cb73e25
--- /dev/null
@@ -0,0 +1,7 @@
+{
+    "configured-endpoints": [
+        {
+            "name": "foo"
+        }
+    ]
+}
diff --git a/csit/variables/jsonrpc/jsonrpcconfig_module.json b/csit/variables/jsonrpc/jsonrpcconfig_module.json
new file mode 100644 (file)
index 0000000..cbc60bd
--- /dev/null
@@ -0,0 +1,3 @@
+{
+ "jsonrpc:config": {}
+}
index 54300e97bdd9c43cb278f7ef46209436d32eee04..dce14b5668c6a7a0d8feb483de22a1b7c2594bc9 100755 (executable)
@@ -101,7 +101,7 @@ class Service(object):
         try:
             # assumes that params are supplied as a list for call by position
             response["result"] = self._methods[method](
-                *params
+                params['store'], params['entity'], params['path']
             )  # pylint: disable=star-args
         except KeyError:
             response["error"] = {"code": -32601, "message": "Method not found"}
index f172107839b026a0c99f83ca25895ec16b5b5ea8..bd3d69ebd38732165f48bbf311564e82868aa6df 100644 (file)
@@ -1,7 +1,7 @@
 {
  "configured-endpoints": {
   "name": "foo",
-  "modules": ["ietf-interfaces"],
+  "modules": ["jsonrpc"],
   "data-config-endpoints": [{
    "path": "{}",
    "endpoint-uri": "zmq://127.0.0.1:4444"