Commit c30aed37 authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Test Ryu-OpenFlow:

- Fixed ping tests in gitlab-ci
parent 23e1d240
Loading
Loading
Loading
Loading
+69 −60
Original line number Diff line number Diff line
@@ -254,19 +254,28 @@ end2end_test ryu-openflow:
    - docker exec mininet ovs-ofctl dump-flows s4
    - docker exec mininet ovs-ofctl dump-flows s5

    - |
      ping_check() {
        local src=$1 dst=$2 pattern=$3
        local output
        output=$(curl -s "http://172.254.252.11:5000/ping?source=${src}&target=${dst}&count=3")
        echo "$output"
        echo "$output" | grep -E "$pattern"
      }

    # Run end-to-end test: test no connectivity with ping
    - curl -s 'http://172.254.252.11:5000/ping?source=h1&target=h2&count=3' | tee /dev/stderr | grep -E '3 packets transmitted, 0 received, 100\% packet loss'
    - curl -s 'http://172.254.252.11:5000/ping?source=h1&target=h3&count=3' | tee /dev/stderr | grep -E '3 packets transmitted, 0 received, 100\% packet loss'
    - curl -s 'http://172.254.252.11:5000/ping?source=h1&target=h4&count=3' | tee /dev/stderr | grep -E '3 packets transmitted, 0 received, 100\% packet loss'
    - curl -s 'http://172.254.252.11:5000/ping?source=h2&target=h1&count=3' | tee /dev/stderr | grep -E '3 packets transmitted, 0 received, 100\% packet loss'
    - curl -s 'http://172.254.252.11:5000/ping?source=h2&target=h3&count=3' | tee /dev/stderr | grep -E '3 packets transmitted, 0 received, 100\% packet loss'
    - curl -s 'http://172.254.252.11:5000/ping?source=h2&target=h4&count=3' | tee /dev/stderr | grep -E '3 packets transmitted, 3 received, 0\% packet loss'
    - curl -s 'http://172.254.252.11:5000/ping?source=h3&target=h1&count=3' | tee /dev/stderr | grep -E '3 packets transmitted, 0 received, 100\% packet loss'
    - curl -s 'http://172.254.252.11:5000/ping?source=h3&target=h2&count=3' | tee /dev/stderr | grep -E '3 packets transmitted, 0 received, 100\% packet loss'
    - curl -s 'http://172.254.252.11:5000/ping?source=h3&target=h4&count=3' | tee /dev/stderr | grep -E '3 packets transmitted, 0 received, 100\% packet loss'
    - curl -s 'http://172.254.252.11:5000/ping?source=h4&target=h1&count=3' | tee /dev/stderr | grep -E '3 packets transmitted, 0 received, 100\% packet loss'
    - curl -s 'http://172.254.252.11:5000/ping?source=h4&target=h2&count=3' | tee /dev/stderr | grep -E '3 packets transmitted, 3 received, 0\% packet loss'
    - curl -s 'http://172.254.252.11:5000/ping?source=h4&target=h3&count=3' | tee /dev/stderr | grep -E '3 packets transmitted, 0 received, 100\% packet loss'
    - ping_check h1 h2 '3 packets transmitted, 0 received, 100% packet loss'
    - ping_check h1 h3 '3 packets transmitted, 0 received, 100% packet loss'
    - ping_check h1 h4 '3 packets transmitted, 0 received, 100% packet loss'
    - ping_check h2 h1 '3 packets transmitted, 0 received, 100% packet loss'
    - ping_check h2 h3 '3 packets transmitted, 0 received, 100% packet loss'
    - ping_check h2 h4 '3 packets transmitted, 3 received, 0% packet loss'
    - ping_check h3 h1 '3 packets transmitted, 0 received, 100% packet loss'
    - ping_check h3 h2 '3 packets transmitted, 0 received, 100% packet loss'
    - ping_check h3 h4 '3 packets transmitted, 0 received, 100% packet loss'
    - ping_check h4 h1 '3 packets transmitted, 0 received, 100% packet loss'
    - ping_check h4 h2 '3 packets transmitted, 3 received, 0% packet loss'
    - ping_check h4 h3 '3 packets transmitted, 0 received, 100% packet loss'

    # Run end-to-end test: configure IETF L3VPN service between h1-h3
    - >
