Stay organized with collections
Save and categorize content based on your preferences.
7. Test
Like any other code, your sandbox implementation should have tests. Sandbox
tests are not meant to test the program's correctness, but instead to check
whether the sandboxed program can run without issues like sandbox violations.
This also makes sure that the sandbox policy is correct.
A sandboxed program is tested in the same way you would run it in production,
with the arguments and input files it would normally process.
These tests can be as simple as a shell test or C++ tests using sub processes.
Check out the examples for inspiration.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-04-22 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-04-22 UTC."],[[["Sandbox tests focus on ensuring the sandboxed program runs smoothly and avoids sandbox violations, not necessarily on program correctness."],["Sandbox testing involves running the program in a production-like environment with typical arguments and input files to assess its behavior within the sandbox."],["Tests can be implemented using various methods, including shell tests or C++ tests using sub-processes, to validate sandbox policy and program execution."]]],[]]