Enable test mode to work with AMQP, adapt IC test data

This commit is contained in:
Sonja Happ 2020-11-12 14:17:30 +01:00
parent d007781535
commit defc3a87f7
2 changed files with 11 additions and 11 deletions

View file

@ -94,9 +94,9 @@ var propertiesB = json.RawMessage(`{"prop1" : "not so nice"}`)
var ICA = database.InfrastructureComponent{ var ICA = database.InfrastructureComponent{
UUID: "7be0322d-354e-431e-84bd-ae4c9633138b", UUID: "7be0322d-354e-431e-84bd-ae4c9633138b",
WebsocketURL: "https://villas-new.k8s.eonerc.rwth-aachen.de/ws/ws_sig", WebsocketURL: "https://villas-new.k8s.eonerc.rwth-aachen.de/ws/ws_sig",
APIURL: "https://villas-new.k8s.eonerc.rwth-aachen.de/ws/api", APIURL: "https://villas-new.k8s.eonerc.rwth-aachen.de/ws/api/v2/node/ws_sig",
Type: "VILLASnode Signal Generator", Type: "villas-node",
Category: "Signal Generator", Category: "gateway",
Name: "ACS Demo Signals", Name: "ACS Demo Signals",
Uptime: -1.0, Uptime: -1.0,
State: "idle", State: "idle",
@ -110,8 +110,8 @@ var ICA = database.InfrastructureComponent{
var ICB = database.InfrastructureComponent{ var ICB = database.InfrastructureComponent{
UUID: "4854af30-325f-44a5-ad59-b67b2597de68", UUID: "4854af30-325f-44a5-ad59-b67b2597de68",
WebsocketURL: "xxx.yyy.zzz.aaa", WebsocketURL: "xxx.yyy.zzz.aaa",
Type: "DPsim", Type: "dpsim",
Category: "Simulator", Category: "simulator",
Name: "Test DPsim Simulator", Name: "Test DPsim Simulator",
Uptime: -1.0, Uptime: -1.0,
State: "running", State: "running",

View file

@ -94,12 +94,6 @@ func main() {
apidocs.SwaggerInfo.Host = baseHost apidocs.SwaggerInfo.Host = baseHost
apidocs.SwaggerInfo.BasePath = basePath apidocs.SwaggerInfo.BasePath = basePath
// add data to DB (if any)
err = addData(r, mode, basePath, amqphost)
if err != nil {
panic(err)
}
//Start AMQP client //Start AMQP client
if amqphost != "" { if amqphost != "" {
// create amqp URL based on username, password and host // create amqp URL based on username, password and host
@ -110,6 +104,12 @@ func main() {
} }
} }
// add data to DB (if any)
err = addData(r, mode, basePath, amqphost)
if err != nil {
panic(err)
}
// server at port 4000 to match frontend's redirect path // server at port 4000 to match frontend's redirect path
r.Run(":" + port) r.Run(":" + port)
} }