mirror of https://github.com/vishvananda/netlink
18 lines
388 B
Go
18 lines
388 B
Go
package netlink
|
|
|
|
import (
|
|
"testing"
|
|
"time"
|
|
)
|
|
|
|
func TestSetGetSocketTimeout(t *testing.T) {
|
|
timeout := 10 * time.Second
|
|
if err := SetSocketTimeout(10 * time.Second); err != nil {
|
|
t.Fatalf("Set socket timeout for default handle failed: %v", err)
|
|
}
|
|
|
|
if val := GetSocketTimeout(); val != timeout {
|
|
t.Fatalf("Unexpected socket timeout value: got=%v, expected=%v", val, timeout)
|
|
}
|
|
}
|