e2e: test Peer validation

This commit adds an e2e test that ensures that invalid Kilo Peers are
rejected thanks to the improved OpenAPI v3 validation.

Signed-off-by: Lucas Servén Marín <lserven@gmail.com>
This commit is contained in:
Lucas Servén Marín 2021-06-16 10:46:22 +02:00
parent 941eabb605
commit 6193210d85
No known key found for this signature in database
GPG Key ID: 586FEAF680DA74AD

View File

@ -181,6 +181,14 @@ test_fullmesh_peer() {
check_peer wg1 e2e 10.5.0.1/32 full
}
test_reject_peer_empty_allowed_ips() {
assert_fail "create_peer e2e '' 0 foo" "should not be able to create Peer with empty allowed IPs"
}
test_reject_peer_empty_public_key() {
assert_fail "create_peer e2e 10.5.0.1/32 0 ''" "should not be able to create Peer with empty public key"
}
teardown_suite () {
$KIND_BINARY delete clusters $KIND_CLUSTER
}