Skip to content

Commit

Permalink
Add test case for escaped resyncInterval
Browse files Browse the repository at this point in the history
  • Loading branch information
jingyuanliang committed Feb 14, 2025
1 parent b7bbaea commit 66410e6
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions cmd/ip-masq-agent/ip-masq-agent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,18 @@ resyncInterval: 5m
MasqLinkLocal: true,
ResyncInterval: NewMasqConfigNoReservedRanges().ResyncInterval}},

// There is custom unmarshaller here so check its behavior.
{"valid json file, just resyncInterval but escaped", fakefs.StringFS{File: `
{
"resyncInterval": "\u0035\u006d"
}
`},
nil, &MasqConfig{
CidrLimit: 64,
NonMasqueradeCIDRs: NewMasqConfigNoReservedRanges().NonMasqueradeCIDRs,
MasqLinkLocal: NewMasqConfigNoReservedRanges().MasqLinkLocal,
ResyncInterval: metav1.Duration{Duration: 5 * time.Minute}}},

{"valid json file, just resyncInterval", fakefs.StringFS{File: `
{
"resyncInterval": "5m"
Expand Down

0 comments on commit 66410e6

Please sign in to comment.