-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: replace --wait by a tcp-based connection try
- Loading branch information
Showing
2 changed files
with
31 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -151,18 +151,31 @@ EOS | |
json '.value|.[]|select(.ip=="127.1.2.3")|.forceKey' "$key1fp" | ||
json '.value|.[]|select(.ip=="127.1.2.3")|.user' "ar@base" | ||
|
||
# try to use the force key | ||
# try to use the force key AND --wait | ||
|
||
run a1_connect_g1_with_forcekey $a1 ar@[email protected] -- false | ||
run a1_connect_g1_with_forcekey_and_wait $a1 --wait ar@[email protected] -- false | ||
contain 'Connecting...' | ||
contain 'FORCED IN ACL' | ||
contain "$key1fp" | ||
nocontain "$key0fp" | ||
contain "Waiting for port 22 to be open on " | ||
contain REGEX "Alive after waiting for [0-9] seconds" | ||
|
||
success a1_remove_forcekey_acl_g1 $a1 --osh groupDelServer --host 127.1.2.3 --user 'ar@base' --port-any --group $group1 | ||
|
||
# /force-key | ||
|
||
success a1_add_non_routable_ip $a1 --osh groupAddServer --host 192.0.2.0 --user-any --port-any --force --group $group1 | ||
|
||
run a1_ssh_wait $a1 --wait 192.0.2.0 | ||
retvalshouldbe 124 # timeout | ||
contain "Waiting for port 22 to be open on 192.0.2.0" | ||
contain "Still trying to connect to 192.0.2.0:22 after 10 seconds" | ||
|
||
success a1_remove_non_routable_ip $a1 --osh groupDelServer --host 192.0.2.0 --user-any --port-any --group $group1 | ||
|
||
# test --alive | ||
|
||
run a0_del_key_g1 $a0 --osh groupDelEgressKey --group $group1 --id $key1id | ||
retvalshouldbe 106 | ||
json .command null .error_code KO_RESTRICTED_COMMAND .value null | ||
|