mirror of
https://github.com/juanfont/headscale.git
synced 2026-10-28 09:16:50 +09:00
Added small integration test for stun
This commit is contained in:
1 parent
03452a8dca
commit
cc0c88a63a
4 files changed
+21
No files matched your search
@@ -23,6 +23,8 @@ import (
|
||||
"github.com/ory/dockertest/v3/docker"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/suite"
|
||||
|
||||
"github.com/ccding/go-stun/stun"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -382,3 +384,13 @@ func (s *IntegrationDERPTestSuite) TestPingAllPeersByHostname() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (s *IntegrationDERPTestSuite) TestDERPSTUN() {
|
||||
headscaleSTUNAddr := fmt.Sprintf("localhost:%s", s.headscale.GetPort("3478/udp"))
|
||||
client := stun.NewClient()
|
||||
client.SetVerbose(true)
|
||||
client.SetVVerbose(true)
|
||||
client.SetServerAddr(headscaleSTUNAddr)
|
||||
_, _, err := client.Discover()
|
||||
assert.Nil(s.T(), err)
|
||||
}
|
||||
Reference in new issue
Block a user