mirror of
https://github.com/bettercap/bettercap
synced 2025-08-19 13:09:49 -07:00
add basic buildEndpointFromInterface test
This commit is contained in:
parent
b188354c33
commit
3c920397b9
1 changed files with 14 additions and 0 deletions
|
@ -46,3 +46,17 @@ func TestParseTargets(t *testing.T) {
|
||||||
t.Fatalf("expected '%d', got '%d'", 0, len(macs))
|
t.Fatalf("expected '%d', got '%d'", 0, len(macs))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestBuildEndpointFromInterface(t *testing.T) {
|
||||||
|
ifaces, err := net.Interfaces()
|
||||||
|
if err != nil {
|
||||||
|
t.Error(err)
|
||||||
|
}
|
||||||
|
if len(ifaces) <= 0 {
|
||||||
|
t.Error("Unable to find any network interfaces to run test with.")
|
||||||
|
}
|
||||||
|
_, err = buildEndpointFromInterface(ifaces[0])
|
||||||
|
if err != nil {
|
||||||
|
t.Error(err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue