Commit e07bfdc1 authored by Yann Garcia's avatar Yann Garcia
Browse files

Enhance meep-dai testing

parent 7a5ef1af
Loading
Loading
Loading
Loading
+61 −0
Original line number Diff line number Diff line
{
    "appList":
        [
            {
                "appInfoList":
                    [
                        {
                            "appDId": "appDId1",
                            "appName": "appName1",
                            "appProvider": "appProvider1",
                            "appSoftVersion": "appSoftVersion1",
                            "appDVersion": "appDVersion1",
                            "appDescription": "appDescription1",
                            "appLocation":
                                [
                                    {
                                        "area":
                                            {
                                                "coordinates":
                                                    [
                                                        [
                                                            [7.43166,43.736156],[7.431723,43.736115],[7.431162,43.735607],[7.430685,43.73518]
                                                        ]
                                                    ]
                                            },
                                        "countryCode": "countryCode1"
                                    },
                                    {
                                        "civicAddressElement": 
                                            [
                                                {
                                                    "caType": 2,
                                                    "caValue": "Value2"
                                                },
                                                {
                                                    "caType": 20,
                                                    "caValue": "Value20"
                                                }
                                            ]
                                    }
                                ],
                            "appCharcs":
                                [
                                    {
                                        "memory": 2048,
                                        "storage": 2048,
                                        "latency": 2048,
                                        "bandwidth": 2048,
                                        "serviceCont": 1
                                    }
                                ],
                            "cmd": "uptime",
                            "args":null
                        }
                    ],
                    "vendorSpecificExt": {
                        "vendorId": "vendorId1"
                    }
            }
        ]
}
+23 −2
Original line number Diff line number Diff line
@@ -14,8 +14,29 @@
                            "appLocation":
                                [
                                    {
                                        "area": null,
                                        "civicAddressElement": null,
                                        "area":
                                            {
                                                "coordinates":
                                                    [
                                                        [
                                                            [7.420433,43.729942],[7.420659,43.73036],[7.420621,43.731045],[7.420922,43.73129]
                                                        ],
                                                        [
                                                            [7.420434,43.729942],[7.420659,43.73036],[7.420621,43.731045],[7.420922,43.73129]
                                                        ]
                                                    ]
                                            },
                                        "civicAddressElement": 
                                            [
                                                {
                                                    "caType": 1,
                                                    "caValue": "A1"
                                                },
                                                {
                                                    "caType": 2,
                                                    "caValue": "A2"
                                                }
                                            ],
                                        "countryCode": "33"
                                    }
                                ],
+2 −1
Original line number Diff line number Diff line
@@ -51,6 +51,7 @@ type SbiCfg struct {
	InfluxAddr               string
	PostgisHost              string
	PostgisPort              string
	OnboardedMecApplicationsFolder string
	Locality                 []string
	ScenarioNameCb           func(string)
	AppInfoList              func(tm.AppInfoList)
@@ -169,7 +170,7 @@ func Init(cfg SbiCfg) (err error) {
	}
	log.Info("Created new DAI DB tables")

	err = sbi.daiMgr.LoadOnboardedMecApplications()
	err = sbi.daiMgr.LoadOnboardedMecApplications(cfg.OnboardedMecApplicationsFolder)
	if err != nil {
		log.Error("Failed to load simulating data: ", err)
		return err
+3 −0
Original line number Diff line number Diff line
@@ -103,6 +103,8 @@ var gisAppClientUrl string = "http://meep-gis-engine"
var postgresHost string = ""
var postgresPort string = ""

var onboardedMecApplicationsFolder string = "/onboardedapp-vol/"

// Notifications
const (
	applicationContextDeleteNotification = "ApplicationContextDeleteNotification"
@@ -391,6 +393,7 @@ func Init() (err error) {
		RedisAddr:                redisAddr,
		PostgisHost:              postgresHost,
		PostgisPort:              postgresPort,
		OnboardedMecApplicationsFolder: onboardedMecApplicationsFolder,
		Locality:                 locality,
		ScenarioNameCb:           updateStoreName,
		AppInfoList:              updateAppInfoList,
+14 −36
Original line number Diff line number Diff line
@@ -489,21 +489,12 @@ const (
const (
	associateDevAppId1 = "associateDevAppId1"
	callbackReference1 = "callbackReference1"
	//appLocationUpdates1   = true
	//appAutoInstantiation1 = false
	appName1           = "appName1"
	appProvider1       = "appProvider1"
	appDVersion1       = "appDVersion1"
	appDescription1    = "appDescription1"

	//associateDevAppId2    = "associateDevAppId2"
	callbackReference2 = "callbackReference2"
	//appLocationUpdates2   = false
	//appAutoInstantiation2 = false
	//appName2        = "appName2"
	//appProvider2    = "appProvider2"
	//appDVersion2    = "appDVersion2"
	//appDescription2 = "appDescription2"
)

var ( // Need to take address
@@ -511,11 +502,7 @@ var ( // Need to take address
	appDId1           string = "appDId1"
	appSoftVersion1   string = "appSoftVersion1"
	appPackageSource1 string = "appPackageSource1"
	//appInstanceId1_1     string         = "appInstanceId1-1"
	//appInstanceId1_2     string         = "appInstanceId1-2"
	//appInstanceId1_3     string         = "appInstanceId1-3"
	referenceURI1_1 meepdaimgr.Uri = "referenceURI1-1"
	//referenceURI1_3      meepdaimgr.Uri = "referenceURI1-3"
	area1                    = Polygon{[][][]float32{{{7.43166, 43.736156}, {7.431723, 43.736115}, {7.431162, 43.735607}, {7.430685, 43.73518}}}}
	civicAddressElement1     = []LocationConstraintsCivicAddressElement{{2, "Value2"}, {20, "Value20"}}
	countryCode1      string = "countryCode1"
@@ -585,15 +572,6 @@ func TestAppListGET(t *testing.T) {
	appInfo.AppCharcs.Latency = latency1
	appInfo.AppCharcs.Bandwidth = bandwidth1
	appInfo.AppCharcs.ServiceCont = serviceCont1
	// ApplicationList
	// var fullAppList ApplicationList
	// fullAppList.AppList = make([]ApplicationListAppList, 2)
	// fullAppList.AppList[0] = applicationListAppList
	// fullAppList.AppList[1] = applicationListAppList
	// log.Info("ApplicationList: ", fullAppList)
	// // Convert into JSON
	// var expected_json_response string = convertApplicationListToJson(&fullAppList)
	// log.Info("json response: ", expected_json_response)

	var appList ApplicationList
	appList.AppList = make([]ApplicationListAppList, 1)
@@ -1078,7 +1056,7 @@ func initializeVars() {
	os.Setenv("MEEP_SANDBOX_NAME", testScenarioName)
	postgresHost = postgresTestHost
	postgresPort = postgresTestPort

	onboardedMecApplicationsFolder = "../../../examples/demo4-ue/src/onboarded-demo/"
}

func initialiseScenario(testScenario string) {
Loading