|
| 1 | +.. note:: AI Translation Notice |
| 2 | + |
| 3 | + This document was automatically translated by `hunyuan-turbos-latest` model, for reference only. |
| 4 | + |
| 5 | + - Source document: kernel/ktest/gvisor_syscall_test.rst |
| 6 | + |
| 7 | + - Translation time: 2025-09-24 08:27:04 |
| 8 | + |
| 9 | + - Translation model: `hunyuan-turbos-latest` |
| 10 | + |
| 11 | + |
| 12 | + Please report issues via `Community Channel <https://github.com/DragonOS-Community/DragonOS/issues>`_ |
| 13 | + |
| 14 | +============================== |
| 15 | +gVisor System Call Testing |
| 16 | +============================== |
| 17 | + |
| 18 | +DragonOS integrates the gVisor system call test suite to verify the compatibility and correctness of the operating system's system call implementation. |
| 19 | + |
| 20 | +Overview |
| 21 | +======== |
| 22 | + |
| 23 | +gVisor is a container runtime sandbox developed by Google, which includes a comprehensive set of system call compatibility tests. These tests are designed to validate whether an operating system's system call implementation complies with Linux standards. |
| 24 | + |
| 25 | +Key Features: |
| 26 | + |
| 27 | +- **Comprehensive Test Coverage**: Contains hundreds of system call test cases |
| 28 | +- **Whitelist Mechanism**: By default, only verified tests are executed, with support gradually expanding |
| 29 | +- **Blacklist Filtering**: Allows blocking specific test cases for each test program |
| 30 | +- **Automated Execution**: Provides Makefiles and scripts to simplify the testing process |
| 31 | + |
| 32 | +Quick Start |
| 33 | +========== |
| 34 | + |
| 35 | +1. Navigate to the test directory: |
| 36 | + |
| 37 | + .. code-block:: bash |
| 38 | +
|
| 39 | + cd user/apps/tests/syscall/gvisor |
| 40 | +
|
| 41 | +2. Run whitelist tests on Linux (automatically downloads the test suite): |
| 42 | + |
| 43 | + .. code-block:: bash |
| 44 | +
|
| 45 | + make test |
| 46 | +
|
| 47 | +3. If you need to run the tests, first modify the configuration file: |
| 48 | + |
| 49 | + Edit `config/app-blocklist.toml`, and comment out the following content: |
| 50 | + |
| 51 | + .. code-block:: toml |
| 52 | +
|
| 53 | + # Block gvisor system call tests |
| 54 | + # [[blocked_apps]] |
| 55 | + # name = "gvisor syscall tests" |
| 56 | + # reason = "Blocked due to large file size. To enable system call tests, uncomment these lines" |
| 57 | +
|
| 58 | +4. Run the tests within the DragonOS system: |
| 59 | + |
| 60 | + Navigate to the installation directory and execute the test program: |
| 61 | + |
| 62 | + .. code-block:: bash |
| 63 | +
|
| 64 | + cd /opt/tests/gvisor |
| 65 | + ./gvisor-test-runner --help |
| 66 | +
|
| 67 | + Use `_translated_label__`./gvisor-test-runner`_en` to run specific test cases. |
| 68 | + |
| 69 | +5. View detailed documentation: |
| 70 | + |
| 71 | + Refer to `user/apps/tests/syscall/gvisor/README.md` for complete usage instructions. |
| 72 | + |
| 73 | +Testing Mechanism |
| 74 | +========== |
| 75 | + |
| 76 | +Whitelist Mode |
| 77 | +----------- |
| 78 | + |
| 79 | +The test framework defaults to whitelist mode, executing only the test programs specified in `_translated_label__`whitelist.txt`_en`. This allows for gradual validation of DragonOS's system call implementation. |
| 80 | + |
| 81 | +Blacklist Filtering |
| 82 | +----------- |
| 83 | + |
| 84 | +For each test program, specific test cases can be blocked through files in the `_translated_label__`blocklists/`_en` directory. This is particularly useful for skipping tests that are not yet supported or are unstable. |
| 85 | + |
| 86 | +More Details |
| 87 | +============== |
| 88 | + |
| 89 | +For detailed usage instructions, configuration options, and development guides regarding gVisor system call testing, please consult the README.md document in the test directory: |
| 90 | + |
| 91 | +- Documentation Location: `user/apps/tests/syscall/gvisor/README.md` |
0 commit comments