Files
python-bpf/tests/test_config.toml
Pragyansh Chaturvedi 3c3ad8d00b Tests: Shadowing is a passing case now, unbound reads are the error
globals_shadowing.py asserted the old rule, so it moves to
passing_tests/globals/shadowing.py and asserts the new one: the write
without `global` binds a local, and a second program still reads the
global's initializer. copy_to_local.py covers `x = a_global`, the read
shape that used to fail in the allocation pass.

globals_read_before_shadow.py takes over as the failing case, since a
read above the binding is what Python rejects, and the augassign test
keeps its xfail with the reason reworded to the UnboundLocalError it is.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-17 15:13:58 +05:30

45 lines
2.9 KiB
TOML

# test_config.toml
#
# [xfail] — tests expected to fail.
# key = path relative to tests/
# value = {reason = "...", level = "ir" | "llc" | "verifier"}
# level "ir" = fails during pythonbpf IR generation (exception or ERROR log)
# level "llc" = IR generates but llc rejects it
# level "verifier" = IR and llc both succeed, but the kernel verifier rejects it
#
# A failure at one level implies failure at every later one, so the declared
# level marks that level and all later ones xfail.
#
[xfail]
"failing_tests/conditionals/struct_ptr.py" = {reason = "Struct pointer used directly as boolean condition not supported", level = "ir"}
# Compiles cleanly; rejected by the kernel. The `data + 34 < data_end` guard is
# emitted as a signed compare over values round-tripped through the stack, so the
# verifier never narrows the packet range (it stays r=0) and the later
# `iph.saddr` read fails with "invalid access to packet, off=26 size=4" /
# "R1 offset is outside of the packet". Direct packet access needs bounds checks
# in a form the verifier can follow.
"failing_tests/xdp/xdp_test_1.py" = {reason = "XDP direct packet access: the data/data_end guard does not establish a packet range the verifier can use", level = "verifier"}
"failing_tests/license.py" = {reason = "Missing LICENSE global produces IR that llc rejects — should be caught earlier with a clear error message", level = "llc"}
"failing_tests/undeclared_values.py" = {reason = "Undeclared variable used in f-string — should raise SyntaxError (correct behaviour, test documents it)", level = "ir"}
"failing_tests/vmlinux/args_test.py" = {reason = "struct_trace_event_raw_sys_enter args field access not supported", level = "ir"}
"failing_tests/vmlinux/assignment_handling.py" = {reason = "Assigning vmlinux enum value (XDP_PASS) to a local variable not yet supported", level = "ir"}
"failing_tests/xdp_pass.py" = {reason = "XDP program using vmlinux structs (struct_xdp_md) and complex map/struct interaction not yet supported", level = "ir"}
"failing_tests/globals_read_before_shadow.py" = {reason = "Reading a name above the assignment that makes it a local shadowing a global is UnboundLocalError in Python, and a compile error here", level = "ir"}
"failing_tests/globals_undeclared_name.py" = {reason = "`global x` naming something that is not a @bpfglobal is a compile error", level = "ir"}
"failing_tests/globals_bad_type.py" = {reason = "Non-integer-scalar globals are not supported in milestone 1 (NotImplementedError by design)", level = "ir"}
"failing_tests/globals_augassign_shadowing.py" = {reason = "`x += 1` on a global name without `global` binds a local and reads it unbound: UnboundLocalError in Python, a compile error here", level = "ir"}
"failing_tests/globals_parameter_and_global.py" = {reason = "A parameter may not be declared global (Python: name is parameter and global)", level = "ir"}