Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add dependencies for load-balance redundant-load-balance tests, add l…
…oad-balance test
- Loading branch information
Showing
3 changed files
with
99 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
# PRE: update if foreach | ||
# | ||
# Load-Balance blocks. | ||
# | ||
# Should distribute load between the modules. | ||
# | ||
update request { | ||
Tmp-Integer-0 := 0 | ||
Tmp-Integer-1 := 0 | ||
|
||
Tmp-Integer-2 += 0 # 0 | ||
Tmp-Integer-2 += 1 | ||
Tmp-Integer-2 += 2 | ||
Tmp-Integer-2 += 3 | ||
Tmp-Integer-2 += 4 | ||
Tmp-Integer-2 += 5 | ||
Tmp-Integer-2 += 6 | ||
Tmp-Integer-2 += 7 | ||
Tmp-Integer-2 += 8 | ||
Tmp-Integer-2 += 9 # 10 | ||
Tmp-Integer-2 += 0 | ||
Tmp-Integer-2 += 1 | ||
Tmp-Integer-2 += 2 | ||
Tmp-Integer-2 += 3 | ||
Tmp-Integer-2 += 4 | ||
Tmp-Integer-2 += 5 | ||
Tmp-Integer-2 += 6 | ||
Tmp-Integer-2 += 7 | ||
Tmp-Integer-2 += 8 | ||
Tmp-Integer-2 += 9 # 20 | ||
Tmp-Integer-2 += 0 | ||
Tmp-Integer-2 += 1 | ||
Tmp-Integer-2 += 2 | ||
Tmp-Integer-2 += 3 | ||
Tmp-Integer-2 += 4 | ||
Tmp-Integer-2 += 5 | ||
Tmp-Integer-2 += 6 | ||
Tmp-Integer-2 += 7 | ||
Tmp-Integer-2 += 8 | ||
Tmp-Integer-2 += 9 # 30 | ||
Tmp-Integer-2 += 0 | ||
Tmp-Integer-2 += 1 | ||
Tmp-Integer-2 += 2 | ||
Tmp-Integer-2 += 3 | ||
Tmp-Integer-2 += 4 | ||
Tmp-Integer-2 += 5 | ||
Tmp-Integer-2 += 6 | ||
Tmp-Integer-2 += 7 | ||
Tmp-Integer-2 += 8 | ||
Tmp-Integer-2 += 9 # 40 | ||
Tmp-Integer-2 += 0 | ||
Tmp-Integer-2 += 1 | ||
Tmp-Integer-2 += 2 | ||
Tmp-Integer-2 += 3 | ||
Tmp-Integer-2 += 4 | ||
Tmp-Integer-2 += 5 | ||
Tmp-Integer-2 += 6 | ||
Tmp-Integer-2 += 7 | ||
Tmp-Integer-2 += 8 | ||
Tmp-Integer-2 += 9 # 49 | ||
} | ||
|
||
# | ||
# Loop 0..9 | ||
# | ||
foreach &Tmp-Integer-2 { | ||
load-balance { | ||
group { | ||
update request { | ||
Tmp-Integer-0 := "%{expr:%{Tmp-Integer-0} + 1}" | ||
Filter-Id += "PICKED GROUP 1 %{Tmp-Integer-0} TIME(S)" | ||
} | ||
ok | ||
} | ||
group { | ||
update request { | ||
Tmp-Integer-1 := "%{expr:%{Tmp-Integer-1} + 1}" | ||
Filter-Id += "PICKED GROUP 2 %{Tmp-Integer-1} TIME(S)" | ||
} | ||
ok | ||
} | ||
} | ||
} | ||
|
||
# The chances of one group being used over another 50 times by random occurrence | ||
# is quite small, and if this happens repeatedly, it's likely there's a bug in | ||
# the load-balance code or random number generator. | ||
if ((&Tmp-Integer-0 == 0) || (&Tmp-Integer-1 == 0)) { | ||
update reply { | ||
Filter-Id += "fail 1 %{Tmp-Integer-0}/%{Tmp-Integer-1})" | ||
} | ||
} | ||
else { | ||
update reply { | ||
Filter-Id := 'filter' | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
# PRE: update if foreach | ||
# | ||
# Redundant blocks. | ||
# | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
# PRE: update if foreach | ||
# | ||
# Redundant blocks. | ||
# | ||
|