Fix powerdns input test (#4554)
This commit is contained in:
parent
3268937c47
commit
763dc6990c
|
@ -1,8 +1,6 @@
|
||||||
package powerdns
|
package powerdns
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"crypto/rand"
|
|
||||||
"encoding/binary"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"net"
|
"net"
|
||||||
"testing"
|
"testing"
|
||||||
|
@ -70,10 +68,9 @@ func (s statServer) serverSocket(l net.Listener) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestMemcachedGeneratesMetrics(t *testing.T) {
|
func TestPowerdnsGeneratesMetrics(t *testing.T) {
|
||||||
// We create a fake server to return test data
|
// We create a fake server to return test data
|
||||||
var randomNumber int64
|
randomNumber := int64(5239846799706671610)
|
||||||
binary.Read(rand.Reader, binary.LittleEndian, &randomNumber)
|
|
||||||
socket, err := net.Listen("unix", fmt.Sprintf("/tmp/pdns%d.controlsocket", randomNumber))
|
socket, err := net.Listen("unix", fmt.Sprintf("/tmp/pdns%d.controlsocket", randomNumber))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal("Cannot initialize server on port ")
|
t.Fatal("Cannot initialize server on port ")
|
||||||
|
|
Loading…
Reference in New Issue