storage/pkg/config: cover driver options being dropped mid-chain - #1058
Open
vtushar06 wants to merge 1 commit into
Open
storage/pkg/config: cover driver options being dropped mid-chain#1058vtushar06 wants to merge 1 commit into
vtushar06 wants to merge 1 commit into
Conversation
GetGraphDriverOptions builds one list across every driver section, but each test here sets a single field on a fresh OptionsConfig, so a branch that ends the chain early is invisible. 5d9d814 fixed btrfs.min_space returning instead of appending and the package passed before and after. Putting that line back today still gives ok for the existing tests; this one fails with Expected to find "overlay.mountopt=nodev", got [btrfs.min_space=100] Signed-off-by: Tushar Verma <tusharmyself06@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GetGraphDriverOptionsappends into one list across all four driver sections, but every test inconfig_test.gosets a single field on a freshOptionsConfigand then resets, so nothing covers a branch that ends the chain early.That is not hypothetical. 5d9d814 fixed
btrfs.min_spacedoingreturn append(...)instead ofdoptions = append(...), which silently dropped every option after it, and the package passed both before and after the fix.I put that line back locally to check. The existing tests still report
ok; the one here fails withIt sets one field in each of btrfs, overlay, vfs and zfs and asserts all four come back, so it catches an early return anywhere in the chain rather than just that one line.
@mtrmac you asked for something along these lines on #680 ("Some testing of the interactions between per-driver options and the top options in
OptionsConfigwould be valuable"). This only covers the per-driver half. TheOptionsConfigtop-level interaction is the other half, and I left it out because the ordering between the global options instorage/types/options.goand the per-driver ones looks undocumented, so I did not want to pin behaviour nobody has ruled on.