Esempio n. 1
0
func init() {
	srv.SetMockServices()
	setMockExpressions()
	storage.New("internal")
	constraints := map[string]float64{
		"C1": 1.0,
		"C2": 2.0,
	}
	for _, service := range srv.List() {
		srv.SetServiceConstraints(service, constraints)
	}
}
Esempio n. 2
0
func initializeStorage() {
	_, err := storage.New(cfg.GetAgentStorage().StorageService)
	if err != nil {
		log.WithFields(log.Fields{
			"status":  "warning",
			"error":   err,
			"default": storage.Name(),
		}).Warnln("Error initializing storage service")
	} else {
		log.WithField(storage.Name(), "ok").Infoln("Storage service initialized")
	}
}
Esempio n. 3
0
func TestClearFriendsData(t *testing.T) {
	var err error
	storage.New("internal")
	data := []byte{}
	storage.StoreLocalData(data, enum.SHARED)
	storage.StoreClusterData(data, enum.SHARED)
	storage.StoreData("node1", data, enum.SHARED)
	storage.StoreData("node2", data, enum.SHARED)
	storage.StoreData("node3", data, enum.SHARED)

	err = clearFriendsData()
	assert.NoError(t, err)
	stored, _ := storage.GetAllData(enum.SHARED)
	assert.Equal(t, 2, len(stored))
}
Esempio n. 4
0
func init() {
	storage.New("internal")
}
Esempio n. 5
0
func init() {
	//Initialize storage
	storage.New("internal")
	//simply check if the functions return without errors
	StoreRandomMockPolicy()
}