Skip to content

Commit

Permalink
moe testdata to examples, add add additional tests
Browse files Browse the repository at this point in the history
  • Loading branch information
garethr committed Apr 19, 2019
1 parent d51b528 commit 5d865c9
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 7 deletions.
14 changes: 12 additions & 2 deletions acceptance.bats
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
#!/usr/bin/env bats

@test "Fail when testing an invalid service" {
run conftest testdata/service.yaml
@test "Not fail when testing a service with a warning" {
run conftest -p examples/kubernetes/policy examples/kubernetes/service.yaml
[ "$status" -eq 0 ]
}

@test "Fail when testing a deployment with root containers" {
run conftest -p examples/kubernetes/policy examples/kubernetes/deployment.yaml
[ "$status" -eq 1 ]
}

@test "Fail when testing a service with warnings" {
run conftest --fail-on-warn -p examples/kubernetes/policy examples/kubernetes/service.yaml
[ "$status" -eq 1 ]
}
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,3 @@ warn[msg] {
input.kind = "Service"
msg = "Services are not allowed"
}

warn[msg] {
input.kind = "Deployment"
msg = "Deployments are not allowed"
}
File renamed without changes.
File renamed without changes.

0 comments on commit 5d865c9

Please sign in to comment.