bryancall commented on code in PR #12717: URL: https://github.com/apache/trafficserver/pull/12717#discussion_r2879997811
########## tests/gold_tests/cache/cache_volume_features.replay.yaml: ########## @@ -0,0 +1,254 @@ +# 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. + +meta: + version: "1.0" + +# Configuration section for autest integration +autest: + description: "Test cache volume features: per-volume RAM cache and @volume= directive" + + dns: + name: "dns" + + server: + name: "server" + + client: + name: "client" + + ats: + name: "ts" + + records_config: + proxy.config.diags.debug.enabled: 1 + proxy.config.diags.debug.tags: "cache|cache_hosting|ram_cache" + proxy.config.cache.ram_cache.size: 128M + proxy.config.cache.ram_cache_cutoff: 4K + proxy.config.http.insert_response_via_str: 0 + proxy.config.cache.enable_read_while_writer: 0 + + volume_config: + # Volume 1: Explicit 32MB RAM cache, 8KB cutoff + - volume: 1 + scheme: "http" + size: "64M" + ram_cache_size: "32M" + ram_cache_cutoff: "8K" + + # Volume 2: Explicit 16MB RAM cache, 2KB cutoff + - volume: 2 + scheme: "http" + size: "32M" + ram_cache_size: "16M" + ram_cache_cutoff: "2K" + + # Volume 3: Default RAM cache settings (will use shared pool) + - volume: 3 + scheme: "http" + size: "32M" + + remap_config: + # Default volume selection (no @volume=) + - from: "http://default.example.com/" + to: "http://backend.ex:{SERVER_HTTP_PORT}/" + + # Explicit volume 1 selection + - from: "http://volume1.example.com/" + to: "http://backend.ex:{SERVER_HTTP_PORT}/" + options: + - "@volume=1" + + # Explicit volume 2 selection + - from: "http://volume2.example.com/" + to: "http://backend.ex:{SERVER_HTTP_PORT}/" + options: + - "@volume=2" + + # Invalid volume selection (should fallback) + - from: "http://invalid.example.com/" + to: "http://backend.ex:{SERVER_HTTP_PORT}/" + options: + - "@volume=99" + +# Proxy verifier test sessions +sessions: + # Test 1: Volume selection via @volume=1 Review Comment: Does this test actually exercise the intended behavior? If cache is ready when remap loads, `createCacheHostRecord("99", ...)` will fail (volume 99 isn't in `volume.config`) and the remap rule fails to load entirely. If cache isn't ready (deferred), the string is stored and `initVolumeHostRec` fails later with a non-fatal error — the rule works but without volume override. If the intent is "invalid volume gracefully degrades to default selection," it might be worth making that explicit in the test description. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
