Skip to content

Commit d2b0fd8

Browse files
committed
Add U-mode test to functional test suite
The user mode validation test intentionally triggers an illegal instruction exception to verify privilege isolation, which would normally be classified as a test failure in the standard application test suite. This test has been moved to the functional test suite where its expected behavior can be properly validated. The application test suite now excludes this test to avoid false negatives. The functional test suite has been updated to recognize the expected privilege violation as a valid success criterion alongside the syscall mechanism validation. The crash detection logic now permits expected exceptions for tests that intentionally verify security boundaries.
1 parent 611a1a1 commit d2b0fd8

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

.ci/run-app-tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ else
4747
fi
4848

4949
# Filter excluded apps
50-
EXCLUDED_APPS=""
50+
EXCLUDED_APPS="umode"
5151
if [ -n "$EXCLUDED_APPS" ]; then
5252
FILTERED_APPS=""
5353
for app in $APPS; do

.ci/run-functional-tests.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ TOOLCHAIN_TYPE=${TOOLCHAIN_TYPE:-gnu}
1111
declare -A FUNCTIONAL_TESTS
1212
FUNCTIONAL_TESTS["mutex"]="Fairness: PASS,Mutual Exclusion: PASS,Data Consistency: PASS,Overall: PASS"
1313
FUNCTIONAL_TESTS["semaphore"]="Overall: PASS"
14+
FUNCTIONAL_TESTS["umode"]="PASS: sys_tid() returned,PASS: sys_uptime() returned,[EXCEPTION] Illegal instruction"
1415
#FUNCTIONAL_TESTS["test64"]="Unsigned Multiply: PASS,Unsigned Divide: PASS,Signed Multiply: PASS,Signed Divide: PASS,Left Shifts: PASS,Logical Right Shifts: PASS,Arithmetic Right Shifts: PASS,Overall: PASS"
1516
#FUNCTIONAL_TESTS["suspend"]="Suspend: PASS,Resume: PASS,Self-Suspend: PASS,Overall: PASS"
1617

@@ -75,7 +76,8 @@ test_functional_app() {
7576
IFS=',' read -ra PASS_CRITERIA <<< "$expected_passes"
7677

7778
# Check for crashes first
78-
if echo "$output" | grep -qiE "(trap|exception|fault|panic|illegal|segfault)"; then
79+
# Special case: umode test expects an illegal instruction exception
80+
if [ "$test" != "umode" ] && echo "$output" | grep -qiE "(trap|exception|fault|panic|illegal|segfault)"; then
7981
echo "[!] Crash detected"
8082

8183
# Mark all criteria as crashed

0 commit comments

Comments
 (0)