Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
almusil committed Dec 3, 2024
1 parent dd39ec2 commit 932bb13
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 18 deletions.
8 changes: 1 addition & 7 deletions .github/workflows/ovn-fake-multinode-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ jobs:
matrix:
cfg:
- { repo: "${{ github.repository }}", branch: "${{ github.ref_name }}" }
- { repo: ovn-org/ovn, branch: "branch-22.03" }
env:
RUNC_CMD: podman
OS_IMAGE: "fedora:39"
Expand Down Expand Up @@ -78,8 +77,7 @@ jobs:
fail-fast: false
matrix:
cfg:
- { branch: "${{ github.ref_name }}", testsuiteflags: ""}
- { branch: "branch-22.03", testsuiteflags: "-k 'basic test'" }
- { branch: "${{ github.ref_name }}", testsuiteflags: "15"}
name: multinode tests ${{ join(matrix.cfg.*, ' ') }}
env:
RUNC_CMD: podman
Expand Down Expand Up @@ -118,14 +116,10 @@ jobs:
with:
name: test-${{ github.ref_name }}-image

- uses: actions/download-artifact@v4
with:
name: test-branch-22.03-image

- name: Load podman image
run: |
sudo podman load --input ovn_${{ github.ref_name }}_image.tar
sudo podman load --input ovn_branch-22.03_image.tar
- name: Check out ovn-fake-multi-node
uses: actions/checkout@v4
Expand Down
10 changes: 6 additions & 4 deletions tests/multinode-macros.at
Original file line number Diff line number Diff line change
Expand Up @@ -140,15 +140,17 @@ multinode_setup_northd() {
# Sets up controller on specified node.
multinode_setup_controller() {
c=$1
encap_ip=$2
remote_ip=$3
encap_type=${4:-"geneve"}
encap_ip=$3
remote_ip=$4
encap_type=${5:-"geneve"}

# Cleanup existing one
m_as $c /usr/share/openvswitch/scripts/ovs-ctl stop
m_as $c /usr/share/ovn/scripts/ovn-ctl stop_controller
m_as $c rm -f /etc/openvswitch/*.db

m_as $c /usr/share/openvswitch/scripts/ovs-ctl start --system-id=$id
echo "Starting $c"
m_as $c /usr/share/openvswitch/scripts/ovs-ctl start --system-id=$c
m_as $c /usr/share/ovn/scripts/ovn-ctl start_controller

m_as $c ovs-vsctl set open . external_ids:ovn-encap-ip=$encap_ip
Expand Down
26 changes: 19 additions & 7 deletions tests/multinode.at
Original file line number Diff line number Diff line change
Expand Up @@ -2585,11 +2585,11 @@ AT_CLEANUP

AT_SETUP([ovn multinode - Transit Router basic functionality])

# Check that ovn-fake-multinode setup is up and running - requires additional nodes
check_fake_multinode_setup_by_nodes 'ovn-chassis-1 ovn-chassis-2'
# Check that ovn-fake-multinode setup is up and running
check_fake_multinode_setup

# Delete the multinode NB and OVS resources before starting the test.
cleanup_multinode_resources_by_nodes 'ovn-chassis-1 ovn-chassis-2'
cleanup_multinode_resources

# Network topology
#
Expand All @@ -2612,12 +2612,14 @@ cleanup_multinode_resources_by_nodes 'ovn-chassis-1 ovn-chassis-2'
# publicp2 (ovn-chassis-4) (30.0.1.3/24)

for i in 1 2; do
ip=$(( 3 + $i ))
chassis="ovn-chassis-$i"
ip=$(m_as $c ip -4 addr show eth1 | grep inet | awk '{print $2}' | cut -d'/' -f1)
echo $chassis

multinode_setup_northd $chassis
multinode_setup_controller $chassis $chassis "170.168.0.$ip" "170.168.0.$ip"
multinode_setup_controller $chassis $chassis $ip $ip
sleep 1
m_as $chassis ovn-sbctl show

check m_as $chassis ovs-vsctl set open . external_ids:ovn-monitor-all=true
check m_as $chassis ovs-vsctl set open . external_ids:ovn-is-interconn=true
Expand Down Expand Up @@ -2694,10 +2696,10 @@ check m_as ovn-chassis-1 ovn-nbctl lsp-add public external
check m_as ovn-chassis-1 ovn-nbctl lsp-set-addresses external "00:00:00:00:20:10 192.168.100.10 1000::10"

# Add mutual chassis
check m_as ovn-chassis-1 ovn-sbctl chassis-add ovn-chassis-2 geneve 170.168.0.5
check m_as ovn-chassis-1 ovn-sbctl chassis-add ovn-chassis-2 geneve $(m_as ovn-chassis-2 ip -4 addr show eth1 | grep inet | awk '{print $2}' | cut -d'/' -f1)
check m_as ovn-chassis-1 ovn-sbctl set chassis ovn-chassis-2 other_config:is-remote=true

check m_as ovn-chassis-2 ovn-sbctl chassis-add ovn-chassis-1 geneve 170.168.0.4
check m_as ovn-chassis-2 ovn-sbctl chassis-add ovn-chassis-1 geneve $(m_as ovn-chassis-1 ip -4 addr show eth1 | grep inet | awk '{print $2}' | cut -d'/' -f1)
check m_as ovn-chassis-2 ovn-sbctl set chassis ovn-chassis-1 other_config:is-remote=true

# Configure ports on the transit switch as remotes
Expand All @@ -2713,6 +2715,16 @@ m_as ovn-chassis-1 /data/create_fake_vm.sh external external 00:00:00:00:20:10 1
m_as ovn-chassis-1 /data/create_fake_vm.sh pod10 pod10 00:00:00:00:10:10 1500 10.100.200.10 24 10.100.200.1 10:200::10/64 10:200::1
m_as ovn-chassis-2 /data/create_fake_vm.sh pod20 pod20 00:00:00:00:10:20 1500 10.100.200.20 24 10.100.200.1 10:200::20/64 10:200::1

echo "Chassis1"
m_as ovn-chassis-1 ovn-sbctl show
m_as ovn-chassis-1 ovn-nbctl show
m_as ovn-chassis-1 ovs-vsctl show

echo "Chassis2"
m_as ovn-chassis-2 ovn-sbctl show
m_as ovn-chassis-2 ovn-nbctl show
m_as ovn-chassis-2 ovs-vsctl show

# We cannot use any of the helpers as they assume that there is only single ovn-northd instance running
check m_as ovn-chassis-1 ovn-nbctl --wait=hv sync
OVS_WAIT_UNTIL([test -n "$(m_as ovn-chassis-1 ovn-sbctl --bare --columns _uuid find Port_Binding logical_port=external up=true)"])
Expand Down

0 comments on commit 932bb13

Please sign in to comment.