class Inspec::Resources::LinuxBridge

@see unix.stackexchange.com/questions/40560/how-to-know-if-a-network-interface-is-tap-tun-bridge-or-physical<br>@see www.tldp.org/HOWTO/BRIDGE-STP-HOWTO/set-up-the-bridge.html<br>/sys/class/net/{interface}/brif contains the network interfaces
If /sys/class/net/{interface}/bridge exists then it must be a bridge
Linux Bridge

def bridge_info(bridge_name)

def bridge_info(bridge_name)
  # read bridge information
  bridge = inspec.file("/sys/class/net/#{bridge_name}/bridge").directory?
  return nil unless bridge
  # load interface names
  interfaces = inspec.command("ls -1 /sys/class/net/#{bridge_name}/brif/")
  interfaces = interfaces.stdout.chomp.split("\n")
  {
    name: bridge_name,
    interfaces: interfaces,
  }
end