Skip to content

Commit 90be9a4

Browse files
tests: remove flash validation error failure condition (project-ocre#83)
* tests: remove error failure condition * tests: Move test group execution to build workflow Now, the flash validation testsuite includes only one testcase which just checks for the expected hello world string and fails if it is not detected. This commit also includes an increased sleep on the flash validation test, allowing it to properly initialize the hello world container and fill the output buffer with the expected string. --------- Signed-off-by: Patrick Robb <probb@iol.unh.edu>
1 parent 889415d commit 90be9a4

File tree

6 files changed

+41
-118
lines changed

6 files changed

+41
-118
lines changed

.github/workflows/build.yml

Lines changed: 24 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,25 @@ 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+

.github/workflows/tests.yml

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

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)