Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
aos
GitHub Repository: aos/grafana-agent
Path: blob/main/pkg/integrations/v2/apache_http/apache_http_test.go
5290 views
1
package apache_http
2
3
import (
4
"fmt"
5
"testing"
6
7
integrations_v2 "github.com/grafana/agent/pkg/integrations/v2"
8
"github.com/stretchr/testify/require"
9
)
10
11
func TestApacheHttp_Identifier(t *testing.T) {
12
globals := integrations_v2.Globals{}
13
hosts := []string{"localhost", "localhost:8080", "10.0.0.1", "10.0.0.1:8080"}
14
15
for _, host := range hosts {
16
cfg := Config{
17
ApacheAddr: fmt.Sprintf("http://%s/server-status?auto", host),
18
}
19
20
id, err := cfg.Identifier(globals)
21
require.NoError(t, err)
22
require.Equal(t, id, host)
23
}
24
}
25
26