summaryrefslogtreecommitdiffstats
path: root/vnf-sdk-function-test/src/test/resources/RobotScript
diff options
context:
space:
mode:
Diffstat (limited to 'vnf-sdk-function-test/src/test/resources/RobotScript')
-rw-r--r--vnf-sdk-function-test/src/test/resources/RobotScript/config.args13
-rw-r--r--vnf-sdk-function-test/src/test/resources/RobotScript/main.robot31
2 files changed, 44 insertions, 0 deletions
diff --git a/vnf-sdk-function-test/src/test/resources/RobotScript/config.args b/vnf-sdk-function-test/src/test/resources/RobotScript/config.args
new file mode 100644
index 0000000..4d33049
--- /dev/null
+++ b/vnf-sdk-function-test/src/test/resources/RobotScript/config.args
@@ -0,0 +1,13 @@
+######### System Under Test ####################
+
+--variable SUT:192.168.4.47
+--variable SUT_NAME:SystemUnderTest
+--variable SUT_USERNAME:root
+--variable SUT_PASSWORD:root123
+
+
+
+##########TEST_MACHINE##########################
+
+--variable TEST_MACHINE:192.168.4.83
+
diff --git a/vnf-sdk-function-test/src/test/resources/RobotScript/main.robot b/vnf-sdk-function-test/src/test/resources/RobotScript/main.robot
new file mode 100644
index 0000000..4e5705e
--- /dev/null
+++ b/vnf-sdk-function-test/src/test/resources/RobotScript/main.robot
@@ -0,0 +1,31 @@
+*** Settings ***
+Suite Teardown Close All Connections
+Library String
+Library OperatingSystem
+Library SSHLibrary
+Library BuiltIn
+Library Collections
+
+*** Test Cases ***
+Ping Remote Machine
+ ${PingResult} = Run ping ${SUT} -c 4
+ Should Contain ${PingResult} 4 received
+
+Open SSH Connection to Remote machine
+ Open Connection ${SUT} ${SUT_NAME}
+ Login ${SUT_USERNAME} ${SUT_PASSWORD}
+
+Block ICMP ping from Test machine
+ ${PingResult} = Execute Command iptables -A INPUT -p icmp -s ${TEST_MACHINE} --icmp-type 8 -j DROP
+
+Ping Remote Machine Should Fail
+ ${PingResult} = Run ping ${SUT} -c 4
+ Should Contain ${PingResult} 0 received
+
+UnBlock ICMP ping from Test machine
+ ${PingResult} = Execute Command iptables -D INPUT -p icmp -s ${TEST_MACHINE} --icmp-type 8 -j DROP
+
+Ping Remote Machine Should Now Pass
+ ${PingResult} = Run ping ${SUT} -c 4
+ Should Contain ${PingResult} 4 received
+