go-bgp

a collection of golang BGP tools to monitor, archive and serve
git clone git://git.2f30.org/go-bgp
Log | Files | Refs | README

monitor_backend_test.go (824B)


      1 package monitor
      2 
      3 import (
      4 	"testing"
      5 )
      6 
      7 var (
      8 	conerr error
      9 )
     10 
     11 func TestStartStop(t *testing.T) {
     12 	c := &CassandraContext{}
     13 	conerr = c.StartCassandra("bgp_mongol_test", "worf.netsec.colostate.edu")
     14 	if conerr != nil {
     15 		t.Logf("could not conect to test cassandra instance at worf.netsec.colostate.edu. not failing test")
     16 		return
     17 	}
     18 	c.StopCassandra()
     19 }
     20 
     21 func TestCreateTable(t *testing.T) {
     22 	c := &CassandraContext{}
     23 	conerr = c.StartCassandra("bgp_mongol_test", "worf.netsec.colostate.edu")
     24 	if conerr != nil {
     25 		t.Logf("could not conect to test cassandra instance at worf.netsec.colostate.edu. not failing test")
     26 		return
     27 	}
     28 	if err := c.session.Query("CREATE TABLE bmf ( prefix text PRIMARY KEY, dat1 text, dat2 text);").Exec(); err != nil {
     29 		t.Logf(" create table returned error :%v \n", err)
     30 	}
     31 	c.StopCassandra()
     32 }