Repository navigation
testing/nettest: Add a test of radio sockets with no device - #4016
Merged
Merged
Conversation
cmocka_net_radio calls recvfrom() three times on each of these sockets: a Bluetooth L2CAP socket that is not bound, a Bluetooth HCI socket bound to a device index that no device has, and an IEEE 802.15.4 socket that is not bound. No radio device matches these sockets, so each call must fail with ENODEV, and close() must work after them. Before the kernel fix, the first call unlocked a socket lock that it did not take. With CONFIG_DEBUG_ASSERTIONS, the program then fails an assertion in nxrmutex_unlock(). The test is on by default when NET_BLUETOOTH or NET_IEEE802154 is set, as the other nettest groups. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
xiaoxiang781216
approved these changes
Nov 11, 2026
xiaoxiang781216
marked this pull request as ready for review
November 11, 2026 01:44
🔗 Cross-repo PR dependenciesThe read-only Build run reported the following dependent PR(s) and fetched head SHA(s):
CI run: https://github.com/apache/nuttx-apps/actions/runs/42941183391 |
acassis
approved these changes
Nov 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
New cmocka group
cmocka_net_radioin testing/nettest. It callsrecvfrom()three times on each of these sockets: a Bluetooth L2CAP socket that is not bound, a Bluetooth HCI socket bound to a device index that no device has, and an IEEE 802.15.4 socket that is not bound. No radio device matches these sockets, so each call must fail withENODEV, andclose()must work after them.Before apache/nuttx#21650, the first call unlocked a socket lock that it did not take. With
CONFIG_DEBUG_ASSERTIONS, the program then fails an assertion innxrmutex_unlock().Impact
New test only.
TESTING_NET_RADIOis on by default whenNET_BLUETOOTHorNET_IEEE802154is set, as the other nettest groups. Make and CMake.Testing
CONFIG_DEBUG_ASSERTIONS=y,CONFIG_TESTING_NET_TEST=y, Linux host.[ PASSED ] 2 test(s).nuttx master:Assertion failed : at file: misc/lib_mutex.c:486intest_radio_bluetooth_l2cap, and the program is killed.[ PASSED ] 1 test(s).nuttx master: the same assertion intest_radio_ieee802154.-Wno-cpp -Werror), sim:dynconns (CMake, both socket families), qemu-armv8a:knsh (Make, kernel build).tools/checkpatch.sh -c -u -m -gpasses.