Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stackdump/18149aa4c4195fb2ef6ee7628a03cd54 to your computer and use it in GitHub Desktop.
Save stackdump/18149aa4c4195fb2ef6ee7628a03cd54 to your computer and use it in GitHub Desktop.
From e387b124a960f9d840d249a679be7a2a16bff261 Mon Sep 17 00:00:00 2001
From: stackdump <myork@stackdump.com>
Date: Mon, 5 Aug 2019 13:17:13 -0500
Subject: [PATCH] added test to sync accross net
---
peerTest/NetSyncA_test.go | 35 +++++++++++++++++++++++++++++++++++
peerTest/NetSyncB_test.go | 37 +++++++++++++++++++++++++++++++++++++
2 files changed, 72 insertions(+)
create mode 100644 peerTest/NetSyncA_test.go
create mode 100644 peerTest/NetSyncB_test.go
diff --git a/peerTest/NetSyncA_test.go b/peerTest/NetSyncA_test.go
new file mode 100644
index 000000000..2232b0f65
--- /dev/null
+++ b/peerTest/NetSyncA_test.go
@@ -0,0 +1,35 @@
+package simtest
+
+import (
+ "testing"
+
+ . "github.com/FactomProject/factomd/testHelper"
+)
+
+/*
+This test is the part A of a Network/Follower A/B pair of tests used to test
+Just boots to test that follower can sync
+*/
+func TestNetSyncA(t *testing.T) {
+
+ peers := "127.0.0.1:37003"
+ ResetSimHome(t)
+
+ params := map[string]string{
+ "--db": "LDB",
+ "--network": "LOCAL",
+ "--net": "alot+",
+ "--enablenet": "true",
+ "--blktime": "15",
+ "--logPort": "38000",
+ "--port": "38001",
+ "--controlpanelport": "38002",
+ "--networkport": "38003",
+ "--peers": peers,
+ }
+
+ state0 := SetupSim("L", params, 7, 0, 0, t)
+
+ WaitForBlock(state0, 6)
+ Halt(t)
+}
diff --git a/peerTest/NetSyncB_test.go b/peerTest/NetSyncB_test.go
new file mode 100644
index 000000000..4eb6dd327
--- /dev/null
+++ b/peerTest/NetSyncB_test.go
@@ -0,0 +1,37 @@
+package simtest
+
+import (
+ "testing"
+
+ . "github.com/FactomProject/factomd/testHelper"
+)
+
+/*
+This test is the part B of a Network/Follower A/B pair of tests used to test
+Just boots to test that follower can sync
+*/
+func TestSyncB(t *testing.T) {
+
+ peers := "127.0.0.1:38003"
+ ResetSimHome(t)
+
+ // write config file from identity9 to fnode0
+ WriteConfigFile(9, 0, "", t)
+
+ params := map[string]string{
+ "--db": "LDB",
+ "--network": "LOCAL",
+ "--net": "alot+",
+ "--enablenet": "true",
+ "--blktime": "30",
+ "--logPort": "37000",
+ "--port": "37001",
+ "--controlpanelport": "37002",
+ "--networkport": "37003",
+ "--peers": peers,
+ }
+
+ state0 := SetupSim("F", params, 7, 0, 0, t)
+ WaitForBlock(state0, 6)
+ Halt(t)
+}
--
2.20.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment