mirror of
https://github.com/prometheus/node_exporter.git
synced 2024-12-31 16:37:31 -08:00
Signed-off-by: Christian Hoffmann <mail@hoffmann-christian.info>
This commit is contained in:
parent
80a5712b97
commit
6bdc5558ec
|
@ -109,8 +109,8 @@ func TestSystemdCollectorDoesntCrash(t *testing.T) {
|
||||||
|
|
||||||
func TestSystemdIgnoreFilter(t *testing.T) {
|
func TestSystemdIgnoreFilter(t *testing.T) {
|
||||||
fixtures := getUnitListFixtures()
|
fixtures := getUnitListFixtures()
|
||||||
whitelistPattern := regexp.MustCompile("foo")
|
whitelistPattern := regexp.MustCompile("^foo$")
|
||||||
blacklistPattern := regexp.MustCompile("bar")
|
blacklistPattern := regexp.MustCompile("^bar$")
|
||||||
filtered := filterUnits(fixtures[0], whitelistPattern, blacklistPattern)
|
filtered := filterUnits(fixtures[0], whitelistPattern, blacklistPattern)
|
||||||
for _, unit := range filtered {
|
for _, unit := range filtered {
|
||||||
if blacklistPattern.MatchString(unit.Name) || !whitelistPattern.MatchString(unit.Name) {
|
if blacklistPattern.MatchString(unit.Name) || !whitelistPattern.MatchString(unit.Name) {
|
||||||
|
|
Loading…
Reference in a new issue