Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions e2e/subject-mapping.bats
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,19 @@ teardown_file() {
}

@test "Update a subject mapping" {
created=$(./otdfctl $HOST $WITH_CREDS policy sm create -a "$SM_VAL1_ID" --action "$ACTION_READ_NAME" --subject-condition-set-new "$SCS_1" --json | jq -r '.id')
additional_scs=$(./otdfctl $HOST $WITH_CREDS policy scs create -s "$SCS_2" --json | jq -r '.id')
run ./otdfctl $HOST $WITH_CREDS policy sm create -a "$SM_VAL1_ID" --action "$ACTION_READ_NAME" --subject-condition-set-new "$SCS_1" --json
created=$(echo "$output" | jq -r '.id')
assert [ "$created" != "null" ]
assert [ -n "$created" ]

# Create additional SCS and verify it was created successfully
run ./otdfctl $HOST $WITH_CREDS policy scs create -s "$SCS_2" --json
assert_success
additional_scs=$(echo "$output" | jq -r '.id')
assert [ "$additional_scs" != "null" ]
assert [ -n "$additional_scs" ]



# replace the action (always destructive replacement)
run_otdfctl_sm update --id "$created" --action "$ACTION_CREATE_NAME" --json
Expand All @@ -130,6 +141,8 @@ teardown_file() {
assert_success
[ "$(echo $output | jq -r '.id')" = "$created" ]
[ "$(echo $output | jq -r '.subject_condition_set.id')" = "$additional_scs" ]
# Add debug log for DSPX-1873
echo "$output" >&2
}

@test "List subject mappings" {
Expand Down
Loading