Commit 50a617f4 authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

CI test - Ryu-OpenFlow:



- Added wait till OVS bridges are up.

Co-authored-by: default avatarCopilot <copilot@github.com>
parent 53bfe3c5
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
@@ -191,6 +191,28 @@ end2end_test ryu-openflow:
    - echo "Mininet is ready!"
#    - docker logs mininet

    # Wait for initialization of OVS switches
    - >
      while true; do
        echo "Attempt: $LOOP_COUNTER"
        echo "Waiting for OVS bridges s1-s5..."
        sleep 1;
        OVS_OUTPUT="$(docker exec mininet bash -c "ovs-vsctl show")"
        if echo "$OVS_OUTPUT" | grep -q "Bridge s1" &&
           echo "$OVS_OUTPUT" | grep -q "Bridge s2" &&
           echo "$OVS_OUTPUT" | grep -q "Bridge s3" &&
           echo "$OVS_OUTPUT" | grep -q "Bridge s4" &&
           echo "$OVS_OUTPUT" | grep -q "Bridge s5"; then
          echo "All OVS bridges are ready!"
          break
        fi
        LOOP_COUNTER=$((LOOP_COUNTER + 1))
        if [ "$LOOP_COUNTER" -ge "$LOOP_MAX_ATTEMPTS" ]; then
          echo "Max attempts reached, exiting the loop."
          break
        fi
      done

    # Dump configuration of the switches (OpenFlow rules configured) (after starting Mininet)
    - docker exec mininet bash -c "ovs-vsctl show"
    - docker exec mininet bash -c "ovs-ofctl dump-flows s1"