|
|
@ -10,12 +10,14 @@ import (
|
|
|
|
crand "crypto/rand"
|
|
|
|
crand "crypto/rand"
|
|
|
|
"crypto/tls"
|
|
|
|
"crypto/tls"
|
|
|
|
"encoding/binary"
|
|
|
|
"encoding/binary"
|
|
|
|
|
|
|
|
"encoding/json"
|
|
|
|
"fmt"
|
|
|
|
"fmt"
|
|
|
|
"io/ioutil"
|
|
|
|
"io/ioutil"
|
|
|
|
"net"
|
|
|
|
"net"
|
|
|
|
"net/http"
|
|
|
|
"net/http"
|
|
|
|
"net/http/httptest"
|
|
|
|
"net/http/httptest"
|
|
|
|
"os"
|
|
|
|
"os"
|
|
|
|
|
|
|
|
"strconv"
|
|
|
|
"strings"
|
|
|
|
"strings"
|
|
|
|
"sync"
|
|
|
|
"sync"
|
|
|
|
"testing"
|
|
|
|
"testing"
|
|
|
@ -927,7 +929,7 @@ func testTwoDevicePing(t *testing.T, d *devices) {
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
// TODO: Remove this once the following tests are reliable.
|
|
|
|
// TODO: Remove this once the following tests are reliable.
|
|
|
|
if os.Getenv("RUN_CURSED_TESTS") == "" {
|
|
|
|
if run, _ := strconv.ParseBool(os.Getenv("RUN_CURSED_TESTS")); !run {
|
|
|
|
t.Skip("skipping following tests because RUN_CURSED_TESTS is not set.")
|
|
|
|
t.Skip("skipping following tests because RUN_CURSED_TESTS is not set.")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1025,10 +1027,8 @@ func testTwoDevicePing(t *testing.T, d *devices) {
|
|
|
|
defer setT(outerT)
|
|
|
|
defer setT(outerT)
|
|
|
|
defer func() {
|
|
|
|
defer func() {
|
|
|
|
if t.Failed() || true {
|
|
|
|
if t.Failed() || true {
|
|
|
|
uapi1, _ := cfgs[0].ToUAPI()
|
|
|
|
logf("cfg0: %v", stringifyConfig(cfgs[0]))
|
|
|
|
logf("cfg0: %v", uapi1)
|
|
|
|
logf("cfg1: %v", stringifyConfig(cfgs[1]))
|
|
|
|
uapi2, _ := cfgs[1].ToUAPI()
|
|
|
|
|
|
|
|
logf("cfg1: %v", uapi2)
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}()
|
|
|
|
}()
|
|
|
|
pingSeq(t, 20, 0, true)
|
|
|
|
pingSeq(t, 20, 0, true)
|
|
|
@ -1314,3 +1314,11 @@ func TestDiscoStringLogRace(t *testing.T) {
|
|
|
|
}()
|
|
|
|
}()
|
|
|
|
wg.Wait()
|
|
|
|
wg.Wait()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func stringifyConfig(cfg wgcfg.Config) string {
|
|
|
|
|
|
|
|
j, err := json.Marshal(cfg)
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
panic(err)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return string(j)
|
|
|
|
|
|
|
|
}
|
|
|
|