forked from anza-xyz/agave
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
check whether accounts and snapshots are using the same path (anza-xy…
…z#1853) * check whether accounts and snapshots are using the same path * patch and update test * remove new line * align
- Loading branch information
1 parent
140bc11
commit d6f180a
Showing
4 changed files
with
70 additions
and
14 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
use { | ||
assert_cmd::prelude::*, | ||
solana_sdk::signer::keypair::{write_keypair_file, Keypair}, | ||
std::process::Command, | ||
tempfile::TempDir, | ||
}; | ||
|
||
#[test] | ||
fn test_use_the_same_path_for_accounts_and_snapshots() { | ||
let temp_dir = TempDir::new().unwrap(); | ||
let temp_dir_path = temp_dir.path(); | ||
|
||
let id_json_path = temp_dir_path.join("id.json"); | ||
let id_json_str = id_json_path.to_str().unwrap(); | ||
|
||
let keypair = Keypair::new(); | ||
write_keypair_file(&keypair, id_json_str).unwrap(); | ||
|
||
let temp_dir_str = temp_dir_path.to_str().unwrap(); | ||
|
||
let mut cmd = Command::cargo_bin(env!("CARGO_PKG_NAME")).unwrap(); | ||
cmd.args([ | ||
"--identity", | ||
id_json_str, | ||
"--log", | ||
"-", | ||
"--no-voting", | ||
"--accounts", | ||
temp_dir_str, | ||
"--snapshots", | ||
temp_dir_str, | ||
]); | ||
cmd.assert().failure().stderr(predicates::str::contains( | ||
"The --accounts and --snapshots paths must be unique", | ||
)); | ||
} |