#!/bin/bash -ex


ovs-vsctl del-br br0 || true

echo '
---
interfaces:
- name: br0
  type: ovs-bridge
  state: absent
' | nmstatectl apply - || true

echo '
---
interfaces:
- name: br0
  type: ovs-bridge
  state: up
  bridge:
    options:
      mcast-snooping-enable: false
      stp: false
    port:
    - name: ovs0
' | nmstatectl apply -

ovs-vsctl add-port br0 test-port \
    -- set interface test-port type=internal

echo '
---
interfaces:
- name: br0
  type: ovs-bridge
  state: up
  bridge:
    options:
      mcast-snooping-enable: true
      stp: false
    port:
    - name: ovs0' | nmstatectl apply -
