Repository navigation
gNOI-5.4: Add README, metadata, test code, and test registry entry for gNOI File Put and Stat Protocol Conformance - #6270
Conversation
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 introduces the gNOI-5.4 test plan, which defines the requirements for validating gNOI file transfer operations on a Device Under Test. The documentation covers positive end-to-end validation, negative test cases for stream handling and checksum mismatches, and multi-file scaling scenarios to ensure protocol robustness and storage telemetry accuracy. 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
|
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Pull Request Functional Test Report for #6270 / ebdad06Virtual Devices
Hardware Devices
|
There was a problem hiding this comment.
Code Review
This pull request introduces a new test plan and metadata for "gNOI-5.4: gNOI File Put and Stat Protocol Conformance" to validate gnoi.file.File protocol conformance, hash validation, and storage/session stability. It also registers the test in testregistry.textproto. The review feedback suggests a minor improvement in the README to use the platform-agnostic term "DUT" instead of "switch" for consistency.
There was a problem hiding this comment.
Code Review
This pull request introduces a new conformance test suite for the gnoi.file.File service (gNOI-5.4), including detailed documentation, metadata, and a comprehensive Go test implementation covering both positive and negative scenarios for Put, Stat, Get, and Remove RPCs. The review feedback focuses on improving test efficiency and stability. Key recommendations include batching gNMI operations with gnmi.OCBatch() to avoid inefficient serial queries in a loop, adopting a guarded t.Cleanup pattern with a boolean flag to prevent redundant file removals, using the defined watchTimeout instead of a hardcoded 10-second timeout to avoid flakiness on slower platforms, and removing a redundant sign-extension check that could cause false-positive test failures.
8e267de to
03237e5
Compare
There was a problem hiding this comment.
Code Review
This pull request introduces a new conformance test for the gnoi.file.File service (gNOI-5.4), verifying file operations (Put, Stat, Get, Remove), trailing hash validations, and storage telemetry. The feedback suggests improving the cleanup routine in revertLoopbackAndHostname to properly delete the loopback subinterface configuration if it did not exist prior to the test, rather than unconditionally deleting only the IP addresses, ensuring the DUT is restored to its exact original state.
There was a problem hiding this comment.
Code Review
This pull request introduces a new conformance test suite for the gNOI File service (gNOI-5.4), verifying file operations, stream validations, and storage telemetry. The review feedback highlights two key areas for improvement: first, refining the cleanup logic in revertLoopbackAndHostname to ensure loopback subinterfaces are properly restored or deleted depending on their index to prevent configuration leaks on shared testbeds; second, explicitly validating that the available and utilized mount-point telemetry fields are not nil to prevent masking non-compliant devices.
378af31 to
87f30d8
Compare
There was a problem hiding this comment.
Code Review
This pull request introduces a new conformance test suite (gNOI-5.4) to validate the gnoi.file.File protocol, including positive, negative, and scale scenarios, along with corresponding documentation and metadata registration. The review feedback highlights three key improvement opportunities: replacing the custom MD5 implementation with the standard library crypto/md5 package, adding a safety check for empty mount point names to prevent potential runtime panics during batch queries, and ensuring the test explicitly fails if File.Stat unexpectedly succeeds with zero entries on a non-existent file.
c328b9c to
d25be47
Compare
There was a problem hiding this comment.
Code Review
This pull request introduces a new conformance test suite (gNOI-5.4) to validate the gnoi.file.File protocol on the Device Under Test (DUT), including single-chunk and multi-chunk transfers, hash verification, and scale testing. The feedback suggests several improvements to the Go test implementation: using the standard path package instead of path/filepath for all DUT path manipulations to ensure platform-independent Unix-style paths, replacing the custom MD5 hashing implementation with the standard crypto/md5 package, and respecting the deviations.InterfaceEnabled(dut) deviation when configuring the top-level loopback interface.
8307d7b to
ba0e6e4
Compare
There was a problem hiding this comment.
Code Review
This pull request introduces a new conformance test, gNOI-5.4: gNOI File Put and Stat Protocol Conformance, which validates the gnoi.file.File service's Put, Stat, Get, and Remove RPCs, hash validations, and storage mount-point telemetry. Feedback on the implementation highlights a critical issue in resolveTestLoopback where falling back to subinterface 0 on lo0 could overwrite the primary in-band management interface and disrupt connectivity; it is recommended to fall back to a safe, non-zero subinterface index like testLoopbackIndex (10) instead.
0896376 to
276cde8
Compare
There was a problem hiding this comment.
Code Review
This pull request introduces a new conformance test suite for the gNOI File service (gNOI-5.4), validating file operations like Put, Stat, Get, and Remove, along with hash verification and negative test scenarios. The review feedback recommends replacing the custom MD5 hashing implementation with Go's standard library crypto/md5 package to enhance maintainability and performance, while updating the imports block to clean up unused dependencies.
276cde8 to
744144d
Compare
There was a problem hiding this comment.
Code Review
This pull request introduces a new conformance test suite for the gnoi.file.File service (gNOI-5.4), validating file operations such as Put, Stat, Get, and Remove under various positive and negative scenarios, including multi-chunk transfers, hash verification, and scale testing. The feedback highlights an improvement opportunity in the cleanup phase: rather than deleting the entire loopback interface, the test should only delete the specific subinterface created during the test to avoid disrupting shared testbed configurations.
744144d to
90936bc
Compare
There was a problem hiding this comment.
Code Review
This pull request introduces the gNOI-5.4 test suite, which validates the OpenConfig gnoi.file.File protocol conformance on the Device Under Test (DUT). It includes a comprehensive test plan in README.md, the Go test implementation in gnoi_file_conformance_test.go, platform-specific metadata, and registration in testregistry.textproto. Feedback on the implementation suggests using hex.EncodeToString instead of fmt.Sprintf for a more idiomatic and efficient conversion of a byte slice to a hexadecimal string.
1c8884a to
cbcb7df
Compare
There was a problem hiding this comment.
Code Review
This pull request introduces a new conformance test suite, gNOI-5.4, to validate the gnoi.file.File service protocol conformance, including positive and negative scenarios for Put, Stat, Get, Remove, and TransferToRemote RPCs. The test is registered in testregistry.textproto and includes platform-specific deviations in metadata.textproto. Feedback on the implementation suggests improving the cleanup routine in gnoi_file_conformance_test.go to delete the entire subinterface configuration rather than just individual IP addresses when the subinterface did not exist prior to the test, preventing stale configurations on shared testbeds.
|
/fptest virtual |
There was a problem hiding this comment.
Code Review
This pull request introduces a new conformance test suite for gNOI-5.4 (gNOI File Put and Stat Protocol Conformance). It includes a detailed test plan README, the Go test implementation validating positive and negative scenarios for the gNOI File service, platform-specific metadata, and registration in the test registry. The reviewer's feedback correctly identifies a potential issue in the mount point validation logic, where the test could fail on virtual or ephemeral mount points that do not report capacity metrics. The reviewer suggests skipping these unpopulated mount points instead of failing the test, which is a valuable improvement for test robustness across different platforms.
…tat Protocol Conformance
… errors Tighten gNOI-5.4.3 so any digest rendered in a hash-mismatch error message must be the fixed-length, zero-padded unsigned hex encoding (64 chars for SHA-256, 32 chars for MD5) and equal either the all-zero client digest or the payload digest, matching the README pass criteria. README is unchanged.
… README - Send and verify File permissions using the gnoi/file/file.proto octal-digit encoding (644/640, no base conversion); accept the requested value or the value with the reported umask applied, and do not require a non-zero umask. - Correct the Payload A/B digest byte breakdowns and add the Payload C expected SHA-256 digest (with an internal sanity check in the test). - gNOI-5.4.5 Step 2: replace the non-existent-parent-directory case (which file.proto allows to succeed) with empty, relative, and existing-directory remote_file values; verify the scratch directory remains intact. - Use the platform-resolved scratch directory for the negative directory File.Remove check instead of a hardcoded path. - Keep the README language/framework-neutral and clarify the gNOI-5.4.3 fixed-length unsigned hex digest criteria.
…xists On platforms with cli_takes_precedence_over_oc (e.g. loopback naming limited to index 0 and a single loopback unit per routing instance), the test reuses an existing non-zero loopback subinterface. When none exists, creating a new loopback unit is rejected by the DUT, so the test loopback configuration (and its convergence checks and cleanup) is now skipped; the gNOI File checks do not depend on it. The README is updated accordingly.
Functional translators (system_mount_point_state_ft) only accept single-leaf queries, so the batched size/available/utilized Get was rejected. Query each leaf with a wildcard mount-point key instead (three queries in total) and join the results by mount-point name.
…t negative wording - validateMountPoint now logs and skips mount points that do not populate size, available, or utilized (virtual, read-only, or ephemeral mounts), while verifyMountPointsTelemetry still requires at least one mount point with non-zero size and available capacity. - README: File.Stat checks for removed or missing files now say "returns a non-OK gRPC error (for example NOT_FOUND)", matching the test code and the existing 5.4.5 wording.
128af13 to
3f198e8
Compare
…, and address review feedback
- Bound every gnoi.file.File RPC with a 2-minute client deadline so a DUT that
never terminates a stream fails the step instead of hanging the test; a
client-side DEADLINE_EXCEEDED is never accepted as a valid rejection.
- Probe platform storage paths (/misc/disk1, harddisk:) before /tmp when
resolving the scratch directory, since some platforms allow File.Stat on /tmp
but reject it as a File.Put destination.
- Add the Payload C MD5 digest for DUTs that return an MD5 trailing
GetResponse{hash}, and assert the 4 x 64 KB Payload C size.
- Tighten the File.Stat path check, handle device-prefixed directory entries,
add the missing File.Get timeout check in gNOI-5.4.5, and fix a log message.
- Treat UNAVAILABLE, UNIMPLEMENTED, PERMISSION_DENIED, and UNAUTHENTICATED from
File.Stat as server/session failures rather than file-absent results.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a new conformance test suite for the gNOI File Put and Stat protocols (gNOI-5.4), including a detailed test plan, test implementation, metadata, and registry updates. The reviewer identified a violation of the Mandatory State Reversion style guide where top-level properties of a reused loopback interface are modified but not reverted during cleanup on platforms where CLI takes precedence over OC. A code suggestion was provided to restrict these modifications to newly created dedicated loopback interfaces.
When cli_takes_precedence_over_oc is set and an existing lo0 subinterface is reused, only add the test IPv4/IPv6 addresses and leave the loopback's interface-level type, description, and enabled leaves unchanged, so cleanup fully restores the pre-test configuration.
- Add a baseName helper that handles both "/dir/name" and "<device>:name" paths, and use it in both verifyFileStat and verifyDirectoryStat. - Report a client-side timeout on the gNOI-5.4.2 File.Get stream open as a failure, consistent with gNOI-5.4.5.
This pull request adds the gNOI-5.4 test, which checks that the DUT correctly implements the gNOI File service (
Put,Stat,Get,Remove,TransferToRemote), with a focus on validating the trailing hash (checksum) sent at the end of aFile.Putupload.What's included
gNOI-5.4entry.What the test checks
File.StatandFile.Getreturn the correct size, permissions, content, and properly formatted fixed-length hex checksums.File.Putupload without sending the final hash message. The DUT must reject it with an error, must not keep the partial file, and must leave existing files untouched.UNSPECIFIEDhash method. The DUT must reject the upload, report correctly formatted hex values in the error (noffffffsign-extension or dropped leading zeros), and not keep the file.File.Stat, and confirms storage telemetry reports non-zero size and available space.Stat/Get/Remove/TransferToRemote) and expects errors, confirming the scratch directory stays intact. It then removes all 13 test files.Implementation notes
File.Stat, trying/misc/disk1,harddisk:,/tmp(default),/var/tmp, and/mnt/flashin that order, because some platforms allowFile.Staton/tmpbut reject it as aFile.Putdestination.File.Statresult ofUNAVAILABLE,UNIMPLEMENTED,PERMISSION_DENIED, orUNAUTHENTICATEDis treated as a server or session failure, not as proof that a file is absent.gnoi/file/file.protooctal-digit encoding (for example644), accepting the DUT's umask.Test results (Nokia)
UNSPECIFIEDhash method rejection), and cleanup.File.Putupload that ends without the required hash message (returns OK instead of an error).