@@ -284,18 +293,18 @@ end2end_test ryu-openflow:
    - docker exec mininet ovs-ofctl dump-flows s5

    # Run end-to-end test: test connectivity with ping (h1-h3 should work, rest should not work)
    - curl -s 'http://172.254.252.11:5000/ping?source=h1&target=h2&count=3' | tee /dev/stderr | grep -E '3 packets transmitted, 0 received, 100\% packet loss'
    - curl -s 'http://172.254.252.11:5000/ping?source=h1&target=h3&count=3' | tee /dev/stderr | grep -E '3 packets transmitted, 3 received, 0\% packet loss'
    - curl -s 'http://172.254.252.11:5000/ping?source=h1&target=h4&count=3' | tee /dev/stderr | grep -E '3 packets transmitted, 0 received, 100\% packet loss'
    - curl -s 'http://172.254.252.11:5000/ping?source=h2&target=h1&count=3' | tee /dev/stderr | grep -E '3 packets transmitted, 0 received, 100\% packet loss'
    - curl -s 'http://172.254.252.11:5000/ping?source=h2&target=h3&count=3' | tee /dev/stderr | grep -E '3 packets transmitted, 0 received, 100\% packet loss'
    - curl -s 'http://172.254.252.11:5000/ping?source=h2&target=h4&count=3' | tee /dev/stderr | grep -E '3 packets transmitted, 3 received, 0\% packet loss'
    - curl -s 'http://172.254.252.11:5000/ping?source=h3&target=h1&count=3' | tee /dev/stderr | grep -E '3 packets transmitted, 3 received, 0\% packet loss'
    - curl -s 'http://172.254.252.11:5000/ping?source=h3&target=h2&count=3' | tee /dev/stderr | grep -E '3 packets transmitted, 0 received, 100\% packet loss'
    - curl -s 'http://172.254.252.11:5000/ping?source=h3&target=h4&count=3' | tee /dev/stderr | grep -E '3 packets transmitted, 0 received, 100\% packet loss'
    - curl -s 'http://172.254.252.11:5000/ping?source=h4&target=h1&count=3' | tee /dev/stderr | grep -E '3 packets transmitted, 0 received, 100\% packet loss'
    - curl -s 'http://172.254.252.11:5000/ping?source=h4&target=h2&count=3' | tee /dev/stderr | grep -E '3 packets transmitted, 3 received, 0\% packet loss'
    - curl -s 'http://172.254.252.11:5000/ping?source=h4&target=h3&count=3' | tee /dev/stderr | grep -E '3 packets transmitted, 0 received, 100\% packet loss'
    - ping_check h1 h2 '3 packets transmitted, 0 received, 100% packet loss'
    - ping_check h1 h3 '3 packets transmitted, 3 received, 0% packet loss'
    - ping_check h1 h4 '3 packets transmitted, 0 received, 100% packet loss'
    - ping_check h2 h1 '3 packets transmitted, 0 received, 100% packet loss'
    - ping_check h2 h3 '3 packets transmitted, 0 received, 100% packet loss'
    - ping_check h2 h4 '3 packets transmitted, 3 received, 0% packet loss'
    - ping_check h3 h1 '3 packets transmitted, 3 received, 0% packet loss'
    - ping_check h3 h2 '3 packets transmitted, 0 received, 100% packet loss'
    - ping_check h3 h4 '3 packets transmitted, 0 received, 100% packet loss'
    - ping_check h4 h1 '3 packets transmitted, 0 received, 100% packet loss'
    - ping_check h4 h2 '3 packets transmitted, 3 received, 0% packet loss'
    - ping_check h4 h3 '3 packets transmitted, 0 received, 100% packet loss'

    # Run end-to-end test: configure IETF L3VPN service between h2-h4
    - >
@@ -313,18 +322,18 @@ end2end_test ryu-openflow:
    - docker exec mininet ovs-ofctl dump-flows s5

    # Run end-to-end test: test connectivity with ping (h1-h3 should work, h2-h4 should work, rest should not work)
    - curl -s 'http://172.254.252.11:5000/ping?source=h1&target=h2&count=3' | tee /dev/stderr | grep -E '3 packets transmitted, 0 received, 100\% packet loss'
    - curl -s 'http://172.254.252.11:5000/ping?source=h1&target=h3&count=3' | tee /dev/stderr | grep -E '3 packets transmitted, 0 received, 100\% packet loss'
    - curl -s 'http://172.254.252.11:5000/ping?source=h1&target=h4&count=3' | tee /dev/stderr | grep -E '3 packets transmitted, 0 received, 100\% packet loss'
    - curl -s 'http://172.254.252.11:5000/ping?source=h2&target=h1&count=3' | tee /dev/stderr | grep -E '3 packets transmitted, 0 received, 100\% packet loss'
    - curl -s 'http://172.254.252.11:5000/ping?source=h2&target=h3&count=3' | tee /dev/stderr | grep -E '3 packets transmitted, 0 received, 100\% packet loss'
    - curl -s 'http://172.254.252.11:5000/ping?source=h2&target=h4&count=3' | tee /dev/stderr | grep -E '3 packets transmitted, 3 received, 0\% packet loss'
    - curl -s 'http://172.254.252.11:5000/ping?source=h3&target=h1&count=3' | tee /dev/stderr | grep -E '3 packets transmitted, 0 received, 100\% packet loss'
    - curl -s 'http://172.254.252.11:5000/ping?source=h3&target=h2&count=3' | tee /dev/stderr | grep -E '3 packets transmitted, 0 received, 100\% packet loss'
    - curl -s 'http://172.254.252.11:5000/ping?source=h3&target=h4&count=3' | tee /dev/stderr | grep -E '3 packets transmitted, 0 received, 100\% packet loss'
    - curl -s 'http://172.254.252.11:5000/ping?source=h4&target=h1&count=3' | tee /dev/stderr | grep -E '3 packets transmitted, 0 received, 100\% packet loss'
    - curl -s 'http://172.254.252.11:5000/ping?source=h4&target=h2&count=3' | tee /dev/stderr | grep -E '3 packets transmitted, 3 received, 0\% packet loss'
    - curl -s 'http://172.254.252.11:5000/ping?source=h4&target=h3&count=3' | tee /dev/stderr | grep -E '3 packets transmitted, 0 received, 100\% packet loss'
    - ping_check h1 h2 '3 packets transmitted, 0 received, 100% packet loss'
    - ping_check h1 h3 '3 packets transmitted, 0 received, 100% packet loss'
    - ping_check h1 h4 '3 packets transmitted, 0 received, 100% packet loss'
    - ping_check h2 h1 '3 packets transmitted, 0 received, 100% packet loss'
    - ping_check h2 h3 '3 packets transmitted, 0 received, 100% packet loss'
    - ping_check h2 h4 '3 packets transmitted, 3 received, 0% packet loss'
    - ping_check h3 h1 '3 packets transmitted, 0 received, 100% packet loss'
    - ping_check h3 h2 '3 packets transmitted, 0 received, 100% packet loss'
    - ping_check h3 h4 '3 packets transmitted, 0 received, 100% packet loss'
    - ping_check h4 h1 '3 packets transmitted, 0 received, 100% packet loss'
    - ping_check h4 h2 '3 packets transmitted, 3 received, 0% packet loss'
    - ping_check h4 h3 '3 packets transmitted, 0 received, 100% packet loss'

    # Run end-to-end test: deconfigure IETF L3VPN service h1-h3
    - >
@@ -342,18 +351,18 @@ end2end_test ryu-openflow:
    - docker exec mininet ovs-ofctl dump-flows s5

    # Run end-to-end test: test connectivity with ping (h2-h4 should work, rest should not work)
    - curl -s 'http://172.254.252.11:5000/ping?source=h1&target=h2&count=3' | tee /dev/stderr | grep -E '3 packets transmitted, 0 received, 100\% packet loss'
    - curl -s 'http://172.254.252.11:5000/ping?source=h1&target=h3&count=3' | tee /dev/stderr | grep -E '3 packets transmitted, 0 received, 100\% packet loss'
    - curl -s 'http://172.254.252.11:5000/ping?source=h1&target=h4&count=3' | tee /dev/stderr | grep -E '3 packets transmitted, 0 received, 100\% packet loss'
    - curl -s 'http://172.254.252.11:5000/ping?source=h2&target=h1&count=3' | tee /dev/stderr | grep -E '3 packets transmitted, 0 received, 100\% packet loss'
    - curl -s 'http://172.254.252.11:5000/ping?source=h2&target=h3&count=3' | tee /dev/stderr | grep -E '3 packets transmitted, 0 received, 100\% packet loss'
    - curl -s 'http://172.254.252.11:5000/ping?source=h2&target=h4&count=3' | tee /dev/stderr | grep -E '3 packets transmitted, 0 received, 100\% packet loss'
    - curl -s 'http://172.254.252.11:5000/ping?source=h3&target=h1&count=3' | tee /dev/stderr | grep -E '3 packets transmitted, 0 received, 100\% packet loss'
    - curl -s 'http://172.254.252.11:5000/ping?source=h3&target=h2&count=3' | tee /dev/stderr | grep -E '3 packets transmitted, 0 received, 100\% packet loss'
    - curl -s 'http://172.254.252.11:5000/ping?source=h3&target=h4&count=3' | tee /dev/stderr | grep -E '3 packets transmitted, 0 received, 100\% packet loss'
    - curl -s 'http://172.254.252.11:5000/ping?source=h4&target=h1&count=3' | tee /dev/stderr | grep -E '3 packets transmitted, 0 received, 100\% packet loss'
    - curl -s 'http://172.254.252.11:5000/ping?source=h4&target=h2&count=3' | tee /dev/stderr | grep -E '3 packets transmitted, 0 received, 100\% packet loss'
    - curl -s 'http://172.254.252.11:5000/ping?source=h4&target=h3&count=3' | tee /dev/stderr | grep -E '3 packets transmitted, 0 received, 100\% packet loss'
    - ping_check h1 h2 '3 packets transmitted, 0 received, 100% packet loss'
    - ping_check h1 h3 '3 packets transmitted, 0 received, 100% packet loss'
    - ping_check h1 h4 '3 packets transmitted, 0 received, 100% packet loss'
    - ping_check h2 h1 '3 packets transmitted, 0 received, 100% packet loss'
    - ping_check h2 h3 '3 packets transmitted, 0 received, 100% packet loss'
    - ping_check h2 h4 '3 packets transmitted, 0 received, 100% packet loss'
    - ping_check h3 h1 '3 packets transmitted, 0 received, 100% packet loss'
    - ping_check h3 h2 '3 packets transmitted, 0 received, 100% packet loss'
    - ping_check h3 h4 '3 packets transmitted, 0 received, 100% packet loss'
    - ping_check h4 h1 '3 packets transmitted, 0 received, 100% packet loss'
    - ping_check h4 h2 '3 packets transmitted, 0 received, 100% packet loss'
    - ping_check h4 h3 '3 packets transmitted, 0 received, 100% packet loss'

    # Run end-to-end test: deconfigure IETF L3VPN service h2-h4
    - >
@@ -371,18 +380,18 @@ end2end_test ryu-openflow:
    - docker exec mininet ovs-ofctl dump-flows s5

    # Run end-to-end test: test no connectivity with ping
    - curl -s 'http://172.254.252.11:5000/ping?source=h1&target=h2&count=3' | tee /dev/stderr | grep -E '3 packets transmitted, 0 received, 100\% packet loss'
    - curl -s 'http://172.254.252.11:5000/ping?source=h1&target=h3&count=3' | tee /dev/stderr | grep -E '3 packets transmitted, 0 received, 100\% packet loss'
    - curl -s 'http://172.254.252.11:5000/ping?source=h1&target=h4&count=3' | tee /dev/stderr | grep -E '3 packets transmitted, 0 received, 100\% packet loss'
    - curl -s 'http://172.254.252.11:5000/ping?source=h2&target=h1&count=3' | tee /dev/stderr | grep -E '3 packets transmitted, 0 received, 100\% packet loss'
    - curl -s 'http://172.254.252.11:5000/ping?source=h2&target=h3&count=3' | tee /dev/stderr | grep -E '3 packets transmitted, 0 received, 100\% packet loss'
    - curl -s 'http://172.254.252.11:5000/ping?source=h2&target=h4&count=3' | tee /dev/stderr | grep -E '3 packets transmitted, 0 received, 100\% packet loss'
    - curl -s 'http://172.254.252.11:5000/ping?source=h3&target=h1&count=3' | tee /dev/stderr | grep -E '3 packets transmitted, 0 received, 100\% packet loss'
    - curl -s 'http://172.254.252.11:5000/ping?source=h3&target=h2&count=3' | tee /dev/stderr | grep -E '3 packets transmitted, 0 received, 100\% packet loss'
    - curl -s 'http://172.254.252.11:5000/ping?source=h3&target=h4&count=3' | tee /dev/stderr | grep -E '3 packets transmitted, 0 received, 100\% packet loss'
    - curl -s 'http://172.254.252.11:5000/ping?source=h4&target=h1&count=3' | tee /dev/stderr | grep -E '3 packets transmitted, 0 received, 100\% packet loss'
    - curl -s 'http://172.254.252.11:5000/ping?source=h4&target=h2&count=3' | tee /dev/stderr | grep -E '3 packets transmitted, 0 received, 100\% packet loss'
    - curl -s 'http://172.254.252.11:5000/ping?source=h4&target=h3&count=3' | tee /dev/stderr | grep -E '3 packets transmitted, 0 received, 100\% packet loss'
    - ping_check h1 h2 '3 packets transmitted, 0 received, 100% packet loss'
    - ping_check h1 h3 '3 packets transmitted, 0 received, 100% packet loss'
    - ping_check h1 h4 '3 packets transmitted, 0 received, 100% packet loss'
    - ping_check h2 h1 '3 packets transmitted, 0 received, 100% packet loss'
    - ping_check h2 h3 '3 packets transmitted, 0 received, 100% packet loss'
    - ping_check h2 h4 '3 packets transmitted, 0 received, 100% packet loss'
    - ping_check h3 h1 '3 packets transmitted, 0 received, 100% packet loss'
    - ping_check h3 h2 '3 packets transmitted, 0 received, 100% packet loss'
    - ping_check h3 h4 '3 packets transmitted, 0 received, 100% packet loss'
    - ping_check h4 h1 '3 packets transmitted, 0 received, 100% packet loss'
    - ping_check h4 h2 '3 packets transmitted, 0 received, 100% packet loss'
    - ping_check h4 h3 '3 packets transmitted, 0 received, 100% packet loss'

    # Run end-to-end test: cleanup scenario
    - >