@@ -30,17 +30,27 @@ func (suite *MapUpdateSuite) Test_Update() {
3030 suite .tmplData .Paths = append (suite .tmplData .Paths , strconv .Itoa (i ))
3131 }
3232 oldInfo , err := e2e .GetGlobalHAProxyInfo ()
33- oldCount , err := e2e .GetHAProxyMapCount ("path-prefix" )
33+ oldCountExact , err := e2e .GetHAProxyMapCount ("path-exact" )
34+ suite .Require ().NoError (err )
35+ oldCountPrefixExact , err := e2e .GetHAProxyMapCount ("path-prefix-exact" )
36+ suite .Require ().NoError (err )
37+ oldCountPrefix , err := e2e .GetHAProxyMapCount ("path-prefix" )
3438 suite .Require ().NoError (err )
3539 suite .Require ().NoError (suite .test .Apply ("config/ingress.yaml.tmpl" , suite .test .GetNS (), suite .tmplData ))
3640 suite .Require ().Eventually (func () bool {
3741 newInfo , err := e2e .GetGlobalHAProxyInfo ()
3842 suite .Require ().NoError (err )
39- count , err := e2e .GetHAProxyMapCount ("path-prefix" )
43+ countExact , err := e2e .GetHAProxyMapCount ("path-exact" )
44+ suite .Require ().NoError (err )
45+ countPrefixExact , err := e2e .GetHAProxyMapCount ("path-prefix-exact" )
46+ suite .Require ().NoError (err )
47+ countPrefix , err := e2e .GetHAProxyMapCount ("path-prefix" )
4048 suite .Require ().NoError (err )
41- numOfAddedEntries := count - oldCount + 1 // We add one because there's already an entry at the begining which will be removed
42- suite .T ().Logf ("oldInfo.Pid(%s) == newInfo.Pid(%s) && additional path-prefix.count(%d) == %d" , oldInfo .Pid , newInfo .Pid , numOfAddedEntries , n )
43- return oldInfo .Pid == newInfo .Pid && numOfAddedEntries == n
49+ numOfAddedEntriesExact := countExact - oldCountExact
50+ numOfAddedEntriesPrefixExact := countPrefixExact - oldCountPrefixExact
51+ numOfAddedEntriesPrefix := countPrefix - oldCountPrefix + 1 // We add one because there's already an entry at the beginning which will be removed
52+ suite .T ().Logf ("oldInfo.Pid(%s) == newInfo.Pid(%s) && additional path-exact.count(%d) == %d && additional path-prefix-exact.count(%d) == %d && additional path-prefix.count(%d) == %d" , oldInfo .Pid , newInfo .Pid , numOfAddedEntriesExact , 0 , numOfAddedEntriesPrefixExact , n , numOfAddedEntriesPrefix , n )
53+ return oldInfo .Pid == newInfo .Pid && numOfAddedEntriesExact == 0 && numOfAddedEntriesPrefixExact == n && numOfAddedEntriesPrefix == n
4454 }, e2e .WaitDuration , e2e .TickDuration )
4555 })
4656}
0 commit comments