Repository navigation
gNOI-5.4: Add test code for gNOI File Put and Stat Protocol Conformance - #6313
rakvishwakarma wants to merge 3 commits into
Conversation
… Put and Stat Protocol Conformance Adds the gNOI-5.4 test plan (README.md), its metadata.textproto, and the gNOI-5.4 testregistry entry. The Go test code and platform_exceptions will follow in a separate PR.
Adds gnoi_file_conformance_test.go, the platform_exceptions in metadata.textproto, and the exec link in the gNOI-5.4 testregistry entry. Follow-up to the README-only PR openconfig#6270. Also addresses the code review comments: - Join a scratch directory that ends in ":" (for example "harddisk:") and a file name as "harddisk:<name>" instead of "harddisk:/<name>". - Match every standalone hex token of 16+ characters when validating digests in File.Put hash-mismatch errors. - Return (context.Context, context.CancelFunc) from rpcContext and defer cancel() at each call site instead of t.Cleanup(cancel) per RPC. - Always send the interface type on a reused loopback, which some platforms require in every interface update.
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 a new conformance test suite for the gNOI File service, specifically targeting the File Put and Stat protocols. The changes include the implementation of the test logic, necessary metadata for platform-specific deviations, and registration of the new test in the test registry. The suite focuses on verifying protocol adherence, error handling, and storage stability, ensuring that the DUT correctly manages file operations and telemetry reporting. 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
|
Pull Request Functional Test Report for #6313 / 4a70a9eVirtual Devices
Hardware Devices
|
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), covering file uploads, metadata retrieval, streaming downloads, negative test cases, and scale testing. The feedback highlights three key areas for improvement: optimizing the cleanup phase to run file removals concurrently using context.Background() to prevent cleanup failures on test timeouts; refining the error digest hex validation to avoid false positives from unrelated hex tokens in error messages; and fixing a bug where a partial failure in the final file removal step prematurely sets the filesRemoved flag, which bypasses the fallback cleanup and violates the mandatory state reversion rule.
…n partial Remove failure - verifyErrorDigestHex only checks hex tokens that are likely to be the digest: tokens with the expected digest length, or a suffix of the expected or all-zero digest (omitted leading zeros). Unrelated hex tokens such as connection or trace IDs no longer cause failures. - gNOI-5.4.5 Step 4 marks the test files as removed only when every File.Remove succeeds, so the deferred cleanup retries otherwise.
This pull request adds the Go test code for gNOI-5.4 (gNOI File Put and Stat Protocol Conformance), following the README-only test plan in #6270.
What's included
gnoi_file_conformance_test.go, implementing gNOI-5.4.1 through gNOI-5.4.5 from the README.platform_exceptions(deviations) inmetadata.textproto.execlink to thegNOI-5.4entry.Review comments addressed
":"(for example"harddisk:") is now joined with the file name as"harddisk:<name>"instead ofpath.Join's"harddisk:/<name>".verifyErrorDigestHexnow checks every standalone hex token of 16 or more characters (\b(?:0[xX])?([0-9a-fA-F]{16,})\b), so omitted leading zeros are caught even when other words appear between "hash" and the hex value.rpcContextreturns(context.Context, context.CancelFunc)and every call site deferscancel()(unary calls through smallstatFile/removeFile/transferToRemotehelpers, and looped streams throughputInvalidRemoteFile/getFileError), instead of registeringt.Cleanup(cancel)for every RPC.Other change
type(softwareLoopback) is now always sent, because some platforms reject an interface update without it.descriptionandenabledare still left untouched on a reused loopback; the configuration sent to other platforms is unchanged.Implementation notes
File.Stat, trying/misc/disk1,harddisk:,/tmp(default),/var/tmp, and/mnt/flashin that order.File.Statresult ofUNAVAILABLE,UNIMPLEMENTED,PERMISSION_DENIED, orUNAUTHENTICATEDis treated as a server or session failure, not as proof that a file is absent.Test results (Nokia)
UNSPECIFIEDhash method rejection), gNOI-5.4.4, gNOI-5.4.5, and cleanup.File.Putthat ends without the required hash message, and reports hash values in an incorrect hex format when rejecting a wrong checksum. These are the DUT issues this test is designed to catch.