Fix Netconf test to work with latest changes on Netconf connector
authorLuis Gomez <ecelgp@gmail.com>
Wed, 12 Nov 2014 01:06:44 +0000 (17:06 -0800)
committerLuis Gomez <ecelgp@gmail.com>
Wed, 12 Nov 2014 01:28:23 +0000 (17:28 -0800)
Change-Id: I7c5b783e1529c0591cc38137b3e7f26ec75285bb
Signed-off-by: Luis Gomez <ecelgp@gmail.com>
test/csit/suites/karaf-compatible/110__NETCONF/010__netconf_inventory.txt
test/csit/variables/xmls/netconf.xml

index fd168243d01a4f82c360d5bcfc32188f7ca9e4a6..dd6b5237a7eb769ce7764853de8fb2c3f59c0dce 100644 (file)
@@ -11,9 +11,9 @@ Variables         ../../../variables/Variables.py
 
 *** Variables ***
 ${FILE}                 ${CURDIR}/../../../variables/xmls/netconf.xml
-${REST_CONT_CONF}        /restconf/config/opendaylight-inventory:nodes
+${REST_CONT_CONF}       /restconf/config/opendaylight-inventory:nodes
 ${REST_CONT_OPER}       /restconf/operational/opendaylight-inventory:nodes 
-${REST_NTPR_CONF}        node/controller-config/yang-ext:mount/config:modules/config:module/netopeer
+${REST_NTPR_CONF}       node/controller-config/yang-ext:mount/config:modules
 ${REST_NTPR_MOUNT}      node/netopeer/yang-ext:mount/
 
 *** Test Cases ***
@@ -21,27 +21,25 @@ Add NetConf device
     [Documentation]    Add NetConf device using REST
     [Tags]     netconf
     ${XML1}    Get File    ${FILE}
-    ${XML2}    Replace String    127.0.0.1    ${MININET}     ${XML1}
-    ${body}    Replace String    mininet      ${MININET_USER}    ${XML2}
+    ${XML2}    Replace String    ${XML1}    127.0.0.1    ${MININET}
+    ${body}    Replace String    ${XML2}    mininet      ${MININET_USER}
     Log    ${body}
-    ${resp}    Putxml    session    ${REST_CONT_CONF}/${REST_NTPR_CONF}    data=${body}
+    ${resp}    Post    session    ${REST_CONT_CONF}/${REST_NTPR_CONF}    data=${body}
     Log    ${resp.content}
-    Should Be Equal As Strings    ${resp.status_code}    200
+    Should Be Equal As Strings    ${resp.status_code}    204
 
 Get Controller Inventory
     [Documentation]    Get Controller operational inventory
     [Tags]    netconf
-    ${resp}   Get    session    ${REST_CONT_OPER}
-    Log    ${resp.content}
-    Should Be Equal As Strings    ${resp.status_code}    200
-    Should Contain    ${resp.content}    "id":"netopeer"
-    Should Contain    ${resp.content}    "netconf-node-inventory:connected":true
-    Should Contain    ${resp.content}    "netconf-node-inventory:initial-capability"
+    Wait Until Keyword Succeeds    10s    2s    Get Inventory 
 
 Pull External Device configuration
     [Documentation]    Pull Netopeer configuration
     [Tags]    netconf
-    Wait Until Keyword Succeeds    10s    2s    Pull Config
+    ${resp}   Get    session    ${REST_CONT_CONF}/${REST_NTPR_MOUNT}
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    Should Contain    ${resp.content}    {}
 
 Verify Device Operational data
     [Documentation]    Verify Netopeer operational data
@@ -54,10 +52,11 @@ Verify Device Operational data
     Should Contain    ${resp.content}    datastores
 
 *** Keywords ***
-Pull Config
-    ${resp}   Get    session    ${REST_CONT_CONF}/${REST_NTPR_MOUNT}
+Get Inventory
+    ${resp}   Get    session    ${REST_CONT_OPER}
     Log    ${resp.content}
     Should Be Equal As Strings    ${resp.status_code}    200
-    Should Contain    ${resp.content}    {}
-
+    Should Contain    ${resp.content}    "id":"netopeer"
+    Should Contain    ${resp.content}    "netconf-node-inventory:connected":true
+    Should Contain    ${resp.content}    "netconf-node-inventory:initial-capability"
 
index 437486aefc42c0cd6eb223d52f80640fb6e1c1cd..fe21ad1903869171191deda7556839fa64c3b3d2 100644 (file)
@@ -1,4 +1,4 @@
-<module>
+<module xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
   <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">prefix:sal-netconf-connector</type>
   <name>netopeer</name>
   <address xmlns="urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf">127.0.0.1</address>