[control] Store and recovery fixes: cross-process token lock, revert keeps its journal until done, epoch and deny list never roll back, journal errors propagate, lost confirm reloads edge, trial hash checked
This commit is contained in:
@@ -62,7 +62,13 @@ fn concurrent_creates_from_the_cli_and_the_server_all_survive() {
|
||||
let mut clis: Vec<_> = (0..8)
|
||||
.map(|i| {
|
||||
std::process::Command::new(bin)
|
||||
.args(["token", "create", "--name", &format!("cli{i}"), "--state-dir"])
|
||||
.args([
|
||||
"token",
|
||||
"create",
|
||||
"--name",
|
||||
&format!("cli{i}"),
|
||||
"--state-dir",
|
||||
])
|
||||
.arg(d.path())
|
||||
.stdout(std::process::Stdio::null())
|
||||
.stderr(std::process::Stdio::null())
|
||||
@@ -91,7 +97,9 @@ fn losing_share_links_json_never_lowers_the_revocation_epoch() {
|
||||
s.stop_all().unwrap();
|
||||
assert_eq!(revocations(&rev)["epoch"], 2);
|
||||
std::fs::remove_file(d.join("share-links.json")).unwrap();
|
||||
Shares::new(d.path(), &rev).ensure_revocation_file().unwrap();
|
||||
Shares::new(d.path(), &rev)
|
||||
.ensure_revocation_file()
|
||||
.unwrap();
|
||||
assert!(
|
||||
revocations(&rev)["epoch"].as_u64().unwrap() >= 2,
|
||||
"{}",
|
||||
@@ -118,7 +126,9 @@ fn a_lost_deny_list_raises_the_epoch_instead_of_shrinking() {
|
||||
assert_eq!(before["epoch"], 0);
|
||||
// The records are gone (or an older backup without the stop is restored).
|
||||
std::fs::remove_file(d.join("share-links.json")).unwrap();
|
||||
Shares::new(d.path(), &rev).ensure_revocation_file().unwrap();
|
||||
Shares::new(d.path(), &rev)
|
||||
.ensure_revocation_file()
|
||||
.unwrap();
|
||||
let after = revocations(&rev);
|
||||
let still_denied = after["deny"]
|
||||
.as_array()
|
||||
|
||||
Reference in New Issue
Block a user