mirror of
https://github.com/buger/goreplay.git
synced 2024-04-21 12:32:02 +00:00
capture test
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
package capture
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestSetInterfaces(t *testing.T) {
|
||||
listener := &Listener{
|
||||
loopIndex: 99999,
|
||||
}
|
||||
listener.setInterfaces()
|
||||
|
||||
for _, nic := range listener.Interfaces {
|
||||
if (len(nic.Addresses)) == 0 {
|
||||
t.Errorf("nic %s was captured with 0 addresses", nic.Name)
|
||||
}
|
||||
}
|
||||
|
||||
if listener.loopIndex == 99999 {
|
||||
t.Errorf("loopback nic index was not found")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user