Loading go-apps/meep-wais/sbi/wais-sbi.go +14 −5 Original line number Original line Diff line number Diff line Loading @@ -37,16 +37,18 @@ var influxAddr string = "http://meep-influxdb.default.svc.cluster.local:8086" type SbiCfg struct { type SbiCfg struct { SandboxName string SandboxName string RedisAddr string RedisAddr string InfluxAddr string PostgisHost string PostgisHost string PostgisPort string PostgisPort string StaInfoCb func(string, string, string, *int32, *int32, *int32) StaInfoCb func(string, string, string, *int32, *int32, *int32) ApInfoCb func(string, string, *float32, *float32, []string) ApInfoCb func(string, string, *float32, *float32, []string) ScenarioNameCb func(string, *bool) ScenarioNameCb func(string) CleanUpCb func() CleanUpCb func() } } type WaisSbi struct { type WaisSbi struct { sandboxName string sandboxName string scenarioName string mqLocal *mq.MsgQueue mqLocal *mq.MsgQueue handlerId int handlerId int activeModel *mod.Model activeModel *mod.Model Loading @@ -54,7 +56,7 @@ type WaisSbi struct { refreshTicker *time.Ticker refreshTicker *time.Ticker updateStaInfoCB func(string, string, string, *int32, *int32, *int32) updateStaInfoCB func(string, string, string, *int32, *int32, *int32) updateAccessPointInfoCB func(string, string, *float32, *float32, []string) updateAccessPointInfoCB func(string, string, *float32, *float32, []string) updateScenarioNameCB func(string, *bool) updateScenarioNameCB func(string) cleanUpCB func() cleanUpCB func() mutex sync.Mutex mutex sync.Mutex } } Loading @@ -70,10 +72,13 @@ func Init(cfg SbiCfg) (err error) { } } sbi = new(WaisSbi) sbi = new(WaisSbi) sbi.sandboxName = cfg.SandboxName sbi.sandboxName = cfg.SandboxName sbi.scenarioName = "" sbi.updateStaInfoCB = cfg.StaInfoCb sbi.updateStaInfoCB = cfg.StaInfoCb sbi.updateAccessPointInfoCB = cfg.ApInfoCb sbi.updateAccessPointInfoCB = cfg.ApInfoCb sbi.updateScenarioNameCB = cfg.ScenarioNameCb sbi.updateScenarioNameCB = cfg.ScenarioNameCb sbi.cleanUpCB = cfg.CleanUpCb sbi.cleanUpCB = cfg.CleanUpCb redisAddr = cfg.RedisAddr influxAddr = cfg.InfluxAddr // Create message queue // Create message queue sbi.mqLocal, err = mq.NewMsgQueue(mq.GetLocalName(sbi.sandboxName), moduleName, sbi.sandboxName, cfg.RedisAddr) sbi.mqLocal, err = mq.NewMsgQueue(mq.GetLocalName(sbi.sandboxName), moduleName, sbi.sandboxName, cfg.RedisAddr) Loading Loading @@ -223,12 +228,16 @@ func processActiveScenarioUpdate() { sbi.activeModel.UpdateScenario() sbi.activeModel.UpdateScenario() scenarioName := sbi.activeModel.GetScenarioName() scenarioName := sbi.activeModel.GetScenarioName() var update bool sbi.updateScenarioNameCB(scenarioName, &update) sbi.updateScenarioNameCB(scenarioName) // Connect to Metric Store // Connect to Metric Store if update { if scenarioName != sbi.scenarioName { sbi.updateScenarioNameCB(scenarioName) sbi.scenarioName = scenarioName var err error var err error metricStore, err = met.NewMetricStore(scenarioName, sbi.sandboxName, influxAddr, redisAddr) metricStore, err = met.NewMetricStore(scenarioName, sbi.sandboxName, influxAddr, redisAddr) if err != nil { if err != nil { log.Error("Failed connection to metric-store: ", err) log.Error("Failed connection to metric-store: ", err) Loading go-apps/meep-wais/server/wais.go +4 −10 Original line number Original line Diff line number Diff line Loading @@ -69,7 +69,6 @@ var assocStaSubscriptionMap = map[int]*AssocStaSubscription{} var staDataRateSubscriptionMap = map[int]*StaDataRateSubscription{} var staDataRateSubscriptionMap = map[int]*StaDataRateSubscription{} var subscriptionExpiryMap = map[int][]int{} var subscriptionExpiryMap = map[int][]int{} var currentStoreName = "" var WAIS_DB = 5 var WAIS_DB = 5 Loading Loading @@ -159,6 +158,7 @@ func Init() (err error) { sbiCfg := sbi.SbiCfg{ sbiCfg := sbi.SbiCfg{ SandboxName: sandboxName, SandboxName: sandboxName, RedisAddr: redisAddr, RedisAddr: redisAddr, InfluxAddr: influxAddr, StaInfoCb: updateStaInfo, StaInfoCb: updateStaInfo, ApInfoCb: updateApInfo, ApInfoCb: updateApInfo, ScenarioNameCb: updateStoreName, ScenarioNameCb: updateStoreName, Loading Loading @@ -1279,15 +1279,9 @@ func cleanUp() { staDataRateSubscriptionMap = map[int]*StaDataRateSubscription{} staDataRateSubscriptionMap = map[int]*StaDataRateSubscription{} subscriptionExpiryMap = map[int][]int{} subscriptionExpiryMap = map[int][]int{} var update bool updateStoreName("") updateStoreName("", &update) } } func updateStoreName(storeName string, update *bool) { func updateStoreName(storeName string) { if currentStoreName != storeName { currentStoreName = storeName _ = httpLog.ReInit(logModuleWAIS, sandboxName, storeName, redisAddr, influxAddr) _ = httpLog.ReInit(logModuleWAIS, sandboxName, storeName, redisAddr, influxAddr) *update = true } *update = false } } go-apps/meep-wais/server/wais_test.go +14 −13 Original line number Original line Diff line number Diff line Loading @@ -5889,7 +5889,8 @@ const testScenario string = ` const redisTestAddr = "localhost:30380" const redisTestAddr = "localhost:30380" const influxTestAddr = "http://localhost:30986" const influxTestAddr = "http://localhost:30986" const testScenarioName = "testScenario" const testSandboxName = "testScenario" const testScenarioName = "4g-5g-wifi-macro" var m *mod.Model var m *mod.Model var mqLocal *mq.MsgQueue var mqLocal *mq.MsgQueue Loading Loading @@ -6032,7 +6033,7 @@ func testSubscriptionAssocStaPost(t *testing.T) string { ******************************/ ******************************/ expectedApId := ApIdentity{"myMacId", []string{"myIp"}, []string{"mySSid"}} expectedApId := ApIdentity{"myMacId", []string{"myIp"}, []string{"mySSid"}} expectedCallBackRef := "myCallbakRef" expectedCallBackRef := "myCallbakRef" expectedLinkType := LinkType{"/" + testScenarioName + "/wai/v2/subscriptions/" + strconv.Itoa(nextSubscriptionIdAvailable)} expectedLinkType := LinkType{"/" + testSandboxName + "/wai/v2/subscriptions/" + strconv.Itoa(nextSubscriptionIdAvailable)} //expectedExpiry := TimeStamp{0, 1988599770} //expectedExpiry := TimeStamp{0, 1988599770} expectedResponse := AssocStaSubscription{&AssocStaSubscriptionLinks{&expectedLinkType}, &expectedApId, expectedCallBackRef, nil /*&expectedExpiry*/, nil, 0, false, ASSOC_STA_SUBSCRIPTION, nil} expectedResponse := AssocStaSubscription{&AssocStaSubscriptionLinks{&expectedLinkType}, &expectedApId, expectedCallBackRef, nil /*&expectedExpiry*/, nil, 0, false, ASSOC_STA_SUBSCRIPTION, nil} Loading Loading @@ -6087,7 +6088,7 @@ func testSubscriptionAssocStaPut(t *testing.T, subscriptionId string, expectSucc ******************************/ ******************************/ expectedApId := ApIdentity{"myMacId", []string{"myIp"}, []string{"mySSid"}} expectedApId := ApIdentity{"myMacId", []string{"myIp"}, []string{"mySSid"}} expectedCallBackRef := "myCallbakRef" expectedCallBackRef := "myCallbakRef" expectedLinkType := LinkType{"/" + testScenarioName + "/wai/v2/subscriptions/" + subscriptionId} expectedLinkType := LinkType{"/" + testSandboxName + "/wai/v2/subscriptions/" + subscriptionId} expectedExpiry := TimeStamp{0, 1988599770} expectedExpiry := TimeStamp{0, 1988599770} expectedResponse := AssocStaSubscription{&AssocStaSubscriptionLinks{&expectedLinkType}, &expectedApId, expectedCallBackRef, &expectedExpiry, nil, 0, false, ASSOC_STA_SUBSCRIPTION, nil} expectedResponse := AssocStaSubscription{&AssocStaSubscriptionLinks{&expectedLinkType}, &expectedApId, expectedCallBackRef, &expectedExpiry, nil, 0, false, ASSOC_STA_SUBSCRIPTION, nil} Loading Loading @@ -6280,7 +6281,7 @@ func TestExpiryNotification(t *testing.T) { time.Sleep(1 * time.Second) time.Sleep(1 * time.Second) fmt.Println("Create valid Metric Store to get logs from") fmt.Println("Create valid Metric Store to get logs from") metricStore, err := met.NewMetricStore(currentStoreName, sandboxName, influxTestAddr, redisTestAddr) metricStore, err := met.NewMetricStore(testScenarioName, sandboxName, influxTestAddr, redisTestAddr) if err != nil { if err != nil { t.Fatalf("Failed to create store") t.Fatalf("Failed to create store") } } Loading Loading @@ -6369,7 +6370,7 @@ func TestSubscriptionAssocStaNotification(t *testing.T) { updateScenario("mobility1") updateScenario("mobility1") fmt.Println("Create valid Metric Store") fmt.Println("Create valid Metric Store") metricStore, err := met.NewMetricStore(currentStoreName, sandboxName, influxTestAddr, redisTestAddr) metricStore, err := met.NewMetricStore(testScenarioName, sandboxName, influxTestAddr, redisTestAddr) if err != nil { if err != nil { t.Fatalf("Failed to create a store") t.Fatalf("Failed to create a store") } } Loading Loading @@ -6659,7 +6660,7 @@ func TestStaInfoGet(t *testing.T) { func terminateScenario() { func terminateScenario() { if mqLocal != nil { if mqLocal != nil { _ = Stop() _ = Stop() msg := mqLocal.CreateMsg(mq.MsgScenarioTerminate, mq.TargetAll, testScenarioName) msg := mqLocal.CreateMsg(mq.MsgScenarioTerminate, mq.TargetAll, testSandboxName) err := mqLocal.SendMsg(msg) err := mqLocal.SendMsg(msg) if err != nil { if err != nil { log.Error("Failed to send message: ", err) log.Error("Failed to send message: ", err) Loading @@ -6681,7 +6682,7 @@ func updateScenario(testUpdate string) { log.Error("Error sending mobility event") log.Error("Error sending mobility event") } } msg := mqLocal.CreateMsg(mq.MsgScenarioUpdate, mq.TargetAll, testScenarioName) msg := mqLocal.CreateMsg(mq.MsgScenarioUpdate, mq.TargetAll, testSandboxName) err = mqLocal.SendMsg(msg) err = mqLocal.SendMsg(msg) if err != nil { if err != nil { log.Error("Failed to send message: ", err) log.Error("Failed to send message: ", err) Loading @@ -6696,7 +6697,7 @@ func updateScenario(testUpdate string) { log.Error("Error sending mobility event") log.Error("Error sending mobility event") } } msg := mqLocal.CreateMsg(mq.MsgScenarioUpdate, mq.TargetAll, testScenarioName) msg := mqLocal.CreateMsg(mq.MsgScenarioUpdate, mq.TargetAll, testSandboxName) err = mqLocal.SendMsg(msg) err = mqLocal.SendMsg(msg) if err != nil { if err != nil { log.Error("Failed to send message: ", err) log.Error("Failed to send message: ", err) Loading @@ -6711,7 +6712,7 @@ func updateScenario(testUpdate string) { log.Error("Error sending mobility event") log.Error("Error sending mobility event") } } msg := mqLocal.CreateMsg(mq.MsgScenarioUpdate, mq.TargetAll, testScenarioName) msg := mqLocal.CreateMsg(mq.MsgScenarioUpdate, mq.TargetAll, testSandboxName) err = mqLocal.SendMsg(msg) err = mqLocal.SendMsg(msg) if err != nil { if err != nil { log.Error("Failed to send message: ", err) log.Error("Failed to send message: ", err) Loading @@ -6725,7 +6726,7 @@ func initializeVars() { mod.DbAddress = redisTestAddr mod.DbAddress = redisTestAddr redisAddr = redisTestAddr redisAddr = redisTestAddr influxAddr = influxTestAddr influxAddr = influxTestAddr sandboxName = testScenarioName sandboxName = testSandboxName } } func initialiseScenario(testScenario string) { func initialiseScenario(testScenario string) { Loading @@ -6734,7 +6735,7 @@ func initialiseScenario(testScenario string) { cleanUp() cleanUp() cfg := mod.ModelCfg{ cfg := mod.ModelCfg{ Name: testScenarioName, Name: testSandboxName, Namespace: sandboxName, Namespace: sandboxName, Module: "test-mod", Module: "test-mod", UpdateCb: nil, UpdateCb: nil, Loading @@ -6749,7 +6750,7 @@ func initialiseScenario(testScenario string) { } } // Create message queue // Create message queue mqLocal, err = mq.NewMsgQueue(mq.GetLocalName(testScenarioName), "test-mod", testScenarioName, redisAddr) mqLocal, err = mq.NewMsgQueue(mq.GetLocalName(testSandboxName), "test-mod", testSandboxName, redisAddr) if err != nil { if err != nil { log.Error("Failed to create Message Queue with error: ", err) log.Error("Failed to create Message Queue with error: ", err) return return Loading @@ -6769,7 +6770,7 @@ func initialiseScenario(testScenario string) { return return } } msg := mqLocal.CreateMsg(mq.MsgScenarioActivate, mq.TargetAll, testScenarioName) msg := mqLocal.CreateMsg(mq.MsgScenarioActivate, mq.TargetAll, testSandboxName) err = mqLocal.SendMsg(msg) err = mqLocal.SendMsg(msg) if err != nil { if err != nil { log.Error("Failed to send message: ", err) log.Error("Failed to send message: ", err) Loading Loading
go-apps/meep-wais/sbi/wais-sbi.go +14 −5 Original line number Original line Diff line number Diff line Loading @@ -37,16 +37,18 @@ var influxAddr string = "http://meep-influxdb.default.svc.cluster.local:8086" type SbiCfg struct { type SbiCfg struct { SandboxName string SandboxName string RedisAddr string RedisAddr string InfluxAddr string PostgisHost string PostgisHost string PostgisPort string PostgisPort string StaInfoCb func(string, string, string, *int32, *int32, *int32) StaInfoCb func(string, string, string, *int32, *int32, *int32) ApInfoCb func(string, string, *float32, *float32, []string) ApInfoCb func(string, string, *float32, *float32, []string) ScenarioNameCb func(string, *bool) ScenarioNameCb func(string) CleanUpCb func() CleanUpCb func() } } type WaisSbi struct { type WaisSbi struct { sandboxName string sandboxName string scenarioName string mqLocal *mq.MsgQueue mqLocal *mq.MsgQueue handlerId int handlerId int activeModel *mod.Model activeModel *mod.Model Loading @@ -54,7 +56,7 @@ type WaisSbi struct { refreshTicker *time.Ticker refreshTicker *time.Ticker updateStaInfoCB func(string, string, string, *int32, *int32, *int32) updateStaInfoCB func(string, string, string, *int32, *int32, *int32) updateAccessPointInfoCB func(string, string, *float32, *float32, []string) updateAccessPointInfoCB func(string, string, *float32, *float32, []string) updateScenarioNameCB func(string, *bool) updateScenarioNameCB func(string) cleanUpCB func() cleanUpCB func() mutex sync.Mutex mutex sync.Mutex } } Loading @@ -70,10 +72,13 @@ func Init(cfg SbiCfg) (err error) { } } sbi = new(WaisSbi) sbi = new(WaisSbi) sbi.sandboxName = cfg.SandboxName sbi.sandboxName = cfg.SandboxName sbi.scenarioName = "" sbi.updateStaInfoCB = cfg.StaInfoCb sbi.updateStaInfoCB = cfg.StaInfoCb sbi.updateAccessPointInfoCB = cfg.ApInfoCb sbi.updateAccessPointInfoCB = cfg.ApInfoCb sbi.updateScenarioNameCB = cfg.ScenarioNameCb sbi.updateScenarioNameCB = cfg.ScenarioNameCb sbi.cleanUpCB = cfg.CleanUpCb sbi.cleanUpCB = cfg.CleanUpCb redisAddr = cfg.RedisAddr influxAddr = cfg.InfluxAddr // Create message queue // Create message queue sbi.mqLocal, err = mq.NewMsgQueue(mq.GetLocalName(sbi.sandboxName), moduleName, sbi.sandboxName, cfg.RedisAddr) sbi.mqLocal, err = mq.NewMsgQueue(mq.GetLocalName(sbi.sandboxName), moduleName, sbi.sandboxName, cfg.RedisAddr) Loading Loading @@ -223,12 +228,16 @@ func processActiveScenarioUpdate() { sbi.activeModel.UpdateScenario() sbi.activeModel.UpdateScenario() scenarioName := sbi.activeModel.GetScenarioName() scenarioName := sbi.activeModel.GetScenarioName() var update bool sbi.updateScenarioNameCB(scenarioName, &update) sbi.updateScenarioNameCB(scenarioName) // Connect to Metric Store // Connect to Metric Store if update { if scenarioName != sbi.scenarioName { sbi.updateScenarioNameCB(scenarioName) sbi.scenarioName = scenarioName var err error var err error metricStore, err = met.NewMetricStore(scenarioName, sbi.sandboxName, influxAddr, redisAddr) metricStore, err = met.NewMetricStore(scenarioName, sbi.sandboxName, influxAddr, redisAddr) if err != nil { if err != nil { log.Error("Failed connection to metric-store: ", err) log.Error("Failed connection to metric-store: ", err) Loading
go-apps/meep-wais/server/wais.go +4 −10 Original line number Original line Diff line number Diff line Loading @@ -69,7 +69,6 @@ var assocStaSubscriptionMap = map[int]*AssocStaSubscription{} var staDataRateSubscriptionMap = map[int]*StaDataRateSubscription{} var staDataRateSubscriptionMap = map[int]*StaDataRateSubscription{} var subscriptionExpiryMap = map[int][]int{} var subscriptionExpiryMap = map[int][]int{} var currentStoreName = "" var WAIS_DB = 5 var WAIS_DB = 5 Loading Loading @@ -159,6 +158,7 @@ func Init() (err error) { sbiCfg := sbi.SbiCfg{ sbiCfg := sbi.SbiCfg{ SandboxName: sandboxName, SandboxName: sandboxName, RedisAddr: redisAddr, RedisAddr: redisAddr, InfluxAddr: influxAddr, StaInfoCb: updateStaInfo, StaInfoCb: updateStaInfo, ApInfoCb: updateApInfo, ApInfoCb: updateApInfo, ScenarioNameCb: updateStoreName, ScenarioNameCb: updateStoreName, Loading Loading @@ -1279,15 +1279,9 @@ func cleanUp() { staDataRateSubscriptionMap = map[int]*StaDataRateSubscription{} staDataRateSubscriptionMap = map[int]*StaDataRateSubscription{} subscriptionExpiryMap = map[int][]int{} subscriptionExpiryMap = map[int][]int{} var update bool updateStoreName("") updateStoreName("", &update) } } func updateStoreName(storeName string, update *bool) { func updateStoreName(storeName string) { if currentStoreName != storeName { currentStoreName = storeName _ = httpLog.ReInit(logModuleWAIS, sandboxName, storeName, redisAddr, influxAddr) _ = httpLog.ReInit(logModuleWAIS, sandboxName, storeName, redisAddr, influxAddr) *update = true } *update = false } }
go-apps/meep-wais/server/wais_test.go +14 −13 Original line number Original line Diff line number Diff line Loading @@ -5889,7 +5889,8 @@ const testScenario string = ` const redisTestAddr = "localhost:30380" const redisTestAddr = "localhost:30380" const influxTestAddr = "http://localhost:30986" const influxTestAddr = "http://localhost:30986" const testScenarioName = "testScenario" const testSandboxName = "testScenario" const testScenarioName = "4g-5g-wifi-macro" var m *mod.Model var m *mod.Model var mqLocal *mq.MsgQueue var mqLocal *mq.MsgQueue Loading Loading @@ -6032,7 +6033,7 @@ func testSubscriptionAssocStaPost(t *testing.T) string { ******************************/ ******************************/ expectedApId := ApIdentity{"myMacId", []string{"myIp"}, []string{"mySSid"}} expectedApId := ApIdentity{"myMacId", []string{"myIp"}, []string{"mySSid"}} expectedCallBackRef := "myCallbakRef" expectedCallBackRef := "myCallbakRef" expectedLinkType := LinkType{"/" + testScenarioName + "/wai/v2/subscriptions/" + strconv.Itoa(nextSubscriptionIdAvailable)} expectedLinkType := LinkType{"/" + testSandboxName + "/wai/v2/subscriptions/" + strconv.Itoa(nextSubscriptionIdAvailable)} //expectedExpiry := TimeStamp{0, 1988599770} //expectedExpiry := TimeStamp{0, 1988599770} expectedResponse := AssocStaSubscription{&AssocStaSubscriptionLinks{&expectedLinkType}, &expectedApId, expectedCallBackRef, nil /*&expectedExpiry*/, nil, 0, false, ASSOC_STA_SUBSCRIPTION, nil} expectedResponse := AssocStaSubscription{&AssocStaSubscriptionLinks{&expectedLinkType}, &expectedApId, expectedCallBackRef, nil /*&expectedExpiry*/, nil, 0, false, ASSOC_STA_SUBSCRIPTION, nil} Loading Loading @@ -6087,7 +6088,7 @@ func testSubscriptionAssocStaPut(t *testing.T, subscriptionId string, expectSucc ******************************/ ******************************/ expectedApId := ApIdentity{"myMacId", []string{"myIp"}, []string{"mySSid"}} expectedApId := ApIdentity{"myMacId", []string{"myIp"}, []string{"mySSid"}} expectedCallBackRef := "myCallbakRef" expectedCallBackRef := "myCallbakRef" expectedLinkType := LinkType{"/" + testScenarioName + "/wai/v2/subscriptions/" + subscriptionId} expectedLinkType := LinkType{"/" + testSandboxName + "/wai/v2/subscriptions/" + subscriptionId} expectedExpiry := TimeStamp{0, 1988599770} expectedExpiry := TimeStamp{0, 1988599770} expectedResponse := AssocStaSubscription{&AssocStaSubscriptionLinks{&expectedLinkType}, &expectedApId, expectedCallBackRef, &expectedExpiry, nil, 0, false, ASSOC_STA_SUBSCRIPTION, nil} expectedResponse := AssocStaSubscription{&AssocStaSubscriptionLinks{&expectedLinkType}, &expectedApId, expectedCallBackRef, &expectedExpiry, nil, 0, false, ASSOC_STA_SUBSCRIPTION, nil} Loading Loading @@ -6280,7 +6281,7 @@ func TestExpiryNotification(t *testing.T) { time.Sleep(1 * time.Second) time.Sleep(1 * time.Second) fmt.Println("Create valid Metric Store to get logs from") fmt.Println("Create valid Metric Store to get logs from") metricStore, err := met.NewMetricStore(currentStoreName, sandboxName, influxTestAddr, redisTestAddr) metricStore, err := met.NewMetricStore(testScenarioName, sandboxName, influxTestAddr, redisTestAddr) if err != nil { if err != nil { t.Fatalf("Failed to create store") t.Fatalf("Failed to create store") } } Loading Loading @@ -6369,7 +6370,7 @@ func TestSubscriptionAssocStaNotification(t *testing.T) { updateScenario("mobility1") updateScenario("mobility1") fmt.Println("Create valid Metric Store") fmt.Println("Create valid Metric Store") metricStore, err := met.NewMetricStore(currentStoreName, sandboxName, influxTestAddr, redisTestAddr) metricStore, err := met.NewMetricStore(testScenarioName, sandboxName, influxTestAddr, redisTestAddr) if err != nil { if err != nil { t.Fatalf("Failed to create a store") t.Fatalf("Failed to create a store") } } Loading Loading @@ -6659,7 +6660,7 @@ func TestStaInfoGet(t *testing.T) { func terminateScenario() { func terminateScenario() { if mqLocal != nil { if mqLocal != nil { _ = Stop() _ = Stop() msg := mqLocal.CreateMsg(mq.MsgScenarioTerminate, mq.TargetAll, testScenarioName) msg := mqLocal.CreateMsg(mq.MsgScenarioTerminate, mq.TargetAll, testSandboxName) err := mqLocal.SendMsg(msg) err := mqLocal.SendMsg(msg) if err != nil { if err != nil { log.Error("Failed to send message: ", err) log.Error("Failed to send message: ", err) Loading @@ -6681,7 +6682,7 @@ func updateScenario(testUpdate string) { log.Error("Error sending mobility event") log.Error("Error sending mobility event") } } msg := mqLocal.CreateMsg(mq.MsgScenarioUpdate, mq.TargetAll, testScenarioName) msg := mqLocal.CreateMsg(mq.MsgScenarioUpdate, mq.TargetAll, testSandboxName) err = mqLocal.SendMsg(msg) err = mqLocal.SendMsg(msg) if err != nil { if err != nil { log.Error("Failed to send message: ", err) log.Error("Failed to send message: ", err) Loading @@ -6696,7 +6697,7 @@ func updateScenario(testUpdate string) { log.Error("Error sending mobility event") log.Error("Error sending mobility event") } } msg := mqLocal.CreateMsg(mq.MsgScenarioUpdate, mq.TargetAll, testScenarioName) msg := mqLocal.CreateMsg(mq.MsgScenarioUpdate, mq.TargetAll, testSandboxName) err = mqLocal.SendMsg(msg) err = mqLocal.SendMsg(msg) if err != nil { if err != nil { log.Error("Failed to send message: ", err) log.Error("Failed to send message: ", err) Loading @@ -6711,7 +6712,7 @@ func updateScenario(testUpdate string) { log.Error("Error sending mobility event") log.Error("Error sending mobility event") } } msg := mqLocal.CreateMsg(mq.MsgScenarioUpdate, mq.TargetAll, testScenarioName) msg := mqLocal.CreateMsg(mq.MsgScenarioUpdate, mq.TargetAll, testSandboxName) err = mqLocal.SendMsg(msg) err = mqLocal.SendMsg(msg) if err != nil { if err != nil { log.Error("Failed to send message: ", err) log.Error("Failed to send message: ", err) Loading @@ -6725,7 +6726,7 @@ func initializeVars() { mod.DbAddress = redisTestAddr mod.DbAddress = redisTestAddr redisAddr = redisTestAddr redisAddr = redisTestAddr influxAddr = influxTestAddr influxAddr = influxTestAddr sandboxName = testScenarioName sandboxName = testSandboxName } } func initialiseScenario(testScenario string) { func initialiseScenario(testScenario string) { Loading @@ -6734,7 +6735,7 @@ func initialiseScenario(testScenario string) { cleanUp() cleanUp() cfg := mod.ModelCfg{ cfg := mod.ModelCfg{ Name: testScenarioName, Name: testSandboxName, Namespace: sandboxName, Namespace: sandboxName, Module: "test-mod", Module: "test-mod", UpdateCb: nil, UpdateCb: nil, Loading @@ -6749,7 +6750,7 @@ func initialiseScenario(testScenario string) { } } // Create message queue // Create message queue mqLocal, err = mq.NewMsgQueue(mq.GetLocalName(testScenarioName), "test-mod", testScenarioName, redisAddr) mqLocal, err = mq.NewMsgQueue(mq.GetLocalName(testSandboxName), "test-mod", testSandboxName, redisAddr) if err != nil { if err != nil { log.Error("Failed to create Message Queue with error: ", err) log.Error("Failed to create Message Queue with error: ", err) return return Loading @@ -6769,7 +6770,7 @@ func initialiseScenario(testScenario string) { return return } } msg := mqLocal.CreateMsg(mq.MsgScenarioActivate, mq.TargetAll, testScenarioName) msg := mqLocal.CreateMsg(mq.MsgScenarioActivate, mq.TargetAll, testSandboxName) err = mqLocal.SendMsg(msg) err = mqLocal.SendMsg(msg) if err != nil { if err != nil { log.Error("Failed to send message: ", err) log.Error("Failed to send message: ", err) Loading