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

Add testing for OVN uplink attached to VLAN #302

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

boltmark
Copy link
Contributor

@boltmark boltmark commented Oct 3, 2024

This PR adds testing for when an OVN uplink network is attached to a VLAN.

Setting as draft until this feature is in latest edge.

Signed-off-by: Mark Bolton <mark.bolton@canonical.com>
ovn-nbctl --bare --format=csv --columns=type,tag find logical_switch_port | grep -F "localnet,10"

echo "==> Ensure OVS configured to accept VLAN traffic"
uplink_port=$(ovs-vsctl show | grep "Bridge lxdovn" | awk '{print $2"b"}')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

grep's not strictly needed as awk can do string matching too:

Suggested change
uplink_port=$(ovs-vsctl show | grep "Bridge lxdovn" | awk '{print $2"b"}')
uplink_port=$(ovs-vsctl show | awk '/Bridge lxdovn/ {print $2"b"}')


lxc config device set c1-lxdbr0 eth0 vlan=10
lxc exec c1-lxdbr0 -- ip addr add 10.10.10.100/24 dev eth0
lxc exec c1-lxdbr0 -- ip link set dev eth0 up
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my tests, the device remains up even after adding the vlan=10 config so this should not be needed.


lxc exec c1-ovn -- ping -nc1 -4 -w5 10.10.10.100

lxc rm -f c1-lxdbr0 c1-ovn
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
lxc rm -f c1-lxdbr0 c1-ovn
lxc delete -f c1-lxdbr0 c1-ovn

We try not to use command aliases.

lxc exec c1-lxdbr0 -- ip route add default via 10.10.10.1
sleep 5

lxc exec c1-ovn -- ping -nc1 -4 -w5 10.10.10.100
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to see a ping from c1-lxdbr0 to c1-ovn. This will likely require getting c1-ovn's IP with lxc list -c 4 -f csv c1-ovn | cut -d " " -f1 (or similar) as DNS won't work.

@@ -2096,6 +2096,51 @@ ovn_leases_tests() {
lxc network delete lxdbr0
}

ovn_vlan_uplink_tests() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test will need to be called (at the bottom of the script) if the right API extension is detected. See hasNeededAPIExtension in bin/helpers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants