File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -1044,6 +1044,13 @@ is_fw_port_format_valid() {
10441044 fi
10451045}
10461046
1047+ # DNS record id validator
1048+ is_id_format_valid () {
1049+ if ! echo " $1 " | grep -qE ' ^[1-9][0-9]{0,}$' ; then
1050+ check_result " $E_INVALID " " invalid $2 format :: $1 "
1051+ fi
1052+ }
1053+
10471054# Integer validator
10481055is_int_format_valid () {
10491056 if ! [[ " $1 " =~ ^[0-9]+$ ]]; then
@@ -1210,7 +1217,7 @@ is_format_valid() {
12101217 hash) is_hash_format_valid " $arg " " $arg_name " ;;
12111218 host) is_object_format_valid " $arg " " $arg_name " ;;
12121219 hour) is_cron_format_valid " $arg " $arg_name ;;
1213- id) is_int_format_valid " $arg " ' id' ;;
1220+ id) is_id_format_valid " $arg " ' id' ;;
12141221 iface) is_interface_format_valid " $arg " ;;
12151222 ip) is_ip_format_valid " $arg " ;;
12161223 ipv6) is_ipv6_format_valid " $arg " ;;
Original file line number Diff line number Diff line change @@ -1312,6 +1312,11 @@ function check_ip_not_banned(){
13121312 refute_output
13131313}
13141314
1315+ @test " DNS: Add domain record *.domain.com with ID 0" {
1316+ run v-add-dns-record $user $domain ' *' A 198.18.0.125 ' ' 0
1317+ assert_failure $E_INVALID
1318+ }
1319+
13151320@test " DNS: Change DNS record" {
13161321 run v-change-dns-record $user $domain 20 test A 198.18.0.125 " " " " 1500
13171322 assert_success
You can’t perform that action at this time.
0 commit comments