You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by zw...@apache.org on 2020/01/23 22:02:54 UTC

[trafficserver] 03/12: This fixes next hop unit tests that segfault due to missing (#6216)

This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git

commit f54dd5260b45e6ba9e8bff2fad6d96e7d811af8a
Author: John J. Rushford <jr...@apache.org>
AuthorDate: Wed Nov 20 20:39:52 2019 -0700

    This fixes next hop unit tests that segfault due to missing (#6216)
    
    unit test yaml files.
    
    (cherry picked from commit f990f13b832710e6b625758b758f15feaedfbf42)
---
 proxy/http/remap/unit-tests/test_NextHopConsistentHash.cc |  9 +++++++++
 proxy/http/remap/unit-tests/test_NextHopRoundRobin.cc     | 12 ++++++++++++
 2 files changed, 21 insertions(+)

diff --git a/proxy/http/remap/unit-tests/test_NextHopConsistentHash.cc b/proxy/http/remap/unit-tests/test_NextHopConsistentHash.cc
index 172e85c..912a5da 100644
--- a/proxy/http/remap/unit-tests/test_NextHopConsistentHash.cc
+++ b/proxy/http/remap/unit-tests/test_NextHopConsistentHash.cc
@@ -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();
@@ -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();
@@ -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();
diff --git a/proxy/http/remap/unit-tests/test_NextHopRoundRobin.cc b/proxy/http/remap/unit-tests/test_NextHopRoundRobin.cc
index 104efc0..7df2fd3 100644
--- a/proxy/http/remap/unit-tests/test_NextHopRoundRobin.cc
+++ b/proxy/http/remap/unit-tests/test_NextHopRoundRobin.cc
@@ -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);
@@ -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);
@@ -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;
@@ -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);