[PATCH 2/2] rvgen/tests: cover an invalid monitor type

From: Chaosheng Qu

Date: Thu Nov 12 2026 - 01:26:11 EST


Add a rejection test next to the other ones, so the new check is
exercised. Without it the command exits 0 and leaves a generated tree
behind, so the test fails on both the exit code and the message.

Signed-off-by: Chaosheng Qu <chaosheng.qu.linux@xxxxxxxxx>
Assisted-by: LLM
---
tools/verification/rvgen/tests/rvgen_monitor.t | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/tools/verification/rvgen/tests/rvgen_monitor.t b/tools/verification/rvgen/tests/rvgen_monitor.t
index 5f2562600..2a48a7b54 100644
--- a/tools/verification/rvgen/tests/rvgen_monitor.t
+++ b/tools/verification/rvgen/tests/rvgen_monitor.t
@@ -64,6 +64,10 @@ check "invalid monitor class" \
"$RVGEN monitor -c invalid -s tests/specs/test_da.dot -t per_cpu" 1 \
"Unknown monitor class" "Traceback (most recent call last)"

+check "invalid monitor type" \
+ "$RVGEN monitor -c da -s tests/specs/test_da.dot -t invalid" 2 \
+ "invalid choice: 'invalid'" "Traceback (most recent call last)"
+
check "missing dot file" \
"$RVGEN monitor -c da -s tests/specs/nonexistent.dot -t per_cpu" 1 \
"No such file or directory" "Traceback (most recent call last)"
--
2.43.0