Explorar o código

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>
Lucas Servén Marín %!s(int64=5) %!d(string=hai) anos
pai
achega
6193210d85
Modificáronse 1 ficheiros con 8 adicións e 0 borrados
  1. 8 0
      e2e/kind.sh

+ 8 - 0
e2e/kind.sh

@@ -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
 }