Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

Commit

Permalink
Test for #988 - Plugins with multiple config policy nodes may cause a…
Browse files Browse the repository at this point in the history
… panic
  • Loading branch information
tiffanyfay committed Jun 16, 2016
1 parent 98517bb commit e04e96e
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion pkg/ctree/tree_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ func TestConfigTree(t *testing.T) {
So(g, ShouldNotBeNil)
})

Convey("get is inbetween two nodes in tree", func() {
Convey("get is in between two nodes in tree", func() {
d1 := newMockNode()
d1.data = "a"
d2 := newMockNode()
Expand All @@ -219,6 +219,21 @@ func TestConfigTree(t *testing.T) {
}, ShouldPanic)
})

Convey("doesn't panic on ns where the root and ns don't have a policy", func() {
d1 := newMockNode()
d1.data = "a"
d2 := newMockNode()
d2.data = "b"
c := New()
c.Add([]string{"intel", "foo", "sdi-x", "cody"}, d1)
c.Add([]string{"intel", "foo", "sdi-x", "nan"}, d2)
c.Freeze()
So(func() {
g := c.Get([]string{"intel", "foo", "sdi-x", "emily", "tiffany", "matt"})
So(g, ShouldBeNil)
}, ShouldNotPanic)
})

Convey("doesn't panic on empty ns", func() {
d1 := newMockNode()
d1.data = "a"
Expand Down

0 comments on commit e04e96e

Please sign in to comment.