Finalize all submodules

This commit is contained in:
Mahmut Bulut 2020-03-08 11:30:23 +01:00
parent 17a2c0ae1e
commit a9b43059a7
6 changed files with 75 additions and 32 deletions

View File

@ -103,12 +103,12 @@ macro_rules! cluster_init {
}
static LOGGER_INIT: Once = Once::new();
LOGGER_INIT.call_once(|| pretty_env_logger::init());
};
}
#[macro_export]
macro_rules! node_spawn {
macro_rules! ap_events_check_node_spawn {
($node_handle:ident) => {
let $node_handle = spawn_blocking(
async {
@ -130,26 +130,25 @@ macro_rules! node_spawn {
}
}
// #[macro_export]
// macro_rules! chaos_unleash {
// ($fp_name:expr) => {
// LOGGER_INIT.call_once(|| pretty_env_logger::init());
// let scenario = FailScenario::setup();
// // Let's see how reliable you are.
// node_spawn!(node1);
// node_spawn!(node2);
// node_spawn!(node3);
// run(
// async {
// future::join_all(
// vec![node1, node2, node3]
// ).await
// },
// ProcStack::default(),
// );
// scenario.teardown();
// };
// }
#[macro_export]
macro_rules! ap_sd_check_node_spawn {
($node_handle:ident) => {
let $node_handle = spawn_blocking(
async {
let (c, events, cluster_handle) = node_setup(get_port());
match cluster_handle.await {
Some(a) => {
// Test passed.
warn!("This node is leaving.");
c.shutdown();
warn!("Stopping the setup");
},
_ => {
assert!(false);
}
}
},
ProcStack::default(),
);
}
}

View File

@ -12,9 +12,9 @@ fn main() {
kaostest!("epidemic-periodic-index-fp",
{
node_spawn!(node1);
node_spawn!(node2);
node_spawn!(node3);
ap_events_check_node_spawn!(node1);
ap_events_check_node_spawn!(node2);
ap_events_check_node_spawn!(node3);
run(
async {

View File

@ -11,9 +11,9 @@ fn main() {
kaostest!("epidemic-state-change-tail-follow-fp",
{
node_spawn!(node1);
node_spawn!(node2);
node_spawn!(node3);
ap_events_check_node_spawn!(node1);
ap_events_check_node_spawn!(node2);
ap_events_check_node_spawn!(node3);
run(
async {

View File

@ -0,0 +1,28 @@
extern crate pretty_env_logger;
#[macro_use]
extern crate log;
mod base;
use base::*;
fn main() {
cluster_init!();
kaostest!("mdns-protocol-fp",
{
ap_sd_check_node_spawn!(node1);
ap_sd_check_node_spawn!(node2);
ap_sd_check_node_spawn!(node3);
run(
async {
future::join_all(
vec![node1, node2, node3]
).await
},
ProcStack::default(),
);
}
);
}

View File

@ -8,7 +8,7 @@ use base::*;
fn main() {
// cluster_init!();
// chaos_unleash!("udp-anycast-reply-dgram-oop-fp");
// "udp-anycast-dgram-oop-fp"
// TODO: This will obviously pass because AP cluster doesn't use UDP anycast by default.
// Fix it after having different prepared cluster.

View File

@ -0,0 +1,16 @@
extern crate pretty_env_logger;
#[macro_use]
extern crate log;
mod base;
use base::*;
fn main() {
// cluster_init!();
// "udp-anycast-reply-dgram-oop-fp"
// TODO: This will obviously pass because AP cluster doesn't use UDP anycast by default.
// Fix it after having different prepared cluster.
std::thread::sleep(std::time::Duration::from_secs(3));
}