feature(containerz): Add container capabilities and volume mount options tests to CNTR-1 - #5950
feature(containerz): Add container capabilities and volume mount options tests to CNTR-1#5950f-sommerauer wants to merge 6 commits into
Conversation
…ons tests to CNTR-1 Updates feature/container/containerz/tests/container_lifecycle/: - README.md: Document CNTR-1.9 (Capabilities) and CNTR-1.10 (Volume Mount Options Matrix). - containerz_test.go: Implement TestCapabilities (elevated, dropped CAP_NET_RAW/CAP_SYS_CHROOT, invalid rejection) and TestVolumeMountOptions (rbind, rslave, rprivate, ro, bind matrix reflection and deletion verification). Hardware Verification: - Target: Arista DCS-7280CR3K-32D4-F (EOS 4.34.2FX-wbb.2-DPE-CTNR) - Subtests passed: TestCapabilities (Elevated, Dropped, Invalid), TestVolumeMountOptions (RbindRslave, RbindRprivate, BindRslaveRo, BindRo, Bind)
Pull Request Functional Test Report for #5950 / 3c2652aVirtual Devices
Hardware Devices
|
Summary of ChangesHello, 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 expands the gnoi.Containerz test suite by introducing two new test specifications. These additions focus on verifying the robustness of container lifecycle management, specifically regarding Linux capability configuration and complex volume mount option handling, ensuring the daemon correctly processes and reflects these parameters. Highlights
Using Gemini Code AssistThe 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
Customization To customize the 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 Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. 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. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request adds test documentation and Go test implementations for CNTR-1.9 (Container Capabilities Management) and CNTR-1.10 (Volume Mount Driver Option Matrix and Reflection). The feedback suggests improving the tests by ensuring the pushed base image is cleaned up at the end of the test to adhere to state reversion guidelines, failing the negative capability test if the returned error code is unexpected, and failing fast using t.Fatalf if ListContainer fails.
…error in TestCapabilities
…lid capability in TestCapabilities
5540a8c to
485fe53
Compare
|
Hi @Abhinavkmr @alshabib, This PR is ready for review. All review comments have been addressed:
Multi-vendor targets have been verified to build cleanly across all vendor targets (388/388 targets) and live hardware tests pass. |
|
LGTM |
6b31b89 to
50bc343
Compare
…n for capability rejection
6887aa4 to
24c7e71
Compare
Description
This PR expands the
CNTR-1(Basic container lifecycle viagnoi.Containerz) test suite with two new test specifications and implementations:CNTR-1.9: Container Capabilities Management (
TestCapabilities):ElevatedCapabilities): Validates starting containers with elevated Linux capabilities (CAP_SYS_ADMIN,CAP_NET_RAW), verifying the running state, and confirming clean teardown.DroppedCapabilities): Validates starting containers with default capabilities removed (CAP_NET_RAW), verifying the running state, and confirming teardown.InvalidCapabilityRejection): Validates that requesting non-existent capabilities (CAP_NONEXISTENT_PRIVILEGE) is rejected by the daemon (INVALID_ARGUMENT/FAILED_PRECONDITION), asserting no orphaned instances remain.t.Cleanup.CNTR-1.10: Volume Mount Driver Option Matrix and Reflection (
TestVolumeMountOptions):gnoi.Containerz.CreateVolumewith multi-element Linux filesystem mount option combinations:rbind,rslaverbind,rprivatebind,rslave,robind,robindgnoi.Containerz.ListVolume(options["o"],options["device"],options["type"]).ListVolume.Test Verification & Build Matrix
4.34.2FX-wbb.2-DPE-CTNR).TestCapabilities/ElevatedCapabilities(PASS)TestCapabilities/DroppedCapabilities(PASS)TestCapabilities/InvalidCapabilityRejection(PASS)TestVolumeMountOptions/RbindRslave(PASS)TestVolumeMountOptions/RbindRprivate(PASS)TestVolumeMountOptions/BindRslaveRo(PASS)TestVolumeMountOptions/BindRo(PASS)TestVolumeMountOptions/Bind(PASS)