Skip to content

Commit

Permalink
tests/network-ovn: Add MicroOVN as a backend for the network-ovn te…
Browse files Browse the repository at this point in the history
…st suite

Signed-off-by: Gabriel Mougard <[email protected]>
  • Loading branch information
gabrielmougard committed Oct 30, 2024
1 parent cd985c3 commit 8fdf536
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 12 deletions.
1 change: 1 addition & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ jobs:
- interception
- network-bridge-firewall
- network-ovn
- network-ovn "microovn" "22.03/stable"
- network-routed
- pylxd
- snapd
Expand Down
41 changes: 29 additions & 12 deletions tests/network-ovn
Original file line number Diff line number Diff line change
@@ -1,25 +1,42 @@
#!/bin/bash
set -eux

# Install dependencies
install_deps ovn-host ovn-central bind9-dnsutils jq

# Install LXD
install_lxd

# Configure OVN.
ovs-vsctl set open_vswitch . \
external_ids:ovn-remote=unix:/var/run/ovn/ovnsb_db.sock \
external_ids:ovn-encap-type=geneve \
external_ids:ovn-encap-ip=127.0.0.1

# Empty controller log so ACL log checks are consistent over repeat runs.
echo "" > /var/log/ovn/ovn-controller.log

# Configure LXD.
lxc project switch default
lxc storage create default zfs

# If the first parameter is "microovn", we use the MicroOVN snap as a backend for the tests.
if [ "$#" -gt 0 ] && [ "$1" = "microovn" ]; then
if [ -n "$2" ]; then
microovn_channel="$2"
shift 1
else
microovn_channel="latest/stable"
fi

snap install microovn --channel="${microovn_channel}"
microovn cluster bootstrap
snap restart microovn
microovnAddr=$(microovn cluster list --format json | jq -r '.[0].address | split(":") | first')
lxc config set network.ovn.northbound_connection ssl:${microovnAddr}:6641

Check warning

Code scanning / shellcheck

SC2086 Warning test

Double quote to prevent globbing and word splitting.
shift 1
else
# Install dependencies
install_deps ovn-host ovn-central bind9-dnsutils jq

# Configure OVN.
ovs-vsctl set open_vswitch . \
external_ids:ovn-remote=unix:/var/run/ovn/ovnsb_db.sock \
external_ids:ovn-encap-type=geneve \
external_ids:ovn-encap-ip=127.0.0.1

# Empty controller log so ACL log checks are consistent over repeat runs.
echo "" > /var/log/ovn/ovn-controller.log
fi

# XXX: known DNS resolution on for .lxd domain with 24.04 instances
IMAGE="${TEST_IMG:-ubuntu-daily:22.04}"

Expand Down

0 comments on commit 8fdf536

Please sign in to comment.