Skip to content

Commit dbc0117

Browse files
committed
tests: Merge from main to local branch
Merge branch 'main' of github.com:project-ocre/ocre-runtime into test-implement-modbus-server-testing Includes moving changes from tests.yml to build.yml Signed-off-by: Matthew Gee <mgee@iol.unh.edu>
2 parents b7b2b7f + 90be9a4 commit dbc0117

8 files changed

Lines changed: 67 additions & 138 deletions

File tree

.github/workflows/build.yml

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,11 +136,11 @@ jobs:
136136
uses: actions/download-artifact@v4
137137
with:
138138
name: ocre-zephyr-b_u585i_iot02a-app
139-
139+
140140
- name: Flash b_u585i_iot02a
141141
if: runner.environment == 'self-hosted'
142142
run: |
143-
STM32_Programmer_CLI -c port=swd -w zephyr.bin 0x08000000 -v -rst
143+
STM32_Programmer_CLI -c port=swd -e all -w zephyr.bin 0x08000000 -v -rst
144144
145145
build-and-run-linux-sample:
146146
runs-on: ubuntu-latest
@@ -316,3 +316,47 @@ jobs:
316316
echo "[FAIL] ${{ matrix.sample.name }} did not produce expected log: ${{ matrix.sample.expected }}"
317317
exit 1
318318
fi
319+
flash-validation-tests:
320+
needs: flash-zephyr-base-b_u585i_iot02a
321+
runs-on: zephyr-xlarge-runner
322+
steps:
323+
- name: Checkout
324+
uses: actions/checkout@v4
325+
326+
- name: Flash Validation Tests
327+
run: |
328+
cd tests && bash beginTests.sh "flashValidation"
329+
330+
- name: Print Flash Validation Logs
331+
if: always()
332+
run: cat /tmp/flashValidation.log
333+
334+
- name: Upload log file as artifact
335+
if: always()
336+
uses: actions/upload-artifact@v4
337+
with:
338+
name: "FlashValidation.log"
339+
path: /tmp/flashValidation.log
340+
341+
modbus-server-validation-tests:
342+
needs: flash-zephyr-base-b_u585i_iot02a
343+
runs-on: zephyr-xlarge-runner
344+
steps:
345+
- name: Checkout
346+
uses: actions/checkout@v4
347+
348+
- name: Modbus Validation Tests
349+
run: |
350+
cd tests && bash beginTests.sh "modbusServerValidation"
351+
352+
- name: Print Modbus Server Validation Logs
353+
if: always()
354+
run: cat /tmp/modbusServerValidation.log
355+
356+
- name: Upload log file as artifact
357+
if: always()
358+
uses: actions/upload-artifact@v4
359+
with:
360+
name: "ModbusServerValidation.log"
361+
path: /tmp/modbusServerValidation.log
362+

.github/workflows/tests.yml

Lines changed: 0 additions & 47 deletions
This file was deleted.

src/ocre/api/ocre_common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#include <stdlib.h>
1616
#include <string.h>
1717
LOG_MODULE_DECLARE(ocre_cs_component, OCRE_LOG_LEVEL);
18-
#include <autoconf.h>
18+
#include <zephyr/autoconf.h>
1919
#include "../../../../../wasm-micro-runtime/core/iwasm/include/lib_export.h"
2020
#include "bh_log.h"
2121
#include "../ocre_timers/ocre_timer.h"

src/shared/platform/zephyr/core_internal.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
#include <zephyr/device.h>
1616
#include <zephyr/kernel/mm.h>
1717

18-
#include <version.h>
19-
#include <app_version.h>
20-
#include <autoconf.h>
18+
#include <zephyr/version.h>
19+
#include <zephyr/app_version.h>
20+
#include <zephyr/autoconf.h>
2121

2222
// clang-format off
2323

tests/groups/flashValidation/config.json

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,6 @@
1515
{
1616
"name": "Check Runtime Hello World",
1717
"exec": "./flash_validation_hello_world.py"
18-
},
19-
{
20-
"name": "Check Runetime Error",
21-
"exec": "./flash_validation_error.py"
22-
},
23-
{
24-
"name": "Check Runtime Hello World With Error",
25-
"exec": "./flash_validation_hello_world_error.py"
2618
}
2719
]
2820
}
@@ -33,4 +25,4 @@
3325
"exec": "bash clean.sh"
3426
}
3527
]
36-
}
28+
}

tests/groups/flashValidation/flash_validation_error.py

Lines changed: 0 additions & 35 deletions
This file was deleted.

tests/groups/flashValidation/flash_validation_hello_world.py

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,32 @@
1212
"""
1313

1414
def main():
15-
conn = serial.Serial('/dev/ttyACM0', 115200, timeout=1)
16-
conn.send_break(duration=1)
15+
conn = serial.Serial('/dev/ttyACM0', 115200, timeout=10)
16+
17+
print('**** WAITING FOR SYSTEM TO FULLY INITIALIZE ****\n')
18+
19+
# Wait for the system to boot and initialize completely
20+
# We need to wait for network initialization and OCRE runtime startup
21+
time.sleep(5)
1722

18-
time.sleep(1)
23+
# Clear any existing data in the buffer
24+
conn.reset_input_buffer()
25+
26+
# Send break to get current output
27+
conn.send_break(duration=1)
28+
time.sleep(10)
1929

2030
print('**** READING RESPONSE FROM BREAK ****\n')
2131

22-
response = conn.read(1024).decode(errors='ignore')
32+
# Read response with longer timeout to capture all output
33+
response = conn.read(2048).decode(errors='ignore')
2334
print(response)
2435

2536
print('**** CLOSING CONNECTION ****\n')
2637

2738
conn.close()
2839

29-
if "Hello World!" in response:
40+
if "Hello World from Ocre!" in response:
3041
sys.exit(0)
3142
sys.exit(1)
3243

tests/groups/flashValidation/flash_validation_hello_world_error.py

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)