Skip to content

ioctl: add nested ioctl tests#447

Merged
julianuziemblo merged 2 commits intomasterfrom
julianuziemblo/RTOS-1205
Mar 12, 2026
Merged

ioctl: add nested ioctl tests#447
julianuziemblo merged 2 commits intomasterfrom
julianuziemblo/RTOS-1205

Conversation

@julianuziemblo
Copy link
Contributor

@julianuziemblo julianuziemblo commented Jan 28, 2026

Description

Special-case ioctls are those which pass a structure with pointers or flexible array members to the syscall. For now this is only: SIOCGIFCONF, SIOCADDRT and SIOCDELRT.

Motivation and Context

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Chore (refactoring, style fixes, git/CI config, submodule management, no code logic changes)

How Has This Been Tested?

  • Already covered by automatic testing.
  • New test added: (add PR link here).
  • Tested by hand on: (list targets here).

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing linter checks and tests passed.
  • My changes generate no new compilation warnings for any of the targets.

Special treatment

@gemini-code-assist
Copy link

Summary of Changes

Hello @julianuziemblo, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly expands the test coverage for ioctl system calls and network routing functionality. It introduces new tests for complex ioctl operations that handle data structures with embedded pointers, ensuring their correct behavior. Additionally, a new test suite for the route command has been added, improving the robustness of network configuration management.

Highlights

  • New Special-Case ioctl Tests: Added comprehensive Unity tests for "special-case" ioctl calls, specifically SIOCGIFCONF, which involve structures with pointers requiring flattening in userspace. These tests ensure correct handling of interface configuration retrieval and buffer management.
  • New Route Command Test: Introduced a new Python-based harness test (test-route.py) to validate the functionality of the route command, including adding and deleting routes and verifying output format.
  • Test Infrastructure Updates: Updated the build system (ioctl/Makefile) and test configuration (ioctl/test.yaml) to integrate and enable these new tests on relevant targets, particularly those with network stack support (lwIP).
  • Minor ioctl Test Cleanup: Performed a minor cleanup in an existing ioctl test (ioctl/test-ioctl.c) by removing a redundant NULL argument from an ioctl call, simplifying the test case.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

The pull request introduces new tests for special ioctl calls, specifically SIOCGIFCONF, and a Python test for route management. The changes include adding the new test files to the Makefile and the test configuration YAML. Overall, the new tests are a valuable addition, but there are a few areas for improvement regarding error handling in the GET_IFADDRS macro, clarity in a test case name and assertion, and consistency in ioctl call arguments.

@github-actions
Copy link

github-actions bot commented Jan 28, 2026

Unit Test Results

9 553 tests  +28   8 961 ✅ +28   52m 44s ⏱️ +7s
  591 suites + 8     592 💤 ± 0 
    1 files   ± 0       0 ❌ ± 0 

Results for commit ceb4510. ± Comparison against base commit 6857efb.

This pull request removes 99 and adds 127 tests. Note that renamed tests count towards both.
phoenix-rtos-tests/ioctl/unit ‑ aarch64a53-zynqmp-qemu:phoenix-rtos-tests/ioctl/unit.ioctl.data_in
phoenix-rtos-tests/ioctl/unit ‑ aarch64a53-zynqmp-qemu:phoenix-rtos-tests/ioctl/unit.ioctl.data_in_big
phoenix-rtos-tests/ioctl/unit ‑ aarch64a53-zynqmp-qemu:phoenix-rtos-tests/ioctl/unit.ioctl.data_inout
phoenix-rtos-tests/ioctl/unit ‑ aarch64a53-zynqmp-qemu:phoenix-rtos-tests/ioctl/unit.ioctl.data_inout_big
phoenix-rtos-tests/ioctl/unit ‑ aarch64a53-zynqmp-qemu:phoenix-rtos-tests/ioctl/unit.ioctl.data_out
phoenix-rtos-tests/ioctl/unit ‑ aarch64a53-zynqmp-qemu:phoenix-rtos-tests/ioctl/unit.ioctl.data_out_big
phoenix-rtos-tests/ioctl/unit ‑ aarch64a53-zynqmp-qemu:phoenix-rtos-tests/ioctl/unit.ioctl.in_val
phoenix-rtos-tests/ioctl/unit ‑ aarch64a53-zynqmp-qemu:phoenix-rtos-tests/ioctl/unit.ioctl.invalid_req
phoenix-rtos-tests/ioctl/unit ‑ aarch64a53-zynqmp-qemu:phoenix-rtos-tests/ioctl/unit.ioctl.no_data
phoenix-rtos-tests/ioctl/unit ‑ aarch64a53-zynqmp-qemu:phoenix-rtos-tests/ioctl/unit.ioctl.not_valid_fd
…
phoenix-rtos-tests/ioctl/test-ioctl ‑ aarch64a53-zynqmp-qemu:phoenix-rtos-tests/ioctl/test-ioctl.ioctl.data_in
phoenix-rtos-tests/ioctl/test-ioctl ‑ aarch64a53-zynqmp-qemu:phoenix-rtos-tests/ioctl/test-ioctl.ioctl.data_in_big
phoenix-rtos-tests/ioctl/test-ioctl ‑ aarch64a53-zynqmp-qemu:phoenix-rtos-tests/ioctl/test-ioctl.ioctl.data_inout
phoenix-rtos-tests/ioctl/test-ioctl ‑ aarch64a53-zynqmp-qemu:phoenix-rtos-tests/ioctl/test-ioctl.ioctl.data_inout_big
phoenix-rtos-tests/ioctl/test-ioctl ‑ aarch64a53-zynqmp-qemu:phoenix-rtos-tests/ioctl/test-ioctl.ioctl.data_out
phoenix-rtos-tests/ioctl/test-ioctl ‑ aarch64a53-zynqmp-qemu:phoenix-rtos-tests/ioctl/test-ioctl.ioctl.data_out_big
phoenix-rtos-tests/ioctl/test-ioctl ‑ aarch64a53-zynqmp-qemu:phoenix-rtos-tests/ioctl/test-ioctl.ioctl.in_val
phoenix-rtos-tests/ioctl/test-ioctl ‑ aarch64a53-zynqmp-qemu:phoenix-rtos-tests/ioctl/test-ioctl.ioctl.invalid_req
phoenix-rtos-tests/ioctl/test-ioctl ‑ aarch64a53-zynqmp-qemu:phoenix-rtos-tests/ioctl/test-ioctl.ioctl.no_data
phoenix-rtos-tests/ioctl/test-ioctl ‑ aarch64a53-zynqmp-qemu:phoenix-rtos-tests/ioctl/test-ioctl.ioctl.not_valid_fd
…

♻️ This comment has been updated with latest results.

@julianuziemblo julianuziemblo force-pushed the julianuziemblo/RTOS-1205 branch 2 times, most recently from 856cbd5 to a60cd52 Compare February 12, 2026 14:49
@julianuziemblo julianuziemblo changed the title ioctl: add special-case ioctl tests ioctl: add nested ioctl tests Feb 12, 2026
@julianuziemblo julianuziemblo force-pushed the julianuziemblo/RTOS-1205 branch 3 times, most recently from 19a8e38 to 56bbbed Compare February 18, 2026 11:47
Nested ioctls are those that pass in a struct with
sub-pointer(s) to arbitrary memory, as we have
to handle them differently to pass that memory.

For now, only some socket-related ioctls are nested,
so the test is run only for targets that support
lwip.

JIRA: RTOS-1014
@julianuziemblo julianuziemblo force-pushed the julianuziemblo/RTOS-1205 branch from 56bbbed to ceb4510 Compare February 27, 2026 15:45
@julianuziemblo julianuziemblo requested a review from adamdebek March 4, 2026 12:47
@julianuziemblo julianuziemblo merged commit 6ed92c4 into master Mar 12, 2026
51 checks passed
@julianuziemblo julianuziemblo deleted the julianuziemblo/RTOS-1205 branch March 12, 2026 10:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants