NETWORK: Executed nping command with root privilege test_network_nping.robot
Changes:
- In test_network_nping.robot added "echo ${root_password} | sudo -S" to the nping command and added ${CLIENT_PASSWORD} in resource.robot
Tested:
- Ran network/test_network_nping.robot script Successfully
Change-Id: Ie7494e63eddaa31b76872067b657ed3c7385a64b
Signed-off-by: manimozhik <manimozhik@ami.com>
diff --git a/lib/resource.robot b/lib/resource.robot
index 44012a7..97440d4 100755
--- a/lib/resource.robot
+++ b/lib/resource.robot
@@ -168,6 +168,8 @@
# 2 NTP Address - 14.139.60.103 14.139.60.106
@{NTP_SERVER_ADDRESSES} ${EMPTY}
+# Client related parameters
+${CLIENT_PASSWORD} ${EMPTY}
# Task Service related variables.
${TASK_JSON_FILE_PATH} data/task_state.json
diff --git a/network/test_network_nping.robot b/network/test_network_nping.robot
index 1dcd064..f9d0874 100644
--- a/network/test_network_nping.robot
+++ b/network/test_network_nping.robot
@@ -51,10 +51,11 @@
# by default it sends 100 TCP packets at 5 packets/second.
${cmd_buff}= Run Keyword If '${packet_type}' == 'icmp'
- ... Set Variable nping --delay ${delay} ${host} -c ${count} --${packet_type}
+ ... Set Variable
+ ... echo ${CLIENT_PASSWORD} | sudo -S nping --delay ${delay} ${host} -c ${count} --${packet_type}
... ELSE
... Set variable
- ... nping --delay ${delay} ${host} -c ${count} -p ${port} --${packet_type}
+ ... echo ${CLIENT_PASSWORD} | sudo -S nping --delay ${delay} ${host} -c ${count} -p ${port} --${packet_type}
${rc} ${output} Run And Return RC And Output ${cmd_buff}
Should Be Equal As Integers ${rc} 0 msg=Command execution failed.
${packet_loss} Get Packet Loss ${host} ${output}