Path: blob/main/component/discovery/docker/docker_test.go
4096 views
package docker12import (3"testing"45"github.com/grafana/agent/pkg/river"6"github.com/stretchr/testify/require"7)89func TestRiverConfig(t *testing.T) {10var exampleRiverConfig = `11host = "unix:///var/run/docker.sock"12`1314var args Arguments15err := river.Unmarshal([]byte(exampleRiverConfig), &args)16require.NoError(t, err)17}1819func TestBadRiverConfig(t *testing.T) {20var exampleRiverConfig = `21host = "unix:///var/run/docker.sock"22bearer_token = "token"23bearer_token_file = "/path/to/file.token"24`2526// Make sure the squashed HTTPClientConfig Validate function is being utilized correctly27var args Arguments28err := river.Unmarshal([]byte(exampleRiverConfig), &args)29require.ErrorContains(t, err, "at most one of bearer_token & bearer_token_file must be configured")30}313233