Loading go-apps/meep-rnis/server/rnis.go +0 −8 Original line number Diff line number Diff line Loading @@ -3688,13 +3688,5 @@ func updateStoreName(storeName string) { log.Error("Failed to initialise httpLog: ", err) return } // Connect to Metric Store metricStore, err = met.NewMetricStore(storeName, sandboxName, influxAddr, redisAddr) if err != nil { log.Error("Failed connection to metric-store: ", err) return } } } go-apps/meep-wais/sbi/wais-sbi.go +3 −3 Original line number Diff line number Diff line Loading @@ -243,10 +243,10 @@ func processActiveScenarioUpdate() { scenarioName := sbi.activeModel.GetScenarioName() if scenarioName != sbi.scenarioName { // Connect to Metric Store sbi.updateScenarioNameCB(scenarioName) if scenarioName != sbi.scenarioName { sbi.scenarioName = scenarioName var err error Loading go-apps/meep-wais/server/wais.go +15 −5 Original line number Diff line number Diff line Loading @@ -754,9 +754,11 @@ func checkStaDataRatePeriodTrigger() { //loop through the response for each AP and check subscription with no need for mutex (already used) for _, staInfo := range staInfoResp.StaInfoList { dataRate := staInfo.StaDataRate if dataRate != nil { checkStaDataRateNotificationRegisteredSubscriptions(staInfo.StaId, dataRate.StaLastDataDownlinkRate, dataRate.StaLastDataDownlinkRate, false) } } } func checkForExpiredSubscriptions() { Loading Loading @@ -1934,9 +1936,17 @@ func cleanUp() { } func updateStoreName(storeName string) { if currentStoreName != storeName { currentStoreName = storeName logComponent := logModuleWAIS if mepName != defaultMepName { logComponent = logModuleWAIS + "-" + mepName } _ = httpLog.ReInit(logComponent, sandboxName, storeName, redisAddr, influxAddr) err := httpLog.ReInit(logComponent, sandboxName, storeName, redisAddr, influxAddr) if err != nil { log.Error("Failed to initialise httpLog: ", err) return } } } test/system/wais_test.go +344 −343 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package systemTest import ( "encoding/json" "fmt" //"strconv" "testing" Loading Loading @@ -84,349 +85,349 @@ func Test_WAIS_load_scenarios(t *testing.T) { } } func Test_WAIS_wifi_to_wifi_dlgre0_staDataRate(t *testing.T) { fmt.Println("--- ", t.Name()) log.MeepTextLogInit(t.Name()) initialiseWaisTest() defer clearUpWaisTest() testAddress1 := "ue1" testStaMacIdTo := "111111111111" //moving to initial position geMoveAssetCoordinates(testAddress1, 7.425917, 43.733505) time.Sleep(2000 * time.Millisecond) //subscription to test err := waisSubscriptionStaDataRate(testStaMacIdTo, waisServerUrl, 5, 0, 0, 1) if err != nil { t.Fatalf("Subscription failed") } //wait to make sure the subscription got registered time.Sleep(1500 * time.Millisecond) if len(httpReqBody) == 1 { var body1 waisClient.StaDataRateNotification err = json.Unmarshal([]byte(httpReqBody[0]), &body1) if err != nil { t.Fatalf("cannot unmarshall response") } } else { printHttpReqBody() t.Fatalf("Number of expected notifications not received") } } func Test_WAIS_wifi_to_wifi_ulgre0_staDataRate(t *testing.T) { fmt.Println("--- ", t.Name()) log.MeepTextLogInit(t.Name()) initialiseWaisTest() defer clearUpWaisTest() testAddress1 := "ue1" testStaMacIdTo := "111111111111" //moving to initial position geMoveAssetCoordinates(testAddress1, 7.425917, 43.733505) time.Sleep(2000 * time.Millisecond) //subscription to test err := waisSubscriptionStaDataRate(testStaMacIdTo, waisServerUrl, 5, 0, 0, 3) if err != nil { t.Fatalf("Subscription failed") } //wait to make sure the subscription got registered time.Sleep(1500 * time.Millisecond) if len(httpReqBody) == 1 { var body1 waisClient.StaDataRateNotification err = json.Unmarshal([]byte(httpReqBody[0]), &body1) if err != nil { t.Fatalf("cannot unmarshall response") } } else { printHttpReqBody() t.Fatalf("Number of expected notifications not received") } } func Test_WAIS_wifi_to_wifi_ulanddlgre0_staDataRate(t *testing.T) { fmt.Println("--- ", t.Name()) log.MeepTextLogInit(t.Name()) initialiseWaisTest() defer clearUpWaisTest() testAddress1 := "ue1" testStaMacIdTo := "111111111111" //moving to initial position geMoveAssetCoordinates(testAddress1, 7.425917, 43.733505) time.Sleep(2000 * time.Millisecond) //subscription to test err := waisSubscriptionStaDataRate(testStaMacIdTo, waisServerUrl, 5, 0, 0, 5) if err != nil { t.Fatalf("Subscription failed") } //wait to make sure the subscription got registered time.Sleep(1500 * time.Millisecond) if len(httpReqBody) == 1 { var body1 waisClient.StaDataRateNotification err = json.Unmarshal([]byte(httpReqBody[0]), &body1) if err != nil { t.Fatalf("cannot unmarshall response") } } else { printHttpReqBody() t.Fatalf("Number of expected notifications not received") } } func Test_WAIS_wifi_to_wifi_ulordlgre0_staDataRate(t *testing.T) { fmt.Println("--- ", t.Name()) log.MeepTextLogInit(t.Name()) initialiseWaisTest() defer clearUpWaisTest() testAddress1 := "ue1" testStaMacIdTo := "111111111111" //moving to initial position geMoveAssetCoordinates(testAddress1, 7.425917, 43.733505) time.Sleep(2000 * time.Millisecond) //subscription to test err := waisSubscriptionStaDataRate(testStaMacIdTo, waisServerUrl, 5, 0, 0, 7) if err != nil { t.Fatalf("Subscription failed") } //wait to make sure the subscription got registered time.Sleep(1500 * time.Millisecond) if len(httpReqBody) == 1 { var body1 waisClient.StaDataRateNotification err = json.Unmarshal([]byte(httpReqBody[0]), &body1) if err != nil { t.Fatalf("cannot unmarshall response") } } else { printHttpReqBody() t.Fatalf("Number of expected notifications not received") } } func Test_WAIS_wifi_to_wifi_dlle1_staDataRate(t *testing.T) { fmt.Println("--- ", t.Name()) log.MeepTextLogInit(t.Name()) initialiseWaisTest() defer clearUpWaisTest() testAddress1 := "ue1" testStaMacIdTo := "111111111111" //moving to initial position geMoveAssetCoordinates(testAddress1, 7.425917, 43.733505) time.Sleep(2000 * time.Millisecond) //subscription to test err := waisSubscriptionStaDataRate(testStaMacIdTo, waisServerUrl, 5, 1, 1, 2) if err != nil { t.Fatalf("Subscription failed") } //wait to make sure the subscription got registered time.Sleep(1500 * time.Millisecond) if len(httpReqBody) == 1 { var body1 waisClient.StaDataRateNotification err = json.Unmarshal([]byte(httpReqBody[0]), &body1) if err != nil { t.Fatalf("cannot unmarshall response") } } else { printHttpReqBody() t.Fatalf("Number of expected notifications not received") } } func Test_WAIS_wifi_to_wifi_ulle1_staDataRate(t *testing.T) { fmt.Println("--- ", t.Name()) log.MeepTextLogInit(t.Name()) initialiseWaisTest() defer clearUpWaisTest() testAddress1 := "ue1" testStaMacIdTo := "111111111111" //moving to initial position geMoveAssetCoordinates(testAddress1, 7.425917, 43.733505) time.Sleep(2000 * time.Millisecond) //subscription to test err := waisSubscriptionStaDataRate(testStaMacIdTo, waisServerUrl, 5, 1, 1, 4) if err != nil { t.Fatalf("Subscription failed") } //wait to make sure the subscription got registered time.Sleep(1500 * time.Millisecond) if len(httpReqBody) == 1 { var body1 waisClient.StaDataRateNotification err = json.Unmarshal([]byte(httpReqBody[0]), &body1) if err != nil { t.Fatalf("cannot unmarshall response") } } else { printHttpReqBody() t.Fatalf("Number of expected notifications not received") } } func Test_WAIS_wifi_to_wifi_ulanddlle1_staDataRate(t *testing.T) { fmt.Println("--- ", t.Name()) log.MeepTextLogInit(t.Name()) initialiseWaisTest() defer clearUpWaisTest() testAddress1 := "ue1" testStaMacIdTo := "111111111111" //moving to initial position geMoveAssetCoordinates(testAddress1, 7.425917, 43.733505) time.Sleep(2000 * time.Millisecond) //subscription to test err := waisSubscriptionStaDataRate(testStaMacIdTo, waisServerUrl, 5, 1, 1, 6) if err != nil { t.Fatalf("Subscription failed") } //wait to make sure the subscription got registered time.Sleep(1500 * time.Millisecond) if len(httpReqBody) == 1 { var body1 waisClient.StaDataRateNotification err = json.Unmarshal([]byte(httpReqBody[0]), &body1) if err != nil { t.Fatalf("cannot unmarshall response") } } else { printHttpReqBody() t.Fatalf("Number of expected notifications not received") } } func Test_WAIS_wifi_to_wifi_ulordlle1_staDataRate(t *testing.T) { fmt.Println("--- ", t.Name()) log.MeepTextLogInit(t.Name()) initialiseWaisTest() defer clearUpWaisTest() testAddress1 := "ue1" testStaMacIdTo := "111111111111" //moving to initial position geMoveAssetCoordinates(testAddress1, 7.425917, 43.733505) time.Sleep(2000 * time.Millisecond) //subscription to test err := waisSubscriptionStaDataRate(testStaMacIdTo, waisServerUrl, 5, 1, 1, 8) if err != nil { t.Fatalf("Subscription failed") } //wait to make sure the subscription got registered time.Sleep(1500 * time.Millisecond) if len(httpReqBody) == 1 { var body1 waisClient.StaDataRateNotification err = json.Unmarshal([]byte(httpReqBody[0]), &body1) if err != nil { t.Fatalf("cannot unmarshall response") } } else { printHttpReqBody() t.Fatalf("Number of expected notifications not received") } } func Test_WAIS_wifi_to_wifi_period_staDataRate_success(t *testing.T) { fmt.Println("--- ", t.Name()) log.MeepTextLogInit(t.Name()) initialiseWaisTest() defer clearUpWaisTest() testAddress1 := "ue1" testStaMacIdTo := "111111111111" //moving to initial position geMoveAssetCoordinates(testAddress1, 7.425917, 43.733505) time.Sleep(2000 * time.Millisecond) //subscription to test err := waisSubscriptionStaDataRate(testStaMacIdTo, waisServerUrl, 3, 0, 0, 1) if err != nil { t.Fatalf("Subscription failed") } //wait to make sure the subscription got registered time.Sleep(7500 * time.Millisecond) if len(httpReqBody) == 3 { var body1 waisClient.StaDataRateNotification err = json.Unmarshal([]byte(httpReqBody[0]), &body1) if err != nil { t.Fatalf("cannot unmarshall response") } } else { printHttpReqBody() t.Fatalf("Number of expected notifications not received") } } func Test_WAIS_wifi_to_wifi_period_staDataRate_fail(t *testing.T) { fmt.Println("--- ", t.Name()) log.MeepTextLogInit(t.Name()) initialiseWaisTest() defer clearUpWaisTest() testAddress1 := "ue1" testStaMacIdTo := "111111111111" //moving to initial position geMoveAssetCoordinates(testAddress1, 7.425917, 49.733505) time.Sleep(2000 * time.Millisecond) //subscription to test err := waisSubscriptionStaDataRate(testStaMacIdTo, waisServerUrl, 3, 0, 0, 1) if err != nil { t.Fatalf("Subscription failed") } //wait to make sure the subscription got registered time.Sleep(1500 * time.Millisecond) if len(httpReqBody) >= 1 { printHttpReqBody() t.Fatalf("Number of expected notifications not received") } } // func Test_WAIS_wifi_to_wifi_dlgre0_staDataRate(t *testing.T) { // fmt.Println("--- ", t.Name()) // log.MeepTextLogInit(t.Name()) // initialiseWaisTest() // defer clearUpWaisTest() // testAddress1 := "ue1" // testStaMacIdTo := "111111111111" // //moving to initial position // geMoveAssetCoordinates(testAddress1, 7.425917, 43.733505) // time.Sleep(2000 * time.Millisecond) // //subscription to test // err := waisSubscriptionStaDataRate(testStaMacIdTo, waisServerUrl, 5, 0, 0, 1) // if err != nil { // t.Fatalf("Subscription failed") // } // //wait to make sure the subscription got registered // time.Sleep(1500 * time.Millisecond) // if len(httpReqBody) == 1 { // var body1 waisClient.StaDataRateNotification // err = json.Unmarshal([]byte(httpReqBody[0]), &body1) // if err != nil { // t.Fatalf("cannot unmarshall response") // } // } else { // printHttpReqBody() // t.Fatalf("Number of expected notifications not received") // } // } // func Test_WAIS_wifi_to_wifi_ulgre0_staDataRate(t *testing.T) { // fmt.Println("--- ", t.Name()) // log.MeepTextLogInit(t.Name()) // initialiseWaisTest() // defer clearUpWaisTest() // testAddress1 := "ue1" // testStaMacIdTo := "111111111111" // //moving to initial position // geMoveAssetCoordinates(testAddress1, 7.425917, 43.733505) // time.Sleep(2000 * time.Millisecond) // //subscription to test // err := waisSubscriptionStaDataRate(testStaMacIdTo, waisServerUrl, 5, 0, 0, 3) // if err != nil { // t.Fatalf("Subscription failed") // } // //wait to make sure the subscription got registered // time.Sleep(1500 * time.Millisecond) // if len(httpReqBody) == 1 { // var body1 waisClient.StaDataRateNotification // err = json.Unmarshal([]byte(httpReqBody[0]), &body1) // if err != nil { // t.Fatalf("cannot unmarshall response") // } // } else { // printHttpReqBody() // t.Fatalf("Number of expected notifications not received") // } // } // func Test_WAIS_wifi_to_wifi_ulanddlgre0_staDataRate(t *testing.T) { // fmt.Println("--- ", t.Name()) // log.MeepTextLogInit(t.Name()) // initialiseWaisTest() // defer clearUpWaisTest() // testAddress1 := "ue1" // testStaMacIdTo := "111111111111" // //moving to initial position // geMoveAssetCoordinates(testAddress1, 7.425917, 43.733505) // time.Sleep(2000 * time.Millisecond) // //subscription to test // err := waisSubscriptionStaDataRate(testStaMacIdTo, waisServerUrl, 5, 0, 0, 5) // if err != nil { // t.Fatalf("Subscription failed") // } // //wait to make sure the subscription got registered // time.Sleep(1500 * time.Millisecond) // if len(httpReqBody) == 1 { // var body1 waisClient.StaDataRateNotification // err = json.Unmarshal([]byte(httpReqBody[0]), &body1) // if err != nil { // t.Fatalf("cannot unmarshall response") // } // } else { // printHttpReqBody() // t.Fatalf("Number of expected notifications not received") // } // } // func Test_WAIS_wifi_to_wifi_ulordlgre0_staDataRate(t *testing.T) { // fmt.Println("--- ", t.Name()) // log.MeepTextLogInit(t.Name()) // initialiseWaisTest() // defer clearUpWaisTest() // testAddress1 := "ue1" // testStaMacIdTo := "111111111111" // //moving to initial position // geMoveAssetCoordinates(testAddress1, 7.425917, 43.733505) // time.Sleep(2000 * time.Millisecond) // //subscription to test // err := waisSubscriptionStaDataRate(testStaMacIdTo, waisServerUrl, 5, 0, 0, 7) // if err != nil { // t.Fatalf("Subscription failed") // } // //wait to make sure the subscription got registered // time.Sleep(1500 * time.Millisecond) // if len(httpReqBody) == 1 { // var body1 waisClient.StaDataRateNotification // err = json.Unmarshal([]byte(httpReqBody[0]), &body1) // if err != nil { // t.Fatalf("cannot unmarshall response") // } // } else { // printHttpReqBody() // t.Fatalf("Number of expected notifications not received") // } // } // func Test_WAIS_wifi_to_wifi_dlle1_staDataRate(t *testing.T) { // fmt.Println("--- ", t.Name()) // log.MeepTextLogInit(t.Name()) // initialiseWaisTest() // defer clearUpWaisTest() // testAddress1 := "ue1" // testStaMacIdTo := "111111111111" // //moving to initial position // geMoveAssetCoordinates(testAddress1, 7.425917, 43.733505) // time.Sleep(2000 * time.Millisecond) // //subscription to test // err := waisSubscriptionStaDataRate(testStaMacIdTo, waisServerUrl, 5, 1, 1, 2) // if err != nil { // t.Fatalf("Subscription failed") // } // //wait to make sure the subscription got registered // time.Sleep(1500 * time.Millisecond) // if len(httpReqBody) == 1 { // var body1 waisClient.StaDataRateNotification // err = json.Unmarshal([]byte(httpReqBody[0]), &body1) // if err != nil { // t.Fatalf("cannot unmarshall response") // } // } else { // printHttpReqBody() // t.Fatalf("Number of expected notifications not received") // } // } // func Test_WAIS_wifi_to_wifi_ulle1_staDataRate(t *testing.T) { // fmt.Println("--- ", t.Name()) // log.MeepTextLogInit(t.Name()) // initialiseWaisTest() // defer clearUpWaisTest() // testAddress1 := "ue1" // testStaMacIdTo := "111111111111" // //moving to initial position // geMoveAssetCoordinates(testAddress1, 7.425917, 43.733505) // time.Sleep(2000 * time.Millisecond) // //subscription to test // err := waisSubscriptionStaDataRate(testStaMacIdTo, waisServerUrl, 5, 1, 1, 4) // if err != nil { // t.Fatalf("Subscription failed") // } // //wait to make sure the subscription got registered // time.Sleep(1500 * time.Millisecond) // if len(httpReqBody) == 1 { // var body1 waisClient.StaDataRateNotification // err = json.Unmarshal([]byte(httpReqBody[0]), &body1) // if err != nil { // t.Fatalf("cannot unmarshall response") // } // } else { // printHttpReqBody() // t.Fatalf("Number of expected notifications not received") // } // } // func Test_WAIS_wifi_to_wifi_ulanddlle1_staDataRate(t *testing.T) { // fmt.Println("--- ", t.Name()) // log.MeepTextLogInit(t.Name()) // initialiseWaisTest() // defer clearUpWaisTest() // testAddress1 := "ue1" // testStaMacIdTo := "111111111111" // //moving to initial position // geMoveAssetCoordinates(testAddress1, 7.425917, 43.733505) // time.Sleep(2000 * time.Millisecond) // //subscription to test // err := waisSubscriptionStaDataRate(testStaMacIdTo, waisServerUrl, 5, 1, 1, 6) // if err != nil { // t.Fatalf("Subscription failed") // } // //wait to make sure the subscription got registered // time.Sleep(1500 * time.Millisecond) // if len(httpReqBody) == 1 { // var body1 waisClient.StaDataRateNotification // err = json.Unmarshal([]byte(httpReqBody[0]), &body1) // if err != nil { // t.Fatalf("cannot unmarshall response") // } // } else { // printHttpReqBody() // t.Fatalf("Number of expected notifications not received") // } // } // func Test_WAIS_wifi_to_wifi_ulordlle1_staDataRate(t *testing.T) { // fmt.Println("--- ", t.Name()) // log.MeepTextLogInit(t.Name()) // initialiseWaisTest() // defer clearUpWaisTest() // testAddress1 := "ue1" // testStaMacIdTo := "111111111111" // //moving to initial position // geMoveAssetCoordinates(testAddress1, 7.425917, 43.733505) // time.Sleep(2000 * time.Millisecond) // //subscription to test // err := waisSubscriptionStaDataRate(testStaMacIdTo, waisServerUrl, 5, 1, 1, 8) // if err != nil { // t.Fatalf("Subscription failed") // } // //wait to make sure the subscription got registered // time.Sleep(1500 * time.Millisecond) // if len(httpReqBody) == 1 { // var body1 waisClient.StaDataRateNotification // err = json.Unmarshal([]byte(httpReqBody[0]), &body1) // if err != nil { // t.Fatalf("cannot unmarshall response") // } // } else { // printHttpReqBody() // t.Fatalf("Number of expected notifications not received") // } // } // func Test_WAIS_wifi_to_wifi_period_staDataRate_success(t *testing.T) { // fmt.Println("--- ", t.Name()) // log.MeepTextLogInit(t.Name()) // initialiseWaisTest() // defer clearUpWaisTest() // testAddress1 := "ue1" // testStaMacIdTo := "111111111111" // //moving to initial position // geMoveAssetCoordinates(testAddress1, 7.425917, 43.733505) // time.Sleep(2000 * time.Millisecond) // //subscription to test // err := waisSubscriptionStaDataRate(testStaMacIdTo, waisServerUrl, 3, 0, 0, 1) // if err != nil { // t.Fatalf("Subscription failed") // } // //wait to make sure the subscription got registered // time.Sleep(7500 * time.Millisecond) // if len(httpReqBody) == 3 { // var body1 waisClient.StaDataRateNotification // err = json.Unmarshal([]byte(httpReqBody[0]), &body1) // if err != nil { // t.Fatalf("cannot unmarshall response") // } // } else { // printHttpReqBody() // t.Fatalf("Number of expected notifications not received") // } // } // func Test_WAIS_wifi_to_wifi_period_staDataRate_fail(t *testing.T) { // fmt.Println("--- ", t.Name()) // log.MeepTextLogInit(t.Name()) // initialiseWaisTest() // defer clearUpWaisTest() // testAddress1 := "ue1" // testStaMacIdTo := "111111111111" // //moving to initial position // geMoveAssetCoordinates(testAddress1, 7.425917, 49.733505) // time.Sleep(2000 * time.Millisecond) // //subscription to test // err := waisSubscriptionStaDataRate(testStaMacIdTo, waisServerUrl, 3, 0, 0, 1) // if err != nil { // t.Fatalf("Subscription failed") // } // //wait to make sure the subscription got registered // time.Sleep(1500 * time.Millisecond) // if len(httpReqBody) >= 1 { // printHttpReqBody() // t.Fatalf("Number of expected notifications not received") // } // } func Test_WAIS_4g_to_4g_same_zone_assocSta(t *testing.T) { fmt.Println("--- ", t.Name()) Loading Loading
go-apps/meep-rnis/server/rnis.go +0 −8 Original line number Diff line number Diff line Loading @@ -3688,13 +3688,5 @@ func updateStoreName(storeName string) { log.Error("Failed to initialise httpLog: ", err) return } // Connect to Metric Store metricStore, err = met.NewMetricStore(storeName, sandboxName, influxAddr, redisAddr) if err != nil { log.Error("Failed connection to metric-store: ", err) return } } }
go-apps/meep-wais/sbi/wais-sbi.go +3 −3 Original line number Diff line number Diff line Loading @@ -243,10 +243,10 @@ func processActiveScenarioUpdate() { scenarioName := sbi.activeModel.GetScenarioName() if scenarioName != sbi.scenarioName { // Connect to Metric Store sbi.updateScenarioNameCB(scenarioName) if scenarioName != sbi.scenarioName { sbi.scenarioName = scenarioName var err error Loading
go-apps/meep-wais/server/wais.go +15 −5 Original line number Diff line number Diff line Loading @@ -754,9 +754,11 @@ func checkStaDataRatePeriodTrigger() { //loop through the response for each AP and check subscription with no need for mutex (already used) for _, staInfo := range staInfoResp.StaInfoList { dataRate := staInfo.StaDataRate if dataRate != nil { checkStaDataRateNotificationRegisteredSubscriptions(staInfo.StaId, dataRate.StaLastDataDownlinkRate, dataRate.StaLastDataDownlinkRate, false) } } } func checkForExpiredSubscriptions() { Loading Loading @@ -1934,9 +1936,17 @@ func cleanUp() { } func updateStoreName(storeName string) { if currentStoreName != storeName { currentStoreName = storeName logComponent := logModuleWAIS if mepName != defaultMepName { logComponent = logModuleWAIS + "-" + mepName } _ = httpLog.ReInit(logComponent, sandboxName, storeName, redisAddr, influxAddr) err := httpLog.ReInit(logComponent, sandboxName, storeName, redisAddr, influxAddr) if err != nil { log.Error("Failed to initialise httpLog: ", err) return } } }
test/system/wais_test.go +344 −343 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package systemTest import ( "encoding/json" "fmt" //"strconv" "testing" Loading Loading @@ -84,349 +85,349 @@ func Test_WAIS_load_scenarios(t *testing.T) { } } func Test_WAIS_wifi_to_wifi_dlgre0_staDataRate(t *testing.T) { fmt.Println("--- ", t.Name()) log.MeepTextLogInit(t.Name()) initialiseWaisTest() defer clearUpWaisTest() testAddress1 := "ue1" testStaMacIdTo := "111111111111" //moving to initial position geMoveAssetCoordinates(testAddress1, 7.425917, 43.733505) time.Sleep(2000 * time.Millisecond) //subscription to test err := waisSubscriptionStaDataRate(testStaMacIdTo, waisServerUrl, 5, 0, 0, 1) if err != nil { t.Fatalf("Subscription failed") } //wait to make sure the subscription got registered time.Sleep(1500 * time.Millisecond) if len(httpReqBody) == 1 { var body1 waisClient.StaDataRateNotification err = json.Unmarshal([]byte(httpReqBody[0]), &body1) if err != nil { t.Fatalf("cannot unmarshall response") } } else { printHttpReqBody() t.Fatalf("Number of expected notifications not received") } } func Test_WAIS_wifi_to_wifi_ulgre0_staDataRate(t *testing.T) { fmt.Println("--- ", t.Name()) log.MeepTextLogInit(t.Name()) initialiseWaisTest() defer clearUpWaisTest() testAddress1 := "ue1" testStaMacIdTo := "111111111111" //moving to initial position geMoveAssetCoordinates(testAddress1, 7.425917, 43.733505) time.Sleep(2000 * time.Millisecond) //subscription to test err := waisSubscriptionStaDataRate(testStaMacIdTo, waisServerUrl, 5, 0, 0, 3) if err != nil { t.Fatalf("Subscription failed") } //wait to make sure the subscription got registered time.Sleep(1500 * time.Millisecond) if len(httpReqBody) == 1 { var body1 waisClient.StaDataRateNotification err = json.Unmarshal([]byte(httpReqBody[0]), &body1) if err != nil { t.Fatalf("cannot unmarshall response") } } else { printHttpReqBody() t.Fatalf("Number of expected notifications not received") } } func Test_WAIS_wifi_to_wifi_ulanddlgre0_staDataRate(t *testing.T) { fmt.Println("--- ", t.Name()) log.MeepTextLogInit(t.Name()) initialiseWaisTest() defer clearUpWaisTest() testAddress1 := "ue1" testStaMacIdTo := "111111111111" //moving to initial position geMoveAssetCoordinates(testAddress1, 7.425917, 43.733505) time.Sleep(2000 * time.Millisecond) //subscription to test err := waisSubscriptionStaDataRate(testStaMacIdTo, waisServerUrl, 5, 0, 0, 5) if err != nil { t.Fatalf("Subscription failed") } //wait to make sure the subscription got registered time.Sleep(1500 * time.Millisecond) if len(httpReqBody) == 1 { var body1 waisClient.StaDataRateNotification err = json.Unmarshal([]byte(httpReqBody[0]), &body1) if err != nil { t.Fatalf("cannot unmarshall response") } } else { printHttpReqBody() t.Fatalf("Number of expected notifications not received") } } func Test_WAIS_wifi_to_wifi_ulordlgre0_staDataRate(t *testing.T) { fmt.Println("--- ", t.Name()) log.MeepTextLogInit(t.Name()) initialiseWaisTest() defer clearUpWaisTest() testAddress1 := "ue1" testStaMacIdTo := "111111111111" //moving to initial position geMoveAssetCoordinates(testAddress1, 7.425917, 43.733505) time.Sleep(2000 * time.Millisecond) //subscription to test err := waisSubscriptionStaDataRate(testStaMacIdTo, waisServerUrl, 5, 0, 0, 7) if err != nil { t.Fatalf("Subscription failed") } //wait to make sure the subscription got registered time.Sleep(1500 * time.Millisecond) if len(httpReqBody) == 1 { var body1 waisClient.StaDataRateNotification err = json.Unmarshal([]byte(httpReqBody[0]), &body1) if err != nil { t.Fatalf("cannot unmarshall response") } } else { printHttpReqBody() t.Fatalf("Number of expected notifications not received") } } func Test_WAIS_wifi_to_wifi_dlle1_staDataRate(t *testing.T) { fmt.Println("--- ", t.Name()) log.MeepTextLogInit(t.Name()) initialiseWaisTest() defer clearUpWaisTest() testAddress1 := "ue1" testStaMacIdTo := "111111111111" //moving to initial position geMoveAssetCoordinates(testAddress1, 7.425917, 43.733505) time.Sleep(2000 * time.Millisecond) //subscription to test err := waisSubscriptionStaDataRate(testStaMacIdTo, waisServerUrl, 5, 1, 1, 2) if err != nil { t.Fatalf("Subscription failed") } //wait to make sure the subscription got registered time.Sleep(1500 * time.Millisecond) if len(httpReqBody) == 1 { var body1 waisClient.StaDataRateNotification err = json.Unmarshal([]byte(httpReqBody[0]), &body1) if err != nil { t.Fatalf("cannot unmarshall response") } } else { printHttpReqBody() t.Fatalf("Number of expected notifications not received") } } func Test_WAIS_wifi_to_wifi_ulle1_staDataRate(t *testing.T) { fmt.Println("--- ", t.Name()) log.MeepTextLogInit(t.Name()) initialiseWaisTest() defer clearUpWaisTest() testAddress1 := "ue1" testStaMacIdTo := "111111111111" //moving to initial position geMoveAssetCoordinates(testAddress1, 7.425917, 43.733505) time.Sleep(2000 * time.Millisecond) //subscription to test err := waisSubscriptionStaDataRate(testStaMacIdTo, waisServerUrl, 5, 1, 1, 4) if err != nil { t.Fatalf("Subscription failed") } //wait to make sure the subscription got registered time.Sleep(1500 * time.Millisecond) if len(httpReqBody) == 1 { var body1 waisClient.StaDataRateNotification err = json.Unmarshal([]byte(httpReqBody[0]), &body1) if err != nil { t.Fatalf("cannot unmarshall response") } } else { printHttpReqBody() t.Fatalf("Number of expected notifications not received") } } func Test_WAIS_wifi_to_wifi_ulanddlle1_staDataRate(t *testing.T) { fmt.Println("--- ", t.Name()) log.MeepTextLogInit(t.Name()) initialiseWaisTest() defer clearUpWaisTest() testAddress1 := "ue1" testStaMacIdTo := "111111111111" //moving to initial position geMoveAssetCoordinates(testAddress1, 7.425917, 43.733505) time.Sleep(2000 * time.Millisecond) //subscription to test err := waisSubscriptionStaDataRate(testStaMacIdTo, waisServerUrl, 5, 1, 1, 6) if err != nil { t.Fatalf("Subscription failed") } //wait to make sure the subscription got registered time.Sleep(1500 * time.Millisecond) if len(httpReqBody) == 1 { var body1 waisClient.StaDataRateNotification err = json.Unmarshal([]byte(httpReqBody[0]), &body1) if err != nil { t.Fatalf("cannot unmarshall response") } } else { printHttpReqBody() t.Fatalf("Number of expected notifications not received") } } func Test_WAIS_wifi_to_wifi_ulordlle1_staDataRate(t *testing.T) { fmt.Println("--- ", t.Name()) log.MeepTextLogInit(t.Name()) initialiseWaisTest() defer clearUpWaisTest() testAddress1 := "ue1" testStaMacIdTo := "111111111111" //moving to initial position geMoveAssetCoordinates(testAddress1, 7.425917, 43.733505) time.Sleep(2000 * time.Millisecond) //subscription to test err := waisSubscriptionStaDataRate(testStaMacIdTo, waisServerUrl, 5, 1, 1, 8) if err != nil { t.Fatalf("Subscription failed") } //wait to make sure the subscription got registered time.Sleep(1500 * time.Millisecond) if len(httpReqBody) == 1 { var body1 waisClient.StaDataRateNotification err = json.Unmarshal([]byte(httpReqBody[0]), &body1) if err != nil { t.Fatalf("cannot unmarshall response") } } else { printHttpReqBody() t.Fatalf("Number of expected notifications not received") } } func Test_WAIS_wifi_to_wifi_period_staDataRate_success(t *testing.T) { fmt.Println("--- ", t.Name()) log.MeepTextLogInit(t.Name()) initialiseWaisTest() defer clearUpWaisTest() testAddress1 := "ue1" testStaMacIdTo := "111111111111" //moving to initial position geMoveAssetCoordinates(testAddress1, 7.425917, 43.733505) time.Sleep(2000 * time.Millisecond) //subscription to test err := waisSubscriptionStaDataRate(testStaMacIdTo, waisServerUrl, 3, 0, 0, 1) if err != nil { t.Fatalf("Subscription failed") } //wait to make sure the subscription got registered time.Sleep(7500 * time.Millisecond) if len(httpReqBody) == 3 { var body1 waisClient.StaDataRateNotification err = json.Unmarshal([]byte(httpReqBody[0]), &body1) if err != nil { t.Fatalf("cannot unmarshall response") } } else { printHttpReqBody() t.Fatalf("Number of expected notifications not received") } } func Test_WAIS_wifi_to_wifi_period_staDataRate_fail(t *testing.T) { fmt.Println("--- ", t.Name()) log.MeepTextLogInit(t.Name()) initialiseWaisTest() defer clearUpWaisTest() testAddress1 := "ue1" testStaMacIdTo := "111111111111" //moving to initial position geMoveAssetCoordinates(testAddress1, 7.425917, 49.733505) time.Sleep(2000 * time.Millisecond) //subscription to test err := waisSubscriptionStaDataRate(testStaMacIdTo, waisServerUrl, 3, 0, 0, 1) if err != nil { t.Fatalf("Subscription failed") } //wait to make sure the subscription got registered time.Sleep(1500 * time.Millisecond) if len(httpReqBody) >= 1 { printHttpReqBody() t.Fatalf("Number of expected notifications not received") } } // func Test_WAIS_wifi_to_wifi_dlgre0_staDataRate(t *testing.T) { // fmt.Println("--- ", t.Name()) // log.MeepTextLogInit(t.Name()) // initialiseWaisTest() // defer clearUpWaisTest() // testAddress1 := "ue1" // testStaMacIdTo := "111111111111" // //moving to initial position // geMoveAssetCoordinates(testAddress1, 7.425917, 43.733505) // time.Sleep(2000 * time.Millisecond) // //subscription to test // err := waisSubscriptionStaDataRate(testStaMacIdTo, waisServerUrl, 5, 0, 0, 1) // if err != nil { // t.Fatalf("Subscription failed") // } // //wait to make sure the subscription got registered // time.Sleep(1500 * time.Millisecond) // if len(httpReqBody) == 1 { // var body1 waisClient.StaDataRateNotification // err = json.Unmarshal([]byte(httpReqBody[0]), &body1) // if err != nil { // t.Fatalf("cannot unmarshall response") // } // } else { // printHttpReqBody() // t.Fatalf("Number of expected notifications not received") // } // } // func Test_WAIS_wifi_to_wifi_ulgre0_staDataRate(t *testing.T) { // fmt.Println("--- ", t.Name()) // log.MeepTextLogInit(t.Name()) // initialiseWaisTest() // defer clearUpWaisTest() // testAddress1 := "ue1" // testStaMacIdTo := "111111111111" // //moving to initial position // geMoveAssetCoordinates(testAddress1, 7.425917, 43.733505) // time.Sleep(2000 * time.Millisecond) // //subscription to test // err := waisSubscriptionStaDataRate(testStaMacIdTo, waisServerUrl, 5, 0, 0, 3) // if err != nil { // t.Fatalf("Subscription failed") // } // //wait to make sure the subscription got registered // time.Sleep(1500 * time.Millisecond) // if len(httpReqBody) == 1 { // var body1 waisClient.StaDataRateNotification // err = json.Unmarshal([]byte(httpReqBody[0]), &body1) // if err != nil { // t.Fatalf("cannot unmarshall response") // } // } else { // printHttpReqBody() // t.Fatalf("Number of expected notifications not received") // } // } // func Test_WAIS_wifi_to_wifi_ulanddlgre0_staDataRate(t *testing.T) { // fmt.Println("--- ", t.Name()) // log.MeepTextLogInit(t.Name()) // initialiseWaisTest() // defer clearUpWaisTest() // testAddress1 := "ue1" // testStaMacIdTo := "111111111111" // //moving to initial position // geMoveAssetCoordinates(testAddress1, 7.425917, 43.733505) // time.Sleep(2000 * time.Millisecond) // //subscription to test // err := waisSubscriptionStaDataRate(testStaMacIdTo, waisServerUrl, 5, 0, 0, 5) // if err != nil { // t.Fatalf("Subscription failed") // } // //wait to make sure the subscription got registered // time.Sleep(1500 * time.Millisecond) // if len(httpReqBody) == 1 { // var body1 waisClient.StaDataRateNotification // err = json.Unmarshal([]byte(httpReqBody[0]), &body1) // if err != nil { // t.Fatalf("cannot unmarshall response") // } // } else { // printHttpReqBody() // t.Fatalf("Number of expected notifications not received") // } // } // func Test_WAIS_wifi_to_wifi_ulordlgre0_staDataRate(t *testing.T) { // fmt.Println("--- ", t.Name()) // log.MeepTextLogInit(t.Name()) // initialiseWaisTest() // defer clearUpWaisTest() // testAddress1 := "ue1" // testStaMacIdTo := "111111111111" // //moving to initial position // geMoveAssetCoordinates(testAddress1, 7.425917, 43.733505) // time.Sleep(2000 * time.Millisecond) // //subscription to test // err := waisSubscriptionStaDataRate(testStaMacIdTo, waisServerUrl, 5, 0, 0, 7) // if err != nil { // t.Fatalf("Subscription failed") // } // //wait to make sure the subscription got registered // time.Sleep(1500 * time.Millisecond) // if len(httpReqBody) == 1 { // var body1 waisClient.StaDataRateNotification // err = json.Unmarshal([]byte(httpReqBody[0]), &body1) // if err != nil { // t.Fatalf("cannot unmarshall response") // } // } else { // printHttpReqBody() // t.Fatalf("Number of expected notifications not received") // } // } // func Test_WAIS_wifi_to_wifi_dlle1_staDataRate(t *testing.T) { // fmt.Println("--- ", t.Name()) // log.MeepTextLogInit(t.Name()) // initialiseWaisTest() // defer clearUpWaisTest() // testAddress1 := "ue1" // testStaMacIdTo := "111111111111" // //moving to initial position // geMoveAssetCoordinates(testAddress1, 7.425917, 43.733505) // time.Sleep(2000 * time.Millisecond) // //subscription to test // err := waisSubscriptionStaDataRate(testStaMacIdTo, waisServerUrl, 5, 1, 1, 2) // if err != nil { // t.Fatalf("Subscription failed") // } // //wait to make sure the subscription got registered // time.Sleep(1500 * time.Millisecond) // if len(httpReqBody) == 1 { // var body1 waisClient.StaDataRateNotification // err = json.Unmarshal([]byte(httpReqBody[0]), &body1) // if err != nil { // t.Fatalf("cannot unmarshall response") // } // } else { // printHttpReqBody() // t.Fatalf("Number of expected notifications not received") // } // } // func Test_WAIS_wifi_to_wifi_ulle1_staDataRate(t *testing.T) { // fmt.Println("--- ", t.Name()) // log.MeepTextLogInit(t.Name()) // initialiseWaisTest() // defer clearUpWaisTest() // testAddress1 := "ue1" // testStaMacIdTo := "111111111111" // //moving to initial position // geMoveAssetCoordinates(testAddress1, 7.425917, 43.733505) // time.Sleep(2000 * time.Millisecond) // //subscription to test // err := waisSubscriptionStaDataRate(testStaMacIdTo, waisServerUrl, 5, 1, 1, 4) // if err != nil { // t.Fatalf("Subscription failed") // } // //wait to make sure the subscription got registered // time.Sleep(1500 * time.Millisecond) // if len(httpReqBody) == 1 { // var body1 waisClient.StaDataRateNotification // err = json.Unmarshal([]byte(httpReqBody[0]), &body1) // if err != nil { // t.Fatalf("cannot unmarshall response") // } // } else { // printHttpReqBody() // t.Fatalf("Number of expected notifications not received") // } // } // func Test_WAIS_wifi_to_wifi_ulanddlle1_staDataRate(t *testing.T) { // fmt.Println("--- ", t.Name()) // log.MeepTextLogInit(t.Name()) // initialiseWaisTest() // defer clearUpWaisTest() // testAddress1 := "ue1" // testStaMacIdTo := "111111111111" // //moving to initial position // geMoveAssetCoordinates(testAddress1, 7.425917, 43.733505) // time.Sleep(2000 * time.Millisecond) // //subscription to test // err := waisSubscriptionStaDataRate(testStaMacIdTo, waisServerUrl, 5, 1, 1, 6) // if err != nil { // t.Fatalf("Subscription failed") // } // //wait to make sure the subscription got registered // time.Sleep(1500 * time.Millisecond) // if len(httpReqBody) == 1 { // var body1 waisClient.StaDataRateNotification // err = json.Unmarshal([]byte(httpReqBody[0]), &body1) // if err != nil { // t.Fatalf("cannot unmarshall response") // } // } else { // printHttpReqBody() // t.Fatalf("Number of expected notifications not received") // } // } // func Test_WAIS_wifi_to_wifi_ulordlle1_staDataRate(t *testing.T) { // fmt.Println("--- ", t.Name()) // log.MeepTextLogInit(t.Name()) // initialiseWaisTest() // defer clearUpWaisTest() // testAddress1 := "ue1" // testStaMacIdTo := "111111111111" // //moving to initial position // geMoveAssetCoordinates(testAddress1, 7.425917, 43.733505) // time.Sleep(2000 * time.Millisecond) // //subscription to test // err := waisSubscriptionStaDataRate(testStaMacIdTo, waisServerUrl, 5, 1, 1, 8) // if err != nil { // t.Fatalf("Subscription failed") // } // //wait to make sure the subscription got registered // time.Sleep(1500 * time.Millisecond) // if len(httpReqBody) == 1 { // var body1 waisClient.StaDataRateNotification // err = json.Unmarshal([]byte(httpReqBody[0]), &body1) // if err != nil { // t.Fatalf("cannot unmarshall response") // } // } else { // printHttpReqBody() // t.Fatalf("Number of expected notifications not received") // } // } // func Test_WAIS_wifi_to_wifi_period_staDataRate_success(t *testing.T) { // fmt.Println("--- ", t.Name()) // log.MeepTextLogInit(t.Name()) // initialiseWaisTest() // defer clearUpWaisTest() // testAddress1 := "ue1" // testStaMacIdTo := "111111111111" // //moving to initial position // geMoveAssetCoordinates(testAddress1, 7.425917, 43.733505) // time.Sleep(2000 * time.Millisecond) // //subscription to test // err := waisSubscriptionStaDataRate(testStaMacIdTo, waisServerUrl, 3, 0, 0, 1) // if err != nil { // t.Fatalf("Subscription failed") // } // //wait to make sure the subscription got registered // time.Sleep(7500 * time.Millisecond) // if len(httpReqBody) == 3 { // var body1 waisClient.StaDataRateNotification // err = json.Unmarshal([]byte(httpReqBody[0]), &body1) // if err != nil { // t.Fatalf("cannot unmarshall response") // } // } else { // printHttpReqBody() // t.Fatalf("Number of expected notifications not received") // } // } // func Test_WAIS_wifi_to_wifi_period_staDataRate_fail(t *testing.T) { // fmt.Println("--- ", t.Name()) // log.MeepTextLogInit(t.Name()) // initialiseWaisTest() // defer clearUpWaisTest() // testAddress1 := "ue1" // testStaMacIdTo := "111111111111" // //moving to initial position // geMoveAssetCoordinates(testAddress1, 7.425917, 49.733505) // time.Sleep(2000 * time.Millisecond) // //subscription to test // err := waisSubscriptionStaDataRate(testStaMacIdTo, waisServerUrl, 3, 0, 0, 1) // if err != nil { // t.Fatalf("Subscription failed") // } // //wait to make sure the subscription got registered // time.Sleep(1500 * time.Millisecond) // if len(httpReqBody) >= 1 { // printHttpReqBody() // t.Fatalf("Number of expected notifications not received") // } // } func Test_WAIS_4g_to_4g_same_zone_assocSta(t *testing.T) { fmt.Println("--- ", t.Name()) Loading