Add a sync acceptance test for the Testnet
This commit is contained in:
parent
efb9bfa5de
commit
92f0c934cf
|
|
@ -20,6 +20,7 @@ use tempdir::TempDir;
|
||||||
|
|
||||||
use std::{borrow::Borrow, fs, io::Write, time::Duration};
|
use std::{borrow::Borrow, fs, io::Write, time::Duration};
|
||||||
|
|
||||||
|
use zebra_chain::parameters::Network::{self, *};
|
||||||
use zebra_test::prelude::*;
|
use zebra_test::prelude::*;
|
||||||
use zebrad::config::ZebradConfig;
|
use zebrad::config::ZebradConfig;
|
||||||
|
|
||||||
|
|
@ -453,14 +454,30 @@ fn valid_generated_config(command: &str, expected_output: &str) -> Result<()> {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[ignore]
|
#[ignore]
|
||||||
fn sync_one_checkpoint() -> Result<()> {
|
fn sync_one_checkpoint_mainnet() -> Result<()> {
|
||||||
|
sync_one_checkpoint(Mainnet)
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
#[ignore]
|
||||||
|
fn sync_one_checkpoint_testnet() -> Result<()> {
|
||||||
|
sync_one_checkpoint(Testnet)
|
||||||
|
}
|
||||||
|
|
||||||
|
fn sync_one_checkpoint(network: Network) -> Result<()> {
|
||||||
zebra_test::init();
|
zebra_test::init();
|
||||||
|
|
||||||
|
let mut config = persistent_test_config()?;
|
||||||
|
// TODO: add a convenience method?
|
||||||
|
config.network.network = network;
|
||||||
|
|
||||||
let mut child = testdir()?
|
let mut child = testdir()?
|
||||||
.with_config(persistent_test_config()?)?
|
.with_config(config)?
|
||||||
.spawn_child(&["start"])?
|
.spawn_child(&["start"])?
|
||||||
.with_timeout(Duration::from_secs(20));
|
.with_timeout(Duration::from_secs(20));
|
||||||
|
|
||||||
|
// TODO: is there a way to check for testnet or mainnet here?
|
||||||
|
// For example: "network=Mainnet" or "network=Testnet"
|
||||||
child.expect_stdout("verified checkpoint range")?;
|
child.expect_stdout("verified checkpoint range")?;
|
||||||
child.kill()?;
|
child.kill()?;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue