70% of testing serialization logic.

This commit is contained in:
Marcello Stanisci 2018-12-21 22:05:42 +01:00
parent a65823fa32
commit 5a6755b4b4
No known key found for this signature in database
GPG Key ID: 8D526861953F4C0F
2 changed files with 30 additions and 1 deletions

View File

@ -68,42 +68,71 @@ static void
run (void *cls, run (void *cls,
struct TALER_TESTING_Interpreter *is) struct TALER_TESTING_Interpreter *is)
{ {
struct TALER_TESTING_Command keys_serialization[] = {
/**
* Serialize keys, and disconnect from the exchange.
*/
TALER_TESTING_cmd_serialize_keys ("serialize-keys"),
/**
* Reconnect to the exchange using the serialized keys.
*/
TALER_TESTING_cmd_connect_with_state ("reconnect-with-state",
"serialize-keys"),
TALER_TESTING_cmd_end ()
};
struct TALER_TESTING_Command commands[] = { struct TALER_TESTING_Command commands[] = {
/* Trigger keys reloading from disk. */ /* Trigger keys reloading from disk. */
TALER_TESTING_cmd_signal ("signal-reaction-1", TALER_TESTING_cmd_signal ("signal-reaction-1",
is->exchanged, is->exchanged,
SIGUSR1), SIGUSR1),
TALER_TESTING_cmd_check_keys ("check-keys-1", TALER_TESTING_cmd_check_keys ("check-keys-1",
1, 1,
4), 4),
/* sleep a bit */ /* sleep a bit */
TALER_TESTING_cmd_sleep ("sleep", TALER_TESTING_cmd_sleep ("sleep",
10), 10),
/* 1st keyup happens at start-up */ /* 1st keyup happens at start-up */
TALER_TESTING_cmd_exec_keyup ("keyup-2", TALER_TESTING_cmd_exec_keyup ("keyup-2",
CONFIG_FILE_EXTENDED), CONFIG_FILE_EXTENDED),
TALER_TESTING_cmd_exec_auditor_sign ("sign-keys-1", TALER_TESTING_cmd_exec_auditor_sign ("sign-keys-1",
CONFIG_FILE), CONFIG_FILE),
/* Cause exchange to reload (new) keys */
TALER_TESTING_cmd_signal ("trigger-keys-reload-1", TALER_TESTING_cmd_signal ("trigger-keys-reload-1",
is->exchanged, is->exchanged,
SIGUSR1), SIGUSR1),
TALER_TESTING_cmd_check_keys ("check-keys-2", TALER_TESTING_cmd_check_keys ("check-keys-2",
2, 2,
6), 6),
/* sleep a bit */ /* sleep a bit */
TALER_TESTING_cmd_sleep ("sleep", TALER_TESTING_cmd_sleep ("sleep",
20), 20),
/* Do 2nd keyup */ /* Do 2nd keyup */
TALER_TESTING_cmd_exec_keyup ("keyup-3", TALER_TESTING_cmd_exec_keyup ("keyup-3",
CONFIG_FILE_EXTENDED), CONFIG_FILE_EXTENDED),
TALER_TESTING_cmd_exec_auditor_sign ("sign-keys-2", TALER_TESTING_cmd_exec_auditor_sign ("sign-keys-2",
CONFIG_FILE), CONFIG_FILE),
TALER_TESTING_cmd_signal ("trigger-keys-reload-2", TALER_TESTING_cmd_signal ("trigger-keys-reload-2",
is->exchanged, is->exchanged,
SIGUSR1), SIGUSR1),
TALER_TESTING_cmd_check_keys ("check-keys-3", TALER_TESTING_cmd_check_keys ("check-keys-3",
3, 3,
8), 8),
TALER_TESTING_cmd_batch ("keys-serialization",
keys_serialization),
TALER_TESTING_cmd_end () TALER_TESTING_cmd_end ()
}; };

View File

@ -216,7 +216,7 @@ connect_with_state_cleanup
(void *cls, (void *cls,
const struct TALER_TESTING_Command *cmd) const struct TALER_TESTING_Command *cmd)
{ {
return;
} }
/** /**