tests: Use opts.identites_non_exp not opts.identities

The configuration of identities are first saved to `opts.identities_non_exp`,
then moved to `opts.identities` after calling ssh_options_apply and expanding
the identity strings. These tests are testing against the proper configuration

Signed-off-by: Norbert Pocs <npocs@redhat.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
This commit is contained in:
Norbert Pocs
2022-11-16 11:03:30 +01:00
committed by Jakub Jelen
parent 1ff893c914
commit 87d694d5ad
4 changed files with 12 additions and 11 deletions

View File

@@ -715,7 +715,7 @@ static void torture_auth_agent_identities_only(void **state)
assert_int_equal(rc, SSH_OK);
/* Remove the default identities */
while ((id = ssh_list_pop_head(char *, session->opts.identity)) != NULL) {
while ((id = ssh_list_pop_head(char *, session->opts.identity_non_exp)) != NULL) {
SAFE_FREE(id);
}
@@ -772,7 +772,7 @@ static void torture_auth_agent_identities_only_protected(void **state)
assert_int_equal(rc, SSH_OK);
/* Remove the default identities */
while ((id = ssh_list_pop_head(char *, session->opts.identity)) != NULL) {
while ((id = ssh_list_pop_head(char *, session->opts.identity_non_exp)) != NULL) {
SAFE_FREE(id);
}

View File

@@ -196,7 +196,7 @@ static void torture_auth_autopubkey(void **state, const char *obj_name, const ch
rc = ssh_options_set(session, SSH_OPTIONS_IDENTITY, priv_uri);
assert_int_equal(rc, SSH_OK);
assert_string_equal(session->opts.identity->root->data, priv_uri);
assert_string_equal(session->opts.identity_non_exp->root->data, priv_uri);
rc = ssh_connect(session);
assert_int_equal(rc, SSH_OK);