Release v0.6.59: clarify sync results and refresh downloaded settings
This commit is contained in:
1 parent
d0387904a0
commit
4d8d8d47b9
16 files changed
+107
-28
No files matched your search
+19
-1
@@ -298,6 +298,9 @@ int main()
|
||||
require(provider.writes == 1 && result.revision == 1, "no-op avoids versions");
|
||||
result = synchronize(provider, base, bytes(left), SyncAction::Download);
|
||||
require(parse(result.settings) == parse(base) && provider.writes == 1, "download never writes");
|
||||
require(result.downloaded, "explicit download requests a settings window refresh");
|
||||
require(result.status.find(L"Downloaded remote settings. Server version 1.") != std::wstring::npos,
|
||||
"explicit download reports its result and server version");
|
||||
provider.race = true;
|
||||
rejects([&] { synchronize(provider, base, bytes(left), SyncAction::Upload); }, "racing writer protected");
|
||||
require(provider.writes == 1 && provider.remote.settings == base, "CAS failure preserves remote");
|
||||
@@ -395,10 +398,25 @@ int main()
|
||||
rejects([&] { bao->read(); }, "permission denied is not absent");
|
||||
readStatus = 302;
|
||||
rejects([&] { bao->read(); }, "redirect response rejected");
|
||||
readStatus = 400;
|
||||
try { bao->read(); require(false, "download HTTP 400 must fail"); }
|
||||
catch (const std::runtime_error &e) {
|
||||
require(std::string(e.what()).find("download request (HTTP 400)") != std::string::npos,
|
||||
"download failure is not mislabeled as a write failure");
|
||||
}
|
||||
writeStatus = 400;
|
||||
rejects([&] { bao->write(base, 7); }, "server CAS refusal propagated");
|
||||
}
|
||||
require(logins == 1 && revokes == 1 && reads == 5 && writes == 2, "temporary login lifecycle");
|
||||
require(logins == 1 && revokes == 1 && reads == 6 && writes == 2, "temporary login lifecycle");
|
||||
try {
|
||||
makeSyncProvider(config, [](const std::wstring &, const std::wstring &, const std::wstring &, const Bytes &) {
|
||||
return SyncHttpResponse{400, {}};
|
||||
});
|
||||
require(false, "login HTTP 400 must fail");
|
||||
} catch (const std::runtime_error &e) {
|
||||
require(std::string(e.what()).find("authentication request (HTTP 400)") != std::string::npos,
|
||||
"login failure identifies authentication instead of a write");
|
||||
}
|
||||
forgetSyncPassword(config); forgetSyncPassword(config);
|
||||
++checks;
|
||||
std::filesystem::remove_all(root);
|
||||
|
||||
Reference in new issue
Block a user