Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests/network-ovn: Add MicroOVN as a backend for network-ovn test suite #330

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 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 Expand Up @@ -134,6 +135,8 @@ jobs:
track: "4.0/edge"
- test: network-ovn
track: "4.0/edge"
- test: network-ovn "microovn" "22.03/stable"
track: "4.0/edge"
- test: storage-buckets
track: "4.0/edge"
- test: storage-disks-vm
Expand Down
46 changes: 34 additions & 12 deletions tests/network-ovn
Original file line number Diff line number Diff line change
@@ -1,25 +1,47 @@
#!/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

# Install generic dependencies
install_deps bind9-dnsutils jq

# 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
simondeziel marked this conversation as resolved.
Show resolved Hide resolved

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"
simondeziel marked this conversation as resolved.
Show resolved Hide resolved
snap alias microovn.ovn-nbctl ovn-nbctl
snap alias microovn.ovs-vsctl ovs-vsctl
simondeziel marked this conversation as resolved.
Show resolved Hide resolved
shift 1
else
# Install OVN dependencies
install_deps ovn-host ovn-central

# 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
Loading