mirror of
https://github.com/cloudnativelabs/kube-router.git
synced 2025-10-13 10:51:05 +02:00
27 lines
451 B
Go
27 lines
451 B
Go
package rtlink
|
|
|
|
import (
|
|
"github.com/hkwi/nlgo"
|
|
"testing"
|
|
)
|
|
|
|
func TestLo(t *testing.T) {
|
|
if hub, err := nlgo.NewRtHub(); err != nil {
|
|
t.Error(err)
|
|
} else if info, err := GetByName(hub, "lo"); err != nil {
|
|
t.Error(err)
|
|
} else {
|
|
t.Log(info)
|
|
}
|
|
}
|
|
|
|
func TestIdx(t *testing.T) {
|
|
if hub, err := nlgo.NewRtHub(); err != nil {
|
|
t.Error(err)
|
|
} else if name, err := GetNameByIndex(hub, 1); err != nil {
|
|
t.Error(err)
|
|
} else {
|
|
t.Log(name)
|
|
}
|
|
}
|