mirror of
https://github.com/valitydev/kds.git
synced 2024-11-06 00:05:18 +00:00
Increases initialization timeout
This commit is contained in:
parent
38741021dd
commit
bdef878eb5
@ -99,7 +99,7 @@ start_clear(Config) ->
|
||||
{keyring_rotation_lifetime, 1000},
|
||||
{keyring_unlock_lifetime, 1000},
|
||||
{keyring_rekeying_lifetime, 3000},
|
||||
{keyring_initialize_lifetime, 3000},
|
||||
{keyring_initialize_lifetime, 10000},
|
||||
{shareholders, #{
|
||||
<<"1">> => #{
|
||||
owner => <<"ndiezel">>,
|
||||
|
@ -139,29 +139,17 @@ end_per_group(_, C) ->
|
||||
-spec init(config()) -> _.
|
||||
init(C) ->
|
||||
Threshold = 2,
|
||||
EncryptedMasterKeyShares = kds_keyring_client:start_init(Threshold, root_url(C)),
|
||||
Shareholders = kds_shareholder:get_all(),
|
||||
_ = ?assertEqual(length(EncryptedMasterKeyShares), length(Shareholders)),
|
||||
EncPrivateKeys = enc_private_keys(C),
|
||||
SigPrivateKeys = sig_private_keys(C),
|
||||
EncryptedMasterKeyShares = kds_keyring_client:start_init(Threshold, root_url(C)),
|
||||
%% DEBUG
|
||||
_ = ?assertMatch(
|
||||
#{
|
||||
status := not_initialized,
|
||||
activities := #{
|
||||
initialization := #{
|
||||
phase := validation,
|
||||
validation_shares := #{}
|
||||
}
|
||||
}
|
||||
},
|
||||
kds_ct_utils:await_initialization_phase(validation, root_url(C), 1000, 100)
|
||||
),
|
||||
_ = ?assertEqual(length(EncryptedMasterKeyShares), length(Shareholders)),
|
||||
DecryptedMasterKeyShares = kds_ct_keyring:decrypt_and_sign_masterkeys(
|
||||
EncryptedMasterKeyShares,
|
||||
EncPrivateKeys,
|
||||
SigPrivateKeys
|
||||
),
|
||||
Timeout = genlib_app:env(kds, keyring_initialize_lifetime),
|
||||
_ = ?assertMatch(
|
||||
#{
|
||||
status := not_initialized,
|
||||
@ -172,7 +160,7 @@ init(C) ->
|
||||
}
|
||||
}
|
||||
},
|
||||
kds_ct_utils:await_initialization_phase(validation, root_url(C), 1000, 100)
|
||||
kds_ct_utils:await_initialization_phase(validation, root_url(C), Timeout, 200)
|
||||
),
|
||||
ok = validate_init(DecryptedMasterKeyShares, C),
|
||||
_ = ?assertMatch(
|
||||
@ -205,7 +193,8 @@ init_with_timeout(C) ->
|
||||
init_with_cancel(C) ->
|
||||
{Id, DecryptedMasterKeyShare} = partial_init(C),
|
||||
ok = kds_keyring_client:cancel_init(root_url(C)),
|
||||
_ = kds_ct_utils:await_initialization_phase(uninitialized, root_url(C), 3000, 200),
|
||||
Timeout = genlib_app:env(kds, keyring_initialize_lifetime),
|
||||
_ = kds_ct_utils:await_initialization_phase(uninitialized, root_url(C), Timeout, 200),
|
||||
_ = ?assertEqual(
|
||||
{error, {invalid_activity, {initialization, uninitialized}}},
|
||||
kds_keyring_client:validate_init(Id, DecryptedMasterKeyShare, root_url(C))
|
||||
|
@ -78,7 +78,8 @@ init_check_meta(C) ->
|
||||
#{keys := #{}, current_key_id := 0},
|
||||
kds_keyring_client:get_keyring_meta(root_url(C))
|
||||
),
|
||||
_ = kds_ct_utils:await_initialization_phase(uninitialized, root_url(C), 3000, 200),
|
||||
Timeout = genlib_app:env(kds, keyring_initialize_lifetime),
|
||||
_ = kds_ct_utils:await_initialization_phase(uninitialized, root_url(C), Timeout, 200),
|
||||
_ = kds_ct_keyring:init(C),
|
||||
_ = kds_ct_utils:await_status(unlocked, root_url(C), 3000, 200),
|
||||
_ = ?assertMatch(
|
||||
|
@ -65,9 +65,11 @@ init_check_keyring(C) ->
|
||||
{error, {invalid_status, not_initialized}},
|
||||
get_keyring(C)
|
||||
),
|
||||
_ = kds_ct_utils:await_initialization_phase(uninitialized, management_root_url(C), 3000, 200),
|
||||
Timeout = genlib_app:env(kds, keyring_initialize_lifetime),
|
||||
_ = kds_ct_utils:await_initialization_phase(uninitialized, management_root_url(C), Timeout, 200),
|
||||
_ = kds_ct_keyring:init(C),
|
||||
_ = kds_ct_utils:await_status(unlocked, management_root_url(C), 3000, 200),
|
||||
UnlockTimeout = genlib_app:env(kds, keyring_unlock_lifetime),
|
||||
_ = kds_ct_utils:await_status(unlocked, management_root_url(C), UnlockTimeout, 200),
|
||||
_ = ?assertMatch(
|
||||
#{
|
||||
meta := #{current_key_id := 0, version := 1, keys := #{0 := #{retired := false}}},
|
||||
|
Loading…
Reference in New Issue
Block a user