Query the system status
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

net_bond_test.go 488B

123456789101112131415161718192021222324252627
  1. package system
  2. import (
  3. "os"
  4. "testing"
  5. )
  6. func TestBond(t *testing.T) {
  7. bonds, err := Bonds()
  8. if err != nil {
  9. if os.IsPermission(err) || os.IsNotExist(err) || err == ErrNotSupported {
  10. t.Skipf("vlan: %v", err)
  11. }
  12. t.Fatal(err)
  13. }
  14. for bond := range bonds {
  15. t.Logf("bond: %s", bond)
  16. ifaces, err := bond.Slaves()
  17. if err != nil {
  18. t.Fatal(err)
  19. }
  20. for _, iface := range ifaces {
  21. t.Logf("bond %s: slave %s,mac=%s", bond.Name, iface.Name, iface.HardwareAddr)
  22. }
  23. }
  24. }