Fullnode rpc to exit with unsafe config
This commit is contained in:
committed by
Grimes
parent
a3016aebaf
commit
c299dd390e
@@ -7,6 +7,8 @@ use crate::contact_info::ContactInfo;
|
||||
use crate::gossip_service::discover;
|
||||
use solana_sdk::signature::{Keypair, KeypairUtil};
|
||||
use solana_sdk::system_transaction::SystemTransaction;
|
||||
use std::thread::sleep;
|
||||
use std::time::Duration;
|
||||
|
||||
/// Spend and verify from every node in the network
|
||||
pub fn spend_and_verify_all_nodes(
|
||||
@@ -39,3 +41,17 @@ pub fn spend_and_verify_all_nodes(
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn fullnode_exit(entry_point_info: &ContactInfo, nodes: usize) {
|
||||
let cluster_nodes = discover(&entry_point_info, nodes);
|
||||
assert!(cluster_nodes.len() >= nodes);
|
||||
for node in &cluster_nodes {
|
||||
let mut client = mk_client(&node);
|
||||
assert!(client.fullnode_exit().unwrap());
|
||||
}
|
||||
sleep(Duration::from_millis(250));
|
||||
for node in &cluster_nodes {
|
||||
let mut client = mk_client(&node);
|
||||
assert!(client.fullnode_exit().is_err());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user