Просмотр исходного кода

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 4 лет назад
Родитель
Сommit
6193210d85
1 измененных файлов с 8 добавлено и 0 удалено
  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
 }