diff --git a/Makefile b/Makefile index 1378387..8c4906a 100644 --- a/Makefile +++ b/Makefile @@ -68,9 +68,9 @@ TESTSCRIPT_E2E_FILES = \ $(TESTSCRIPT_E2E_DIR)/transport.txtar \ $(TESTSCRIPT_E2E_DIR)/stack.txtar \ $(TESTSCRIPT_E2E_DIR)/runtime.txtar \ + $(TESTSCRIPT_E2E_DIR)/gateway.txtar \ $(TESTSCRIPT_E2E_DIR)/benchmark.txtar -# $(TESTSCRIPT_E2E_DIR)/gateway.txtar \ ifneq ($(CI), true) diff --git a/dse/modelc/examples/gateway/CMakeLists.txt b/dse/modelc/examples/gateway/CMakeLists.txt index fb464b6..2c34690 100644 --- a/dse/modelc/examples/gateway/CMakeLists.txt +++ b/dse/modelc/examples/gateway/CMakeLists.txt @@ -72,16 +72,28 @@ target_link_libraries(gateway PRIVATE $<$:ws2_32> PUBLIC - -Wl,--whole-archive + -Wl,--whole-archive,--export-dynamic ${modelc_link_lib} -Wl,--no-whole-archive ) -install(TARGETS gateway RUNTIME +install( + TARGETS + gateway + DESTINATION + ${EXE_PATH}/bin + COMPONENT + gateway_model +) +if(WIN32) +install( + TARGETS + modelc_shared_lib DESTINATION ${EXE_PATH}/bin COMPONENT gateway_model ) +endif() install( FILES gateway.yaml diff --git a/dse/modelc/examples/gateway/gateway.yaml b/dse/modelc/examples/gateway/gateway.yaml index 3c35a24..80576d9 100644 --- a/dse/modelc/examples/gateway/gateway.yaml +++ b/dse/modelc/examples/gateway/gateway.yaml @@ -6,7 +6,7 @@ spec: connection: transport: redispubsub: - uri: redis://redis:6379 + uri: redis://localhost:6379 timeout: 60 models: - name: simbus diff --git a/tests/testscript/e2e/gateway.txtar b/tests/testscript/e2e/gateway.txtar index 551fb20..efd1156 100644 --- a/tests/testscript/e2e/gateway.txtar +++ b/tests/testscript/e2e/gateway.txtar @@ -2,27 +2,37 @@ env NAME=gateway_inst env SIM=dse/modelc/build/_out/examples/gateway -# Start the Gateway. -exec ls -R /repo/$SIM -#exec /repo/$SIM/bin/gateway 0.0005 0.002 /repo/$SIM/data/gateway.yaml & - # Run the Simulation. exec sh -e $WORK/test.sh -# Check results. -stdout 'Run the Simulation ...' +stdout 'Using gateway symbols: ...' +stdout 'Setup for async Simulation Model run ...' +stdout 'Call symbol: model_destroy ...' stdout 'Controller exit ...' stdout '\[0.000000\] binary\[0\] = <0:0>\(null\) \(binary_foo\)' stdout '\[0.000000\] binary\[1\] = <0:0>\(null\) \(binary_bar\)' -stdout '\[0.020000\] binary\[0\] = <20:20>st=0.015000,index=0 \(binary_foo\)' -stdout '\[0.020000\] binary\[1\] = <20:20>st=0.015000,index=1 \(binary_bar\)' +stdout '\[0.002000\] binary\[0\] = <20:20>st=0.001500,index=0 \(binary_foo\)' +stdout '\[0.002000\] binary\[1\] = <20:20>st=0.001500,index=1 \(binary_bar\)' stdout '\[0.000000\] scalar\[0\] = 0.000000 \(scalar_foo\)' stdout '\[0.000000\] scalar\[1\] = 0.000000 \(scalar_bar\)' -stdout '\[0.020000\] scalar\[0\] = 16.000000 \(scalar_foo\)' -stdout '\[0.020000\] scalar\[1\] = 32.000000 \(scalar_bar\)' +stdout '\[0.002000\] scalar\[0\] = 16.000000 \(scalar_foo\)' +stdout '\[0.002000\] scalar\[1\] = 32.000000 \(scalar_bar\)' -- test.sh -- SIMER="${SIMER:-ghcr.io/boschglobal/dse-simer:latest}" -docker run --name simer -i --rm -v $ENTRYHOSTDIR/$SIM:/sim \ - $SIMER -env simbus:SIMBUS_LOGLEVEL=2 -timeout 5 + +docker run --name gateway -i --rm \ + -v $ENTRYHOSTDIR/$SIM:/sim \ + --env SIMBUS_LOGLEVEL=3 \ + --network=host \ + --entrypoint="" \ + $SIMER \ + bash -c "valgrind -q --leak-check=yes --error-exitcode=808 bin/gateway 0.0005 0.0020 data/gateway.yaml" & + +docker run --name simer -i --rm \ + -v $ENTRYHOSTDIR/$SIM:/sim \ + --network=host \ + $SIMER \ + -env simbus:SIMBUS_LOGLEVEL=4 \ + -timeout 5