func TestUpDownStartStop(t *testing.T) {
	var sl SkipLog
	log.SetOutput(sl)
	seq := make(map[string][]bool)
	seq["h1"] = []bool{true, false, false, false, true, true, false}
	seq["h2"] = []bool{false, false, true, true, false, true, true}
	seq["h3"] = []bool{true, true, true, false, true, true, false}
	seq["h4"] = []bool{false, false, true, true, false, false, false}
	load := []string{"h1", "h2"}
	resultSeq := []HostStatus{
		HostStatus{"h2", true},   
		HostStatus{"h1", true},   
		HostStatus{"h2", false},  
		HostStatus{"h1", false},  
		HostStatus{"h1", true},   
		HostStatus{"h2", true},   
	}
	startHostChFW, stopHostChFW, notifyChFW := createTestPool(seq, load)
	for _, expected := range resultSeq {
		event := <-notifyChFW
		if event.Host != expected.Host || event.Down != expected.Down {
			t.Errorf("Got event: %s %t, expected: %s %t \n", event.Host, event.Down, expected.Host, expected.Down)
		}
	}
	startHostChFW <- HostStatus{"h3", false}  
	startHostChFW <- HostStatus{"h4", true}   
	event := <-notifyChFW
	if event.Host != "h4" || event.Down != false {
		t.Errorf("Got event: %s %t, expected: %s %t \n", event.Host, event.Down, "h4", false)
	}
	stopHostChFW <- event
	event = <-notifyChFW
	if event.Host != "h3" || event.Down != true {
		t.Errorf("Got event: %s %t, expected: %s %t \n", event.Host, event.Down, "h3", true)
	}
	close(notifyChFW)
	time.Sleep(time.Millisecond * 20)
}
TestUpDown tests correct event stream is coming from the monitoring pool
package pingd
import (
	"log"
	"sync"
	"testing"
	"time"
)