Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Oct 19, 2022

Conversation

srebhan
Copy link
Contributor

@srebhan srebhan commented Oct 19, 2022

This PR skips the inputs.conntrack tests for machines where the conntrack kernel module is not loaded. In those cases tests currently fail with

plugins/inputs/conntrack# go test -v -race
=== RUN   TestNoFilesFound
--- PASS: TestNoFilesFound (0.00s)
=== RUN   TestDefaultsUsed
--- PASS: TestDefaultsUsed (0.00s)
=== RUN   TestConfigsUsed
--- PASS: TestConfigsUsed (0.00s)
=== RUN   TestCollectStats
    conntrack_test.go:131: 
                Error Trace:    /home/sven/Development/InfluxData/telegraf/plugins/inputs/conntrack/conntrack_test.go:131
                Error:          Received unexpected error:
                                Conntrack input failed to collect metrics. Is the conntrack kernel module loaded?
                Test:           TestCollectStats
    panic.go:540: PASS: NetConntrack(bool)
--- FAIL: TestCollectStats (0.00s)
=== RUN   TestCollectStatsPerCpu
    conntrack_test.go:217: 
                Error Trace:    /home/sven/Development/InfluxData/telegraf/plugins/inputs/conntrack/conntrack_test.go:217
                Error:          Received unexpected error:
                                Conntrack input failed to collect metrics. Is the conntrack kernel module loaded?
                Test:           TestCollectStatsPerCpu
    panic.go:540: PASS: NetConntrack(bool)
--- FAIL: TestCollectStatsPerCpu (0.00s)
FAIL
exit status 1
FAIL    github.com/influxdata/telegraf/plugins/inputs/conntrack 0.017sl

@telegraf-tiger telegraf-tiger bot added fix pr to fix corresponding bug plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins labels Oct 19, 2022
@telegraf-tiger
Copy link
Contributor

@MyaLongmire MyaLongmire merged commit 4002abb into influxdata:master Oct 19, 2022
dba-leshop pushed a commit to dba-leshop/telegraf that referenced this pull request Oct 30, 2022
@srebhan srebhan deleted the contrack_test_fix branch November 7, 2022 11:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix pr to fix corresponding bug plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants