diff options
Diffstat (limited to 'collector/systemd_linux_test.go')
-rw-r--r-- | collector/systemd_linux_test.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/collector/systemd_linux_test.go b/collector/systemd_linux_test.go index 613a1ab..93137f2 100644 --- a/collector/systemd_linux_test.go +++ b/collector/systemd_linux_test.go | |||
@@ -89,11 +89,11 @@ func getUnitListFixtures() [][]unit { | |||
89 | 89 | ||
90 | func TestSystemdIgnoreFilter(t *testing.T) { | 90 | func TestSystemdIgnoreFilter(t *testing.T) { |
91 | fixtures := getUnitListFixtures() | 91 | fixtures := getUnitListFixtures() |
92 | whitelistPattern := regexp.MustCompile("^foo$") | 92 | includePattern := regexp.MustCompile("^foo$") |
93 | blacklistPattern := regexp.MustCompile("^bar$") | 93 | excludePattern := regexp.MustCompile("^bar$") |
94 | filtered := filterUnits(fixtures[0], whitelistPattern, blacklistPattern, log.NewNopLogger()) | 94 | filtered := filterUnits(fixtures[0], includePattern, excludePattern, log.NewNopLogger()) |
95 | for _, unit := range filtered { | 95 | for _, unit := range filtered { |
96 | if blacklistPattern.MatchString(unit.Name) || !whitelistPattern.MatchString(unit.Name) { | 96 | if excludePattern.MatchString(unit.Name) || !includePattern.MatchString(unit.Name) { |
97 | t.Error(unit.Name, "should not be in the filtered list") | 97 | t.Error(unit.Name, "should not be in the filtered list") |
98 | } | 98 | } |
99 | } | 99 | } |
@@ -106,7 +106,7 @@ func TestSystemdIgnoreFilterDefaultKeepsAll(t *testing.T) { | |||
106 | } | 106 | } |
107 | fixtures := getUnitListFixtures() | 107 | fixtures := getUnitListFixtures() |
108 | collector := c.(*systemdCollector) | 108 | collector := c.(*systemdCollector) |
109 | filtered := filterUnits(fixtures[0], collector.unitWhitelistPattern, collector.unitBlacklistPattern, logger) | 109 | filtered := filterUnits(fixtures[0], collector.unitIncludePattern, collector.unitExcludePattern, logger) |
110 | // Adjust fixtures by 3 "not-found" units. | 110 | // Adjust fixtures by 3 "not-found" units. |
111 | if len(filtered) != len(fixtures[0])-3 { | 111 | if len(filtered) != len(fixtures[0])-3 { |
112 | t.Error("Default filters removed units") | 112 | t.Error("Default filters removed units") |