Skip to content

Commit

Permalink
Merge pull request #183 from jingyuanliang/test
Browse files Browse the repository at this point in the history
Add test case for escaped resyncInterval
  • Loading branch information
k8s-ci-robot authored Feb 14, 2025
2 parents 358d774 + 66410e6 commit 58456cd
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 58456cd

Please sign in to comment.