2017-12-31 04:26:17 +00:00
|
|
|
package data
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestNodeinfoBatAddresses(t *testing.T) {
|
|
|
|
assert := assert.New(t)
|
2017-12-05 22:17:49 +00:00
|
|
|
iface := &NetworkInterface{
|
2017-12-31 04:26:17 +00:00
|
|
|
Interfaces: struct {
|
|
|
|
Wireless []string `json:"wireless,omitempty"`
|
|
|
|
Other []string `json:"other,omitempty"`
|
|
|
|
Tunnel []string `json:"tunnel,omitempty"`
|
|
|
|
}{
|
|
|
|
Wireless: nil,
|
|
|
|
Other: []string{"aa:aa:aa:aa:aa", "aa:aa:aa:aa:ab"},
|
|
|
|
Tunnel: []string{},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
2017-12-05 22:17:49 +00:00
|
|
|
addr := iface.Addresses()
|
2017-12-31 04:26:17 +00:00
|
|
|
assert.NotNil(addr)
|
|
|
|
assert.Equal([]string{"aa:aa:aa:aa:aa", "aa:aa:aa:aa:ab"}, addr)
|
|
|
|
}
|