Add support for whitelist of monitored containers

This commit is contained in:
Brian DeHamer 2015-08-04 16:32:01 +00:00
parent d6321bf8dc
commit b0910ee20b
5 changed files with 60 additions and 9 deletions

View file

@ -9,6 +9,30 @@ import (
"github.com/stretchr/testify/assert"
)
func TestContainerFilter_StraightMatch(t *testing.T) {
c := newTestContainer("foo", []string{})
f := containerFilter([]string{"foo"})
assert.True(t, f(c))
}
func TestContainerFilter_SlashMatch(t *testing.T) {
c := newTestContainer("/foo", []string{})
f := containerFilter([]string{"foo"})
assert.True(t, f(c))
}
func TestContainerFilter_NoMatch(t *testing.T) {
c := newTestContainer("/bar", []string{})
f := containerFilter([]string{"foo"})
assert.False(t, f(c))
}
func TestContainerFilter_NoFilters(t *testing.T) {
c := newTestContainer("/bar", []string{})
f := containerFilter([]string{})
assert.True(t, f(c))
}
func TestCheckDependencies(t *testing.T) {
cs := []container.Container{
newTestContainer("1", []string{}),