Revert "Feature 11001: Robot framework linting for E2E tests"
[osm/tests.git] / robot-systest / testsuite / basic_18-ns_ip_profile.robot
index 9bc2391..96d7a4d 100644 (file)
@@ -83,24 +83,24 @@ Get Vnfs Info
     Set Suite Variable   ${vnf_id2}   ${vnfr_list}[1]
     ${ip}   Get Vnf Management Ip Address   ${ns_id}   ${vnf_member_index_1}
     Set Suite Variable   ${vnf1_ipmgmt}   ${ip}
-    log   ${vnf1_ipmgmt}
+    Log   ${vnf1_ipmgmt}
     ${ip}   Get Vnf Management Ip Address   ${ns_id}   ${vnf_member_index_2}
     Set Suite Variable   ${vnf2_ipmgmt}   ${ip}
-    log   ${vnf2_ipmgmt}
+    Log   ${vnf2_ipmgmt}
 
 
 Check Vnf1 IPs
 
     Variable Should Exist   ${vnf_id1}   msg=VNF1 is not available
-    ${rc}   ${stdout}=   Run and Return RC and Output   osm vnf-show ${vnf_id1} --literal | yq '.vdur[0].interfaces[] | select(.name == "${iface1_name}")' | yq '."ip-address"' | tr -d \\"
+    ${rc}   ${stdout}=   Run and Return RC and Output   osm vnf-show ${vnf_id1} --literal | yq '.vdur[0].interfaces[] | select(.name == "${iface1_name}")' | yq -r '."ip-address"'
     Should Be Equal As Integers   ${rc}   ${success_return_code}   msg=${stdout}   values=False
     Should Match Regexp   ${stdout}   ${datanet1_prefix}   msg=${stdout} doesn't match subnet's regexp ${datanet1_prefix}
     Set Suite Variable   ${vnf1_ip1}   ${stdout}
-    ${rc}   ${stdout}=   Run and Return RC and Output   osm vnf-show ${vnf_id1} --literal | yq '.vdur[0].interfaces[] | select(.name == "${iface2_name}")' | yq '."ip-address"' | tr -d \\"
+    ${rc}   ${stdout}=   Run and Return RC and Output   osm vnf-show ${vnf_id1} --literal | yq '.vdur[0].interfaces[] | select(.name == "${iface2_name}")' | yq -r '."ip-address"'
     Should Be Equal As Integers   ${rc}   ${success_return_code}   msg=${stdout}   values=False
     Should Match Regexp   ${stdout}   ${datanet2_prefix}   msg=${stdout} doesn't match subnet's regexp ${datanet2_prefix}
     Set Suite Variable   ${vnf1_ip2}   ${stdout}
-    ${rc}   ${stdout}=   Run and Return RC and Output   osm vnf-show ${vnf_id1} --literal | yq '.vdur[0].interfaces[] | select(.name == "${iface3_name}")' | yq '."ip-address"' | tr -d \\"
+    ${rc}   ${stdout}=   Run and Return RC and Output   osm vnf-show ${vnf_id1} --literal | yq '.vdur[0].interfaces[] | select(.name == "${iface3_name}")' | yq -r '."ip-address"'
     Should Be Equal As Integers   ${rc}   ${success_return_code}   msg=${stdout}   values=False
     Should Match Regexp   ${stdout}   ${datanet3_prefix}   msg=${stdout} doesn't match subnet's regexp ${datanet3_prefix}
     Set Suite Variable   ${vnf1_ip3}   ${stdout}
@@ -110,33 +110,57 @@ Check Vnf1 IPs
 Check Vnf2 IPs
 
     Variable Should Exist   ${vnf_id1}   msg=VNF2 is not available
-    ${rc}   ${stdout}=   Run and Return RC and Output   osm vnf-show ${vnf_id2} --literal | yq '.vdur[0].interfaces[] | select(.name == "${iface1_name}")' | yq '."ip-address"' | tr -d \\"
+    ${rc}   ${stdout}=   Run and Return RC and Output   osm vnf-show ${vnf_id2} --literal | yq '.vdur[0].interfaces[] | select(.name == "${iface1_name}")' | yq -r '."ip-address"'
     Should Be Equal As Integers   ${rc}   ${success_return_code}   msg=${stdout}   values=False
     Should Match Regexp   ${stdout}   ${datanet1_prefix}   msg=${stdout} doesn't match subnet's regexp ${datanet1_prefix}
     Set Suite Variable   ${vnf2_ip1}   ${stdout}
-    ${rc}   ${stdout}=   Run and Return RC and Output   osm vnf-show ${vnf_id2} --literal | yq '.vdur[0].interfaces[] | select(.name == "${iface2_name}")' | yq '."ip-address"' | tr -d \\"
+    ${rc}   ${stdout}=   Run and Return RC and Output   osm vnf-show ${vnf_id2} --literal | yq '.vdur[0].interfaces[] | select(.name == "${iface2_name}")' | yq -r '."ip-address"'
     Should Be Equal As Integers   ${rc}   ${success_return_code}   msg=${stdout}   values=False
     Should Match Regexp   ${stdout}   ${datanet2_prefix}   msg=${stdout} doesn't match subnet's regexp ${datanet2_prefix}
     Set Suite Variable   ${vnf2_ip2}   ${stdout}
-    ${rc}   ${stdout}=   Run and Return RC and Output   osm vnf-show ${vnf_id2} --literal | yq '.vdur[0].interfaces[] | select(.name == "${iface3_name}")' | yq '."ip-address"' | tr -d \\"
+    ${rc}   ${stdout}=   Run and Return RC and Output   osm vnf-show ${vnf_id2} --literal | yq '.vdur[0].interfaces[] | select(.name == "${iface3_name}")' | yq -r '."ip-address"'
     Should Be Equal As Integers   ${rc}   ${success_return_code}   msg=${stdout}   values=False
     Should Match Regexp   ${stdout}   ${datanet3_prefix}   msg=${stdout} doesn't match subnet's regexp ${datanet3_prefix}
     Set Suite Variable   ${vnf2_ip3}   ${stdout}
 
 
+Verify Vnf1 Interfaces
+
+    Variable Should Exist   ${vnf1_ipmgmt}   msg=IP address of the data VNF '${vnf_member_index_1}' is not available
+    Variable Should Exist   ${privatekey}   msg=SSH private key not available
+    Sleep   10 seconds   Wait for SSH daemon to be up
+    ${stdout}=   Execute Remote Command Check Rc Return Output   ${vnf1_ipmgmt}   ${username}   ${EMPTY}   ${privatekey}   ip --brief addr show up | grep -v "^lo" | awk '{print $3}'
+    Log   ${stdout}
+    @{ip} =   Split String   ${stdout}
+    Should Match Regexp   ${ip}[1]   ${datanet1_prefix}   msg=${ip}[1] doesn't match subnet's regexp ${datanet1_prefix}
+    Should Match Regexp   ${ip}[2]   ${datanet2_prefix}   msg=${ip}[2] doesn't match subnet's regexp ${datanet2_prefix}
+    Should Match Regexp   ${ip}[3]   ${datanet3_prefix}   msg=${ip}[3] doesn't match subnet's regexp ${datanet3_prefix}
+
+
+Verify Vnf2 Interfaces
+
+    Variable Should Exist   ${vnf2_ipmgmt}   msg=IP address of the data VNF '${vnf_member_index_2}' is not available
+    Variable Should Exist   ${privatekey}   msg=SSH private key not available
+    ${stdout}=   Execute Remote Command Check Rc Return Output   ${vnf2_ipmgmt}   ${username}   ${EMPTY}   ${privatekey}   ip --brief addr show up | grep -v "^lo" | awk '{print $3}'
+    Log   ${stdout}
+    @{ip} =   Split String   ${stdout}
+    Should Match Regexp   ${ip}[1]   ${datanet1_prefix}   msg=${ip}[1] doesn't match subnet's regexp ${datanet1_prefix}
+    Should Match Regexp   ${ip}[2]   ${datanet2_prefix}   msg=${ip}[2] doesn't match subnet's regexp ${datanet2_prefix}
+    Should Match Regexp   ${ip}[3]   ${datanet3_prefix}   msg=${ip}[3] doesn't match subnet's regexp ${datanet3_prefix}
+
+
 Ping from Vnf1 to Vnf2
 
     Variable Should Exist   ${vnf1_ipmgmt}   msg=IP address of the data VNF '${vnf_member_index_1}' is not available
     Variable Should Exist   ${privatekey}   msg=SSH private key not available
-    Sleep   30 seconds   Wait for SSH daemon to be up
     ${stdout}=   Execute Remote Command Check Rc Return Output   ${vnf1_ipmgmt}   ${username}   ${EMPTY}   ${privatekey}   ip addr ; ping -c 5 ${vnf2_ipmgmt}
-    log   ${stdout}
+    Log   ${stdout}
     ${stdout}=   Execute Remote Command Check Rc Return Output   ${vnf1_ipmgmt}   ${username}   ${EMPTY}   ${privatekey}   ping -c 5 ${vnf2_ip1}
-    log   ${stdout}
+    Log   ${stdout}
     ${stdout}=   Execute Remote Command Check Rc Return Output   ${vnf1_ipmgmt}   ${username}   ${EMPTY}   ${privatekey}   ping -c 5 ${vnf2_ip2}
-    log   ${stdout}
+    Log   ${stdout}
     ${stdout}=   Execute Remote Command Check Rc Return Output   ${vnf1_ipmgmt}   ${username}   ${EMPTY}   ${privatekey}   ping -c 5 ${vnf2_ip3}
-    log   ${stdout}
+    Log   ${stdout}
 
 
 Ping from Vnf2 to Vnf1
@@ -144,13 +168,13 @@ Ping from Vnf2 to Vnf1
     Variable Should Exist   ${vnf1_ipmgmt}   msg=IP address of the data VNF '${vnf_member_index_2}' is not available
     Variable Should Exist   ${privatekey}   msg=SSH private key not available
     ${stdout}=   Execute Remote Command Check Rc Return Output   ${vnf2_ipmgmt}   ${username}   ${EMPTY}   ${privatekey}   ip addr ; ping -c 5 ${vnf1_ipmgmt}
-    log   ${stdout}
+    Log   ${stdout}
     ${stdout}=   Execute Remote Command Check Rc Return Output   ${vnf2_ipmgmt}   ${username}   ${EMPTY}   ${privatekey}   ip addr ; ping -c 5 ${vnf1_ip1}
-    log   ${stdout}
+    Log   ${stdout}
     ${stdout}=   Execute Remote Command Check Rc Return Output   ${vnf2_ipmgmt}   ${username}   ${EMPTY}   ${privatekey}   ip addr ; ping -c 5 ${vnf1_ip2}
-    log   ${stdout}
+    Log   ${stdout}
     ${stdout}=   Execute Remote Command Check Rc Return Output   ${vnf2_ipmgmt}   ${username}   ${EMPTY}   ${privatekey}   ip addr ; ping -c 5 ${vnf1_ip3}
-    log   ${stdout}
+    Log   ${stdout}
 
 
 Delete NS Instance