fix(inputs.conntrack): Skip gather tests if conntrack kernel module is not loaded. (#12062)

This commit is contained in:
Sven Rebhan 2022-10-19 22:08:33 +02:00 committed by GitHub
parent f38c9f2a45
commit 4002abba2e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -128,6 +128,9 @@ func TestCollectStats(t *testing.T) {
cs.Collect = []string{"all"}
err := cs.Gather(&acc)
if err != nil && strings.Contains(err.Error(), "Is the conntrack kernel module loaded?") {
t.Skip("Conntrack kernel module not loaded.")
}
require.NoError(t, err)
expectedTags := map[string]string{
@ -214,6 +217,9 @@ func TestCollectStatsPerCpu(t *testing.T) {
cs.Collect = []string{"all", "percpu"}
err := cs.Gather(&acc)
if err != nil && strings.Contains(err.Error(), "Is the conntrack kernel module loaded?") {
t.Skip("Conntrack kernel module not loaded.")
}
require.NoError(t, err)
//cpu0