Skip to content

Commit

Permalink
more negative tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jakedoublev committed Nov 20, 2024
1 parent 750b97e commit 53850cf
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions e2e/kas-registry.bats
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,26 @@ teardown() {
done
}

@test "create KAS registration with duplicate URI - fails" {
URI="https://testing-duplication.io"
run_otdfctl_kasr create --uri "$URI" -r "$REMOTE_KEY"
assert_success
run_otdfctl_kasr create --uri "$URI" -r "$REMOTE_KEY"
assert_failure
assert_output --partial "Failed to create Registered KAS entry"
assert_output --partial "AlreadyExists"
}

@test "create KAS registration with duplicate name - fails" {
NAME="duplicate_name_kas"
run_otdfctl_kasr create --uri "https://testing-duplication.name.io" -r "$REMOTE_KEY" -n "$NAME"
assert_success
run_otdfctl_kasr create --uri "https://testing-duplication.name.net" -r "$REMOTE_KEY" -n "$NAME"
assert_failure
assert_output --partial "Failed to create Registered KAS entry"
assert_output --partial "AlreadyExists"
}

@test "create KAS registration with invalid name - fails" {
URI="http://creating.kas.invalid.name/kas"
BAD_NAMES=(
Expand Down

0 comments on commit 53850cf

Please sign in to comment.