Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions proxy/http/remap/unit-tests/test_NextHopConsistentHash.cc
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ SCENARIO("Testing NextHopConsistentHash class, using policy 'consistent_hash'",
//
THEN("when making requests and taking nodes down.")
{
REQUIRE(nhf.strategies_loaded == true);
REQUIRE(strategy != nullptr);

// first request.
br(&request, "rabbit.net");
result.reset();
Expand Down Expand Up @@ -217,6 +220,9 @@ SCENARIO("Testing NextHopConsistentHash class (all firstcalls), using policy 'co

THEN("when making requests and taking nodes down.")
{
REQUIRE(nhf.strategies_loaded == true);
REQUIRE(strategy != nullptr);

// first request.
br(&request, "rabbit.net");
result.reset();
Expand Down Expand Up @@ -311,6 +317,9 @@ SCENARIO("Testing NextHopConsistentHash class (alternating rings), using policy

THEN("expect the following results when making requests and marking hosts down.")
{
REQUIRE(nhf.strategies_loaded == true);
REQUIRE(strategy != nullptr);

// first request.
br(&request, "bunny.net/asset1");
result.reset();
Expand Down
12 changes: 12 additions & 0 deletions proxy/http/remap/unit-tests/test_NextHopRoundRobin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ SCENARIO("Testing NextHopRoundRobin class, using policy 'rr-strict'", "[NextHopR

THEN("then testing rr-strict.")
{
REQUIRE(nhf.strategies_loaded == true);
REQUIRE(strategy != nullptr);

// first request.
ParentResult result;
strategy->findNextHop(10000, result, rdata, fail_threshold, retry_time);
Expand Down Expand Up @@ -164,6 +167,9 @@ SCENARIO("Testing NextHopRoundRobin class, using policy 'first-live'", "[NextHop

THEN("when making requests and marking down hosts.")
{
REQUIRE(nhf.strategies_loaded == true);
REQUIRE(strategy != nullptr);

// first request.
ParentResult result;
strategy->findNextHop(20000, result, rdata, fail_threshold, retry_time);
Expand Down Expand Up @@ -226,6 +232,9 @@ SCENARIO("Testing NextHopRoundRobin class, using policy 'rr-ip'", "[NextHopRound

THEN("when making requests and marking down hosts.")
{
REQUIRE(nhf.strategies_loaded == true);
REQUIRE(strategy != nullptr);

// first request.
memcpy(&rdata.client_ip, &sa1, sizeof(sa1));
ParentResult result;
Expand Down Expand Up @@ -278,6 +287,9 @@ SCENARIO("Testing NextHopRoundRobin class, using policy 'latched'", "[NextHopRou

THEN("when making requests and marking down hosts.")
{
REQUIRE(nhf.strategies_loaded == true);
REQUIRE(strategy != nullptr);

// first request should select p3
ParentResult result;
strategy->findNextHop(40000, result, rdata, fail_threshold, retry_time);
Expand Down