Last active
July 13, 2025 21:14
-
-
Save rajeshrah22/b3a80c34586b5d661a200b43f8c68c5d to your computer and use it in GitHub Desktop.
Reproduces error on a particular issue I was working on -- replicating a CI test case that was failing because Linux bridge 'linux-br0' was not found.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| read -r -d '' LINUX_BRIDGE <<EOF | |
| interfaces: | |
| - name: eth1 | |
| type: veth | |
| state: up | |
| - name: linux-br0 | |
| type: linux-bridge | |
| state: up | |
| bridge: | |
| port: | |
| - name: eth1 | |
| EOF | |
| read -r -d '' LINUX_BRIDGE_ABSENT <<EOF | |
| interfaces: | |
| - name: eth1 | |
| type: veth | |
| state: absent | |
| - name: linux-br0 | |
| type: linux-bridge | |
| state: absent | |
| EOF | |
| create_eth1() { | |
| sudo ip link add eth1 type veth peer eth1_p | |
| } | |
| delete_eth1() { | |
| sudo ip link delete eth1 | |
| } | |
| delete_bridge() { | |
| sudo ip link delete linux-br0 | |
| } | |
| main() { | |
| sudo systemctl stop NetworkManager | |
| delete_bridge | |
| delete_eth1 | |
| create_eth1 | |
| if ! (echo "$LINUX_BRIDGE" | sudo ./rust/target/debug/nmstatectl apply -k -); then | |
| echo "apply failed" | |
| fi | |
| echo "sleeping 3 ..." | |
| sleep 3 | |
| echo "$LINUX_BRIDGE_ABSENT" | sudo ./rust/target/debug/nmstatectl apply -k - | |
| } | |
| main |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment