-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add raw validation policy (waPC) e2e test
Signed-off-by: Fabrizio Sestito <fabrizio.sestito@suse.com>
- Loading branch information
1 parent
59c9296
commit 231cf82
Showing
3 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Raw policies execution | ||
|
||
testcases: | ||
- name: fixtures | ||
steps: | ||
- type: readfile | ||
path: ./test_data/raw.json | ||
assertions: | ||
- result.err ShouldBeEmpty | ||
vars: | ||
raw_valid: | ||
from: result.content | ||
|
||
- name: Raw waPC policy validation works as expected | ||
steps: | ||
- name: Accept | ||
type: http | ||
method: POST | ||
url: http://localhost:3000/validate_raw/raw-validation | ||
headers: | ||
Content-Type: application/json | ||
body: "{{ .fixtures.raw_valid }}" | ||
assertions: | ||
- result.statuscode ShouldEqual 200 | ||
- result.bodyjson.response.allowed ShouldEqual true | ||
- result.bodyjson.response.status.code ShouldNotEqual 500 | ||
- result.bodyjson.response ShouldNotContainKey patch | ||
- result.bodyjson.response ShouldNotContainKey patchType |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"request": { "user": "tonio", "action": "likes", "resource": "hay" } | ||
} |