Skip to content

Commit

Permalink
Merge pull request #250
Browse files Browse the repository at this point in the history
e0230be tests: erase file before using it (Marko Bencun)
  • Loading branch information
benma committed Jan 10, 2019
2 parents 617d64e + e0230be commit f2a35a0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/tests_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -540,11 +540,15 @@ static void tests_pairing(void)
ASSERT_REPORT_HAS("\"pairing\":false");

// Forcabily turned on if device is locked.
api_format_send_cmd(cmd_str(CMD_backup),
"{\"erase\":\"test_pairing.pdf\"}",
KEY_STANDARD);
char seed_c[512];
snprintf(seed_c, sizeof(seed_c),
"{\"source\":\"%s\", \"filename\":\"%s\", \"key\":\"%s\"}", attr_str(ATTR_create),
"test_pairing.pdf", "key");
api_format_send_cmd(cmd_str(CMD_seed), seed_c, KEY_STANDARD);
ASSERT_REPORT_HAS_NOT(attr_str(ATTR_error));

// lock device
api_format_send_cmd(cmd_str(CMD_device), attr_str(ATTR_lock), KEY_STANDARD);
Expand Down Expand Up @@ -946,6 +950,11 @@ static void tests_u2f(void)
// verify backup1 `u2f` fail
// verify backup2 `u2f` success

snprintf(cmd, sizeof(cmd),
"{\"erase\":\"%s\"}", fn2c);
api_format_send_cmd(cmd_str(CMD_backup),
cmd,
KEY_STANDARD);
snprintf(cmd, sizeof(cmd),
"{\"source\":\"%s\", \"key\":\"password\", \"filename\":\"%s\", \"U2F_counter\":100}",
attr_str(ATTR_U2F_create), fn2c);
Expand Down

0 comments on commit f2a35a0

Please sign in to comment.