# @file
#
#  Unit test data round-robin-tests.yaml file for testing the NextHopStrategyFactory
#
#  @section license License
#
#  Licensed to the Apache Software Foundation (ASF) under one
#  or more contributor license agreements.  See the NOTICE file
#  distributed with this work for additional information
#  regarding copyright ownership.  The ASF licenses this file
#  to you under the Apache License, Version 2.0 (the
#  "License"); you may not use this file except in compliance
#  with the License.  You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
#  Unless required by applicable law or agreed to in writing, software
#  distributed under the License is distributed on an "AS IS" BASIS,
#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#  See the License for the specific language governing permissions and
#  limitations under the License.
#
#  @section details Details
#
#
# unit testing strategies for NextHopRoundRobin.
#
strategies:
  - strategy: "first-live"
    policy: first_live
    groups:
      - &g1
        - host: p1.foo.com
          hash_string: slsklslsk
          protocol:
            - scheme: http
              port: 80
              health_check_url: http://192.168.1.1:80
            - scheme: https
              port: 443
              health_check_url: https://192.168.1.1:443
          weight: 1.0
        - host: p2.foo.com
          hash_string: srskrsrsk
          protocol:
            - scheme: http
              port: 80
              health_check_url: http://192.168.1.2:80
            - scheme: https
              port: 443
              health_check_url: https://192.168.1.2:443
          weight: 1.0
      - &g2
        - host: s1.bar.com
          hash_string: lslalalal
          protocol:
            - scheme: http
              port: 80
              health_check_url: http://192.168.2.1:80
            - scheme: https
              port: 443
              health_check_url: https://192.168.2.1:443
          weight: 1.0
        - host: s2.bar.com
          hash_string: alalalalal
          protocol:
            - scheme: http
              port: 80
              health_check_url: http://192.168.2.2:80
            - scheme: https
              port: 443
              health_check_url: https://192.168.2.2:443
          weight: 1.0
    scheme: http
    failover:
      ring_mode: exhaust_ring
      response_codes:
        - 404
        - 502
        - 503
      health_check:
        - passive
        - active
  - strategy: "rr-strict-exhaust-ring"
    policy: rr_strict
    groups:
      - &g1
        - host: p1.foo.com
          hash_string: slsklslsk
          protocol:
            - scheme: http
              port: 80
              health_check_url: http://192.168.1.1:80
            - scheme: https
              port: 443
              health_check_url: https://192.168.1.1:443
          weight: 1.0
        - host: p2.foo.com
          hash_string: srskrsrsk
          protocol:
            - scheme: http
              port: 80
              health_check_url: http://192.168.1.2:80
            - scheme: https
              port: 443
              health_check_url: https://192.168.1.2:443
          weight: 1.0
      - &g2
        - host: s1.bar.com
          hash_string: lslalalal
          protocol:
            - scheme: http
              port: 80
              health_check_url: http://192.168.2.1:80
            - scheme: https
              port: 443
              health_check_url: https://192.168.2.1:443
          weight: 1.0
        - host: s2.bar.com
          hash_string: alalalalal
          protocol:
            - scheme: http
              port: 80
              health_check_url: http://192.168.2.2:80
            - scheme: https
              port: 443
              health_check_url: https://192.168.2.2:443
          weight: 1.0
    scheme: http
    failover:
      ring_mode: exhaust_ring
      response_codes:
        - 404
        - 502
        - 503
      health_check:
        - passive
        - active
  - strategy: "rr-ip"
    policy: rr_ip
    groups:
      - &g1
        - host: p3.foo.com
          hash_string: slsklslsk
          protocol:
            - scheme: http
              port: 80
              health_check_url: http://192.168.1.3:80
            - scheme: https
              port: 443
              health_check_url: https://192.168.1.3:443
          weight: 1.0
        - host: p4.foo.com
          hash_string: srskrsrsk
          protocol:
            - scheme: http
              port: 80
              health_check_url: http://192.168.1.4:80
            - scheme: https
              port: 443
              health_check_url: https://192.168.1.4:443
          weight: 1.0
    scheme: http
    failover:
      ring_mode: alternate_ring
      response_codes:
        - 404
        - 502
        - 503
      health_check:
        - passive
        - active
  - strategy: "latched"
    policy: latched
    groups:
      - &g1
        - host: p3.foo.com
          hash_string: slsklslsk
          protocol:
            - scheme: http
              port: 80
              health_check_url: http://192.168.1.3:80
            - scheme: https
              port: 443
              health_check_url: https://192.168.1.3:443
          weight: 1.0
        - host: p4.foo.com
          hash_string: srskrsrsk
          protocol:
            - scheme: http
              port: 80
              health_check_url: http://192.168.1.4:80
            - scheme: https
              port: 443
              health_check_url: https://192.168.1.4:443
          weight: 1.0
    scheme: http
    failover:
      ring_mode: alternate_ring
      response_codes:
        - 404
        - 502
        - 503
      health_check:
        - passive
        - active
