Fix powerdns input test (#4554)

This commit is contained in:
dupondje 2018-08-14 22:35:39 +02:00 committed by Greg
parent 3268937c47
commit 763dc6990c
1 changed files with 2 additions and 5 deletions

View File

@ -1,8 +1,6 @@
package powerdns
import (
"crypto/rand"
"encoding/binary"
"fmt"
"net"
"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
var randomNumber int64
binary.Read(rand.Reader, binary.LittleEndian, &randomNumber)
randomNumber := int64(5239846799706671610)
socket, err := net.Listen("unix", fmt.Sprintf("/tmp/pdns%d.controlsocket", randomNumber))
if err != nil {
t.Fatal("Cannot initialize server on port ")