Skip to content

Commit

Permalink
bootstrap-shutdown-cb: AUTH edition (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
graebm committed Dec 10, 2019
1 parent 0a19fc8 commit 27bc11d
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 8 deletions.
12 changes: 10 additions & 2 deletions tests/credentials_provider_imds_tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,11 @@ static int s_credentials_provider_imds_real_new_destroy(struct aws_allocator *al
struct aws_host_resolver resolver;
aws_host_resolver_init_default(&resolver, allocator, 8, &el_group);

struct aws_client_bootstrap *bootstrap = aws_client_bootstrap_new(allocator, &el_group, &resolver, NULL);
struct aws_client_bootstrap_options bootstrap_options = {
.event_loop_group = &el_group,
.host_resolver = &resolver,
};
struct aws_client_bootstrap *bootstrap = aws_client_bootstrap_new(allocator, &bootstrap_options);

struct aws_credentials_provider_imds_options options = {
.bootstrap = bootstrap,
Expand Down Expand Up @@ -805,7 +809,11 @@ static int s_credentials_provider_imds_real_success(struct aws_allocator *alloca
struct aws_host_resolver resolver;
aws_host_resolver_init_default(&resolver, allocator, 8, &el_group);

struct aws_client_bootstrap *bootstrap = aws_client_bootstrap_new(allocator, &el_group, &resolver, NULL);
struct aws_client_bootstrap_options bootstrap_options = {
.event_loop_group = &el_group,
.host_resolver = &resolver,
};
struct aws_client_bootstrap *bootstrap = aws_client_bootstrap_new(allocator, &bootstrap_options);

struct aws_credentials_provider_imds_options options = {
.bootstrap = bootstrap,
Expand Down
36 changes: 30 additions & 6 deletions tests/credentials_provider_sts_tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,11 @@ static int s_credentials_provider_sts_direct_config_succeeds_fn(struct aws_alloc
struct aws_host_resolver resolver;
aws_host_resolver_init_default(&resolver, allocator, 10, &el_group);

struct aws_client_bootstrap *bootstrap = aws_client_bootstrap_new(allocator, &el_group, &resolver, NULL);
struct aws_client_bootstrap_options bootstrap_options = {
.event_loop_group = &el_group,
.host_resolver = &resolver,
};
struct aws_client_bootstrap *bootstrap = aws_client_bootstrap_new(allocator, &bootstrap_options);

struct aws_credentials_provider_static_options static_options = {
.access_key_id = s_access_key_cur,
Expand Down Expand Up @@ -371,7 +375,11 @@ static int s_credentials_provider_sts_direct_config_invalid_doc_fn(struct aws_al
struct aws_host_resolver resolver;
aws_host_resolver_init_default(&resolver, allocator, 10, &el_group);

struct aws_client_bootstrap *bootstrap = aws_client_bootstrap_new(allocator, &el_group, &resolver, NULL);
struct aws_client_bootstrap_options bootstrap_options = {
.event_loop_group = &el_group,
.host_resolver = &resolver,
};
struct aws_client_bootstrap *bootstrap = aws_client_bootstrap_new(allocator, &bootstrap_options);

struct aws_credentials_provider_static_options static_options = {
.access_key_id = s_access_key_cur,
Expand Down Expand Up @@ -444,7 +452,11 @@ static int s_credentials_provider_sts_direct_config_connection_failed_fn(struct
struct aws_host_resolver resolver;
aws_host_resolver_init_default(&resolver, allocator, 10, &el_group);

struct aws_client_bootstrap *bootstrap = aws_client_bootstrap_new(allocator, &el_group, &resolver, NULL);
struct aws_client_bootstrap_options bootstrap_options = {
.event_loop_group = &el_group,
.host_resolver = &resolver,
};
struct aws_client_bootstrap *bootstrap = aws_client_bootstrap_new(allocator, &bootstrap_options);

struct aws_credentials_provider_static_options static_options = {
.access_key_id = s_access_key_cur,
Expand Down Expand Up @@ -500,7 +512,11 @@ static int s_credentials_provider_sts_direct_config_service_fails_fn(struct aws_
struct aws_host_resolver resolver;
aws_host_resolver_init_default(&resolver, allocator, 10, &el_group);

struct aws_client_bootstrap *bootstrap = aws_client_bootstrap_new(allocator, &el_group, &resolver, NULL);
struct aws_client_bootstrap_options bootstrap_options = {
.event_loop_group = &el_group,
.host_resolver = &resolver,
};
struct aws_client_bootstrap *bootstrap = aws_client_bootstrap_new(allocator, &bootstrap_options);

struct aws_credentials_provider_static_options static_options = {
.access_key_id = s_access_key_cur,
Expand Down Expand Up @@ -570,7 +586,11 @@ static int s_credentials_provider_sts_from_profile_config_succeeds_fn(struct aws
struct aws_host_resolver resolver;
aws_host_resolver_init_default(&resolver, allocator, 10, &el_group);

struct aws_client_bootstrap *bootstrap = aws_client_bootstrap_new(allocator, &el_group, &resolver, NULL);
struct aws_client_bootstrap_options bootstrap_options = {
.event_loop_group = &el_group,
.host_resolver = &resolver,
};
struct aws_client_bootstrap *bootstrap = aws_client_bootstrap_new(allocator, &bootstrap_options);

struct aws_string *config_contents = aws_string_new_from_c_str(allocator, s_soure_profile_config_file);
ASSERT_SUCCESS(aws_create_profile_file(s_credentials_file_name, config_contents));
Expand Down Expand Up @@ -668,7 +688,11 @@ static int s_credentials_provider_sts_from_profile_config_environment_succeeds_f
struct aws_host_resolver resolver;
aws_host_resolver_init_default(&resolver, allocator, 10, &el_group);

struct aws_client_bootstrap *bootstrap = aws_client_bootstrap_new(allocator, &el_group, &resolver, NULL);
struct aws_client_bootstrap_options bootstrap_options = {
.event_loop_group = &el_group,
.host_resolver = &resolver,
};
struct aws_client_bootstrap *bootstrap = aws_client_bootstrap_new(allocator, &bootstrap_options);

struct aws_string *config_contents = aws_string_new_from_c_str(allocator, s_env_source_config_file);
ASSERT_SUCCESS(aws_create_profile_file(s_credentials_file_name, config_contents));
Expand Down

0 comments on commit 27bc11d

Please sign in to comment.