Added testcase to fetch specific capwap wtp ipv4 address.
authorSajan Liyon <sliyon@brocade.com>
Tue, 9 Jun 2015 15:18:30 +0000 (20:48 +0530)
committerSajan Liyon <sliyon@brocade.com>
Thu, 11 Jun 2015 19:30:27 +0000 (01:00 +0530)
Change-Id: Id7758a7eb70b4db765fe900cfb23b4e2b4fcc6cb
Signed-off-by: Sajan Liyon <sliyon@brocade.com>
test/csit/suites/capwap/basic/capwap_session.robot

index 014c8b864cfa3e6fa57b00eab05b293697e34b2c..72f8d7b3f632f77ae1192fbdf0ec4f42ac848988 100644 (file)
@@ -10,22 +10,19 @@ Library           Collections
 Library           ../../../libraries/CapwapLibrary.py
 
 *** Variables ***
-${REST_CONTEXT}    /restconf/modules
 ${DISC_WTP_REST}    /restconf/operational/capwap-impl:capwap-ac-root/
 
 *** Test Cases ***
-Get Controller Modules
-    [Documentation]    Get the controller modules via Restconf
-    ${resp}    RequestsLibrary.Get    session    ${REST_CONTEXT}
-    Log    ${resp.content}
-    Should Be Equal As Strings    ${resp.status_code}    200
-    Should Contain    ${resp.content}    ietf-restconf
-
 Get Discovered WTPs
     [Documentation]    Get the WTP Discoverd
     send discover    ${CONTROLLER}
     Wait Until Keyword Succeeds    10s    5s    Run Test Get Discovered WTP
 
+Get Specific WTP
+    [Documentation]    Get the details of specific WTP.
+    send discover    ${CONTROLLER}
+    Wait Until Keyword Succeeds    10s    5s    Run Test Get Specifc WTP
+
 *** Keywords ***
 Run Test Get Discovered WTP
     ${resp}    RequestsLibrary.Get    session    ${DISC_WTP_REST}
@@ -41,3 +38,19 @@ Run Test Get Discovered WTP
     \    Append to List    ${wtp_ip_list}    ${wtp_ip}
     Log    ${wtp_ip_list}
     List Should Contain Value    ${wtp_ip_list}    ${expected_ip_addr}
+
+Run Test Get Specifc WTP
+    ${expected_ip_addr}    get simulated wtpip    ${CONTROLLER}
+    ${DISC_SPECIFIC_WTP}    catenate    SEPARATOR=    ${DISC_WTP_REST}    discovered-wtps\/    ${expected_ip_addr}    \/
+    Log    ${DISC_SPECIFIC_WTP}
+    ${resp}    RequestsLibrary.Get    session    ${DISC_SPECIFIC_WTP}
+    Log    ${resp.content}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    ${result}    TO JSON    ${resp.content}
+    @{wtp_discovered}    Get From Dictionary    ${result}    discovered-wtps
+    ${wtp_ip_list}    Create List    ''
+    : FOR    ${wtp}    IN    @{wtp_discovered}
+    \    ${wtp_ip}    Get From Dictionary    ${wtp}    ipv4-addr
+    \    Append to List    ${wtp_ip_list}    ${wtp_ip}
+    Log    ${wtp_ip_list}
+    List Should Contain Value    ${wtp_ip_list}    ${expected_ip_addr}