From 7560918629eb11aa7bdaee5f4856243b38c77f93 Mon Sep 17 00:00:00 2001 From: Mauro Sardara Date: Mon, 16 Jan 2023 20:18:23 +0000 Subject: feat: local-remote strategy Ticket: HICN-824 Change-Id: Iea285cb499b13c943a142fa39328ee36c91ae913 Signed-off-by: Mauro Sardara --- tests/.env | 1 + tests/2-nodes-vpp-memif-local-remote.yml | 116 +++++++++++++++++++++ tests/config.sh | 53 +++++++++- .../2-nodes-vpp-memif-local-remote.robot | 21 ++++ 4 files changed, 188 insertions(+), 3 deletions(-) create mode 100644 tests/2-nodes-vpp-memif-local-remote.yml create mode 100644 tests/functional-tests/2-nodes-vpp-memif-local-remote.robot (limited to 'tests') diff --git a/tests/.env b/tests/.env index 8d5d23eca..3eeee90c4 100644 --- a/tests/.env +++ b/tests/.env @@ -7,6 +7,7 @@ TEST_LIGHT=hicn-light TEST_VPP_BRIDGE=vpp-bridge TEST_VPP_MEMIF=vpp-memif TEST_VPP_MEMIF_REPLICATION=vpp-memif-replication +TEST_VPP_MEMIF_LOCALREMOTE=vpp-memif-local-remote # names RTC_PRODUCER=b002:0:0:0:abcd::/80 diff --git a/tests/2-nodes-vpp-memif-local-remote.yml b/tests/2-nodes-vpp-memif-local-remote.yml new file mode 100644 index 000000000..90f4b9ebc --- /dev/null +++ b/tests/2-nodes-vpp-memif-local-remote.yml @@ -0,0 +1,116 @@ +version: "3" +version: "3" +services: + client: + container_name: ${TEST_VPP_MEMIF}-client + networks: [] + volumes: + - /tmp/memif:/memif:z + - ..:/workspace:z + command: + - | + if [ -d /workspace/build-dev ]; then + sudo ninja -C /workspace/build-dev install + fi + + sudo mkdir -p /var/log/vpp + sudo tee /etc/vpp/startup.conf < /tmp/output + + # Check that producer face has received 0 packets + INTEREST_TX="$(cat /tmp/output | grep -A 9 producer | grep "Interest tx" | awk '{print $4}')" + INTEREST_TX="${INTEREST_TX%%[[:cntrl:]]}" + if [[ ${INTEREST_TX} != "0" ]]; then + echo "Received interest on local interface." + exit 1 + fi + + # Check that producer face has sent 0 packets + DATA_RX="$(cat /tmp/output | grep -A 9 producer | grep "Data rx" | awk '{print $4}')" + DATA_RX="${DATA_RX%%[[:cntrl:]]}" + if [[ ${DATA_RX} != "0" ]]; then + echo "Received data on local interface." + exit 1 + fi + + # Check that remote face has sent > 0 packets + DATA_RX="$(cat /tmp/output | grep -A 9 ${TOPOLOGY_2_NODES_IP6_ADDRESS_CLIENT} | grep "Data rx" | awk '{print $4}')" + DATA_RX="${DATA_RX%%[[:cntrl:]]}" + if [[ ${DATA_RX} == "0" ]]; then + echo "No data received on remote interface." + exit 1 + fi + + # Check that remote face has sent > 0 packets + INTEREST_TX="$(cat /tmp/output | grep -A 9 ${TOPOLOGY_2_NODES_IP6_ADDRESS_CLIENT} | grep "Interest tx" | awk '{print $4}')" + INTEREST_TX="${INTEREST_TX%%[[:cntrl:]]}" + if [[ ${INTEREST_TX} == "0" ]]; then + echo "No interest sent on remote interface." + exit 1 + fi +} + #--------------------------------------------------------------# while (("${#}")); do @@ -644,6 +687,10 @@ while (("${#}")); do ping "${2}" break ;; + 'localremote') + localremote + break + ;; *) exit 1 ;; diff --git a/tests/functional-tests/2-nodes-vpp-memif-local-remote.robot b/tests/functional-tests/2-nodes-vpp-memif-local-remote.robot new file mode 100644 index 000000000..31f5143ea --- /dev/null +++ b/tests/functional-tests/2-nodes-vpp-memif-local-remote.robot @@ -0,0 +1,21 @@ +*** Settings *** +Resource ../resources/libraries/robot/runtest.robot +Resource ../resources/libraries/robot/common.robot + +Suite Setup Run Keywords +... Build Topology +... 2-nodes +... vpp-memif-local-remote +... AND +... Check Environment +Suite Teardown Run Keywords +... Destroy Topology + + +*** Test Cases *** +Test traffic received from local face is forwarded to remote face + Log to console Test traffic received from local face is forwarded to remote face + ${result} = Run Process bash -x ${EXECDIR}/config.sh localremote + Log Many + ... stdout: ${result.stdout} + ... stderr: ${result.stderr} -- cgit