From 8dffbdfd730b142af4a6185f209b1dca475e1f15 Mon Sep 17 00:00:00 2001 From: ronycsdu Date: Fri, 22 Nov 2024 17:23:18 +1100 Subject: [PATCH] Renamed files and folder from redis to valkey (#1835) --- .cargo/config.toml | 2 +- .gitignore | 2 +- custom-transforms-example/src/main.rs | 4 +- ...s_get_rewrite.rs => valkey_get_rewrite.rs} | 0 custom-transforms-example/tests/test.rs | 4 +- shotover-proxy/benches/windsock/main.rs | 6 +- .../windsock/{redis => valkey}/bench.rs | 20 ++-- .../benches/windsock/{redis => valkey}/mod.rs | 0 .../tests/cassandra_int_tests/mod.rs | 4 +- shotover-proxy/tests/lib.rs | 4 +- .../tests/runner/observability_int_tests.rs | 12 +-- .../tests/runner/runner_int_tests.rs | 4 +- .../{null-redis => null-valkey}/topology.yaml | 0 .../tls-no-verify-hostname/topology.yaml | 17 ---- .../redis/tls/topology-encode.yaml | 20 ---- .../test-configs/redis/tls/topology.yaml | 17 ---- .../cluster-auth/docker-compose.yaml | 0 .../cluster-auth/topology.yaml | 0 .../cluster-dr/docker-compose.yaml | 0 .../cluster-dr/topology.yaml | 0 .../cluster-handling/docker-compose.yaml | 0 .../cluster-handling/topology.yaml | 0 .../cluster-hiding/docker-compose.yaml | 0 .../cluster-hiding/topology-encode.yaml | 0 .../cluster-hiding/topology.yaml | 0 .../cluster-ports-rewrite/docker-compose.yaml | 0 .../cluster-ports-rewrite/topology.yaml | 0 .../cluster-tls/docker-compose.yaml | 14 +-- .../cluster-tls/topology-encode.yaml | 10 +- .../topology-no-source-encryption.yaml | 6 +- .../cluster-tls/topology.yaml | 10 +- .../passthrough/docker-compose.yaml | 0 .../{redis => valkey}/passthrough/redis.conf | 0 .../passthrough/topology-encode.yaml | 0 .../passthrough/topology.yaml | 0 .../tls-no-client-auth/docker-compose.yaml | 0 .../tls-no-client-auth/topology.yaml | 6 +- .../docker-compose.yaml | 0 .../tls-no-verify-hostname/topology.yaml | 17 ++++ .../{redis => valkey}/tls/docker-compose.yaml | 0 .../{redis => valkey}/tls/redis-cli.sh | 0 .../valkey/tls/topology-encode.yaml | 20 ++++ .../test-configs/valkey/tls/topology.yaml | 17 ++++ .../tests/transforms/log_to_file.rs | 6 +- .../tests/transforms/query_type_filter.rs | 6 +- shotover-proxy/tests/transforms/tee.rs | 28 +++--- .../assert.rs | 0 .../basic_driver_tests.rs | 38 ++++---- .../mod.rs | 94 ++++++++++--------- shotover/benches/benches/chain.rs | 2 +- shotover/src/codec/mod.rs | 2 +- shotover/src/codec/{redis.rs => valkey.rs} | 2 +- shotover/src/config/topology.rs | 4 +- shotover/src/frame/mod.rs | 2 +- shotover/src/frame/{redis.rs => valkey.rs} | 0 shotover/src/frame/value.rs | 2 +- .../src/frame/value/{redis.rs => valkey.rs} | 0 shotover/src/message/mod.rs | 2 +- shotover/src/sources/mod.rs | 4 +- shotover/src/sources/{redis.rs => valkey.rs} | 2 +- shotover/src/transforms/mod.rs | 4 +- shotover/src/transforms/query_counter.rs | 2 +- .../util/cluster_connection_pool.rs | 2 +- .../src/transforms/{redis => valkey}/cache.rs | 2 +- .../cluster_ports_rewrite.rs | 4 +- .../src/transforms/{redis => valkey}/mod.rs | 0 .../{redis => valkey}/sink_cluster.rs | 8 +- .../{redis => valkey}/sink_single.rs | 2 +- .../{redis => valkey}/timestamp_tagging.rs | 0 test-helpers/src/cert.rs | 2 +- test-helpers/src/connection/mod.rs | 2 +- ...dis_connection.rs => valkey_connection.rs} | 6 +- 72 files changed, 223 insertions(+), 221 deletions(-) rename custom-transforms-example/src/{redis_get_rewrite.rs => valkey_get_rewrite.rs} (100%) rename shotover-proxy/benches/windsock/{redis => valkey}/bench.rs (96%) rename shotover-proxy/benches/windsock/{redis => valkey}/mod.rs (100%) rename shotover-proxy/tests/test-configs/{null-redis => null-valkey}/topology.yaml (100%) delete mode 100644 shotover-proxy/tests/test-configs/redis/tls-no-verify-hostname/topology.yaml delete mode 100644 shotover-proxy/tests/test-configs/redis/tls/topology-encode.yaml delete mode 100644 shotover-proxy/tests/test-configs/redis/tls/topology.yaml rename shotover-proxy/tests/test-configs/{redis => valkey}/cluster-auth/docker-compose.yaml (100%) rename shotover-proxy/tests/test-configs/{redis => valkey}/cluster-auth/topology.yaml (100%) rename shotover-proxy/tests/test-configs/{redis => valkey}/cluster-dr/docker-compose.yaml (100%) rename shotover-proxy/tests/test-configs/{redis => valkey}/cluster-dr/topology.yaml (100%) rename shotover-proxy/tests/test-configs/{redis => valkey}/cluster-handling/docker-compose.yaml (100%) rename shotover-proxy/tests/test-configs/{redis => valkey}/cluster-handling/topology.yaml (100%) rename shotover-proxy/tests/test-configs/{redis => valkey}/cluster-hiding/docker-compose.yaml (100%) rename shotover-proxy/tests/test-configs/{redis => valkey}/cluster-hiding/topology-encode.yaml (100%) rename shotover-proxy/tests/test-configs/{redis => valkey}/cluster-hiding/topology.yaml (100%) rename shotover-proxy/tests/test-configs/{redis => valkey}/cluster-ports-rewrite/docker-compose.yaml (100%) rename shotover-proxy/tests/test-configs/{redis => valkey}/cluster-ports-rewrite/topology.yaml (100%) rename shotover-proxy/tests/test-configs/{redis => valkey}/cluster-tls/docker-compose.yaml (80%) rename shotover-proxy/tests/test-configs/{redis => valkey}/cluster-tls/topology-encode.yaml (57%) rename shotover-proxy/tests/test-configs/{redis => valkey}/cluster-tls/topology-no-source-encryption.yaml (63%) rename shotover-proxy/tests/test-configs/{redis => valkey}/cluster-tls/topology.yaml (53%) rename shotover-proxy/tests/test-configs/{redis => valkey}/passthrough/docker-compose.yaml (100%) rename shotover-proxy/tests/test-configs/{redis => valkey}/passthrough/redis.conf (100%) rename shotover-proxy/tests/test-configs/{redis => valkey}/passthrough/topology-encode.yaml (100%) rename shotover-proxy/tests/test-configs/{redis => valkey}/passthrough/topology.yaml (100%) rename shotover-proxy/tests/test-configs/{redis => valkey}/tls-no-client-auth/docker-compose.yaml (100%) rename shotover-proxy/tests/test-configs/{redis => valkey}/tls-no-client-auth/topology.yaml (51%) rename shotover-proxy/tests/test-configs/{redis => valkey}/tls-no-verify-hostname/docker-compose.yaml (100%) create mode 100644 shotover-proxy/tests/test-configs/valkey/tls-no-verify-hostname/topology.yaml rename shotover-proxy/tests/test-configs/{redis => valkey}/tls/docker-compose.yaml (100%) rename shotover-proxy/tests/test-configs/{redis => valkey}/tls/redis-cli.sh (100%) create mode 100644 shotover-proxy/tests/test-configs/valkey/tls/topology-encode.yaml create mode 100644 shotover-proxy/tests/test-configs/valkey/tls/topology.yaml rename shotover-proxy/tests/{redis_int_tests => valkey_int_tests}/assert.rs (100%) rename shotover-proxy/tests/{redis_int_tests => valkey_int_tests}/basic_driver_tests.rs (97%) rename shotover-proxy/tests/{redis_int_tests => valkey_int_tests}/mod.rs (71%) rename shotover/src/codec/{redis.rs => valkey.rs} (99%) rename shotover/src/frame/{redis.rs => valkey.rs} (100%) rename shotover/src/frame/value/{redis.rs => valkey.rs} (100%) rename shotover/src/sources/{redis.rs => valkey.rs} (97%) rename shotover/src/transforms/{redis => valkey}/cache.rs (99%) rename shotover/src/transforms/{redis => valkey}/cluster_ports_rewrite.rs (99%) rename shotover/src/transforms/{redis => valkey}/mod.rs (100%) rename shotover/src/transforms/{redis => valkey}/sink_cluster.rs (99%) rename shotover/src/transforms/{redis => valkey}/sink_single.rs (98%) rename shotover/src/transforms/{redis => valkey}/timestamp_tagging.rs (100%) rename test-helpers/src/connection/{redis_connection.rs => valkey_connection.rs} (90%) diff --git a/.cargo/config.toml b/.cargo/config.toml index c4f14118e..03ce78a2d 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -19,6 +19,6 @@ windsock-cassandra = "test --release --bench windsock --no-default-features --fe # Compile benches in docker to ensure compiled libc version is compatible with the EC2 instances libc windsock-cloud-docker = "run --package windsock-cloud-docker -- redis,cassandra,kafka" -windsock-cloud-docker-redis = "run --package windsock-cloud-docker -- redis" +windsock-cloud-docker-valkey = "run --package windsock-cloud-docker -- redis" windsock-cloud-docker-kafka = "run --package windsock-cloud-docker -- kafka" windsock-cloud-docker-cassandra = "run --package windsock-cloud-docker -- cassandra" diff --git a/.gitignore b/.gitignore index cb452cd1c..7b69c6476 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,7 @@ .idea/ *.gz /.vscode -/shotover-proxy/tests/test-configs/redis/tls/certs +/shotover-proxy/tests/test-configs/valkey/tls/certs /shotover-proxy/tests/test-configs/cassandra/tls/certs /shotover-proxy/tests/test-configs/kafka/tls/certs .workspace.code-workspace diff --git a/custom-transforms-example/src/main.rs b/custom-transforms-example/src/main.rs index f4714f7d8..af3de435e 100644 --- a/custom-transforms-example/src/main.rs +++ b/custom-transforms-example/src/main.rs @@ -1,9 +1,9 @@ use shotover::runner::Shotover; #[cfg(feature = "redis")] -mod redis_get_rewrite; +mod valkey_get_rewrite; #[cfg(feature = "redis")] -shotover::import_transform!(redis_get_rewrite::ValkeyGetRewriteConfig); +shotover::import_transform!(valkey_get_rewrite::ValkeyGetRewriteConfig); fn main() { Shotover::new().run_block(); diff --git a/custom-transforms-example/src/redis_get_rewrite.rs b/custom-transforms-example/src/valkey_get_rewrite.rs similarity index 100% rename from custom-transforms-example/src/redis_get_rewrite.rs rename to custom-transforms-example/src/valkey_get_rewrite.rs diff --git a/custom-transforms-example/tests/test.rs b/custom-transforms-example/tests/test.rs index d3ee2646e..393d39a6b 100644 --- a/custom-transforms-example/tests/test.rs +++ b/custom-transforms-example/tests/test.rs @@ -2,7 +2,7 @@ use pretty_assertions::assert_eq; use redis::aio::Connection; use redis::Cmd; use std::time::Duration; -use test_helpers::connection::redis_connection; +use test_helpers::connection::valkey_connection; use test_helpers::docker_compose::docker_compose; use test_helpers::shotover_process::{bin_path, BinProcess, EventMatcher, Level}; @@ -11,7 +11,7 @@ async fn test_custom_transform() { // Setup shotover and the valkey server it connects to let _compose = docker_compose("config/docker-compose.yaml"); let shotover = shotover_proxy("config/topology.yaml").await; - let mut connection = redis_connection::new_async("127.0.0.1", 6379).await; + let mut connection = valkey_connection::new_async("127.0.0.1", 6379).await; // Verify functionality of transform assert_ok( diff --git a/shotover-proxy/benches/windsock/main.rs b/shotover-proxy/benches/windsock/main.rs index 5c971e4f3..c93ce8d8b 100644 --- a/shotover-proxy/benches/windsock/main.rs +++ b/shotover-proxy/benches/windsock/main.rs @@ -15,9 +15,9 @@ mod common; #[cfg(all(feature = "kafka-cpp-driver-tests", feature = "kafka"))] mod kafka; mod profilers; -#[cfg(feature = "redis")] -mod redis; mod shotover; +#[cfg(feature = "redis")] +mod valkey; use cloud::CloudResources; use cloud::CloudResourcesRequired; @@ -55,7 +55,7 @@ fn main() { #[cfg(all(feature = "kafka-cpp-driver-tests", feature = "kafka"))] benches.extend(kafka::benches()); #[cfg(feature = "redis")] - benches.extend(redis::benches()); + benches.extend(valkey::benches()); Windsock::new(benches, cloud::AwsCloud::new_boxed(), &["release"]).run(); } diff --git a/shotover-proxy/benches/windsock/redis/bench.rs b/shotover-proxy/benches/windsock/valkey/bench.rs similarity index 96% rename from shotover-proxy/benches/windsock/redis/bench.rs rename to shotover-proxy/benches/windsock/valkey/bench.rs index 4cf87fd7a..9261d95c5 100644 --- a/shotover-proxy/benches/windsock/redis/bench.rs +++ b/shotover-proxy/benches/windsock/valkey/bench.rs @@ -24,7 +24,7 @@ use shotover::{ tls::{TlsAcceptorConfig, TlsConnectorConfig}, transforms::{ debug::force_parse::DebugForceEncodeConfig, - redis::{sink_cluster::ValkeySinkClusterConfig, sink_single::ValkeySinkSingleConfig}, + valkey::{sink_cluster::ValkeySinkClusterConfig, sink_single::ValkeySinkSingleConfig}, TransformConfig, }, }; @@ -84,7 +84,7 @@ impl ValkeyBench { } fn generate_topology_yaml(&self, host_address: String, valkey_address: String) -> String { - let certs = "tests/test-configs/redis/tls/certs"; + let certs = "tests/test-configs/valkey/tls/certs"; let tls_connector = match self.encryption { Encryption::Tls => Some(TlsConnectorConfig { certificate_authority_path: format!("{certs}/localhost_CA.crt"), @@ -131,7 +131,7 @@ impl ValkeyBench { } common::generate_topology(SourceConfig::Valkey( - shotover::sources::redis::ValkeyConfig { + shotover::sources::valkey::ValkeyConfig { name: "valkey".to_owned(), listen_addr: host_address, connection_limit: None, @@ -314,12 +314,12 @@ impl Bench for ValkeyBench { ValkeyTopology::Cluster3 => "172.16.1.2:6379", }; let config_dir = match (self.topology, self.encryption) { - (ValkeyTopology::Single, Encryption::None) => "tests/test-configs/redis/passthrough", + (ValkeyTopology::Single, Encryption::None) => "tests/test-configs/valkey/passthrough", (ValkeyTopology::Cluster3, Encryption::None) => { - "tests/test-configs/redis/cluster-hiding" + "tests/test-configs/valkey/cluster-hiding" } - (ValkeyTopology::Single, Encryption::Tls) => "tests/test-configs/redis/tls", - (ValkeyTopology::Cluster3, Encryption::Tls) => "tests/test-configs/redis/cluster-tls", + (ValkeyTopology::Single, Encryption::Tls) => "tests/test-configs/valkey/tls", + (ValkeyTopology::Cluster3, Encryption::Tls) => "tests/test-configs/valkey/cluster-tls", }; let _compose = docker_compose(&format!("{config_dir}/docker-compose.yaml")); let mut profiler = ProfilerRunner::new(self.name(), profiling); @@ -360,12 +360,12 @@ impl Bench for ValkeyBench { let mut config = RedisConfig::from_url(address).unwrap(); if let Encryption::Tls = self.encryption { let private_key = - load_private_key("tests/test-configs/redis/tls/certs/localhost.key").unwrap(); - let certs = load_certs("tests/test-configs/redis/tls/certs/localhost.crt").unwrap(); + load_private_key("tests/test-configs/valkey/tls/certs/localhost.key").unwrap(); + let certs = load_certs("tests/test-configs/valkey/tls/certs/localhost.crt").unwrap(); config.tls = Some( ClientConfig::builder() .with_root_certificates( - load_ca("tests/test-configs/redis/tls/certs/localhost_CA.crt").unwrap(), + load_ca("tests/test-configs/valkey/tls/certs/localhost_CA.crt").unwrap(), ) .with_client_auth_cert(certs, private_key) .unwrap() diff --git a/shotover-proxy/benches/windsock/redis/mod.rs b/shotover-proxy/benches/windsock/valkey/mod.rs similarity index 100% rename from shotover-proxy/benches/windsock/redis/mod.rs rename to shotover-proxy/benches/windsock/valkey/mod.rs diff --git a/shotover-proxy/tests/cassandra_int_tests/mod.rs b/shotover-proxy/tests/cassandra_int_tests/mod.rs index a7170740b..f5198ed7a 100644 --- a/shotover-proxy/tests/cassandra_int_tests/mod.rs +++ b/shotover-proxy/tests/cassandra_int_tests/mod.rs @@ -21,7 +21,7 @@ use test_helpers::connection::cassandra::{ CassandraDriver, CassandraDriver::Cdrs, CassandraDriver::Java, CassandraDriver::Scylla, CqlWsSession, ResultValue, }; -use test_helpers::connection::redis_connection; +use test_helpers::connection::valkey_connection; use test_helpers::docker_compose::docker_compose; #[cfg(feature = "alpha-transforms")] use test_helpers::docker_compose::new_moto; @@ -569,7 +569,7 @@ async fn cassandra_valkey_cache(#[case] driver: CassandraDriver) { .start() .await; - let mut valkey_connection = redis_connection::new(6379); + let mut valkey_connection = valkey_connection::new(6379); let connection_creator = || CassandraConnectionBuilder::new("127.0.0.1", 9042, driver).build(); let connection = connection_creator().await; diff --git a/shotover-proxy/tests/lib.rs b/shotover-proxy/tests/lib.rs index 56d629d5c..b2a366c71 100644 --- a/shotover-proxy/tests/lib.rs +++ b/shotover-proxy/tests/lib.rs @@ -11,11 +11,11 @@ mod kafka_int_tests; #[cfg(all(feature = "alpha-transforms", feature = "opensearch"))] mod opensearch_int_tests; #[cfg(feature = "redis")] -mod redis_int_tests; -#[cfg(feature = "redis")] mod runner; #[cfg(feature = "redis")] mod transforms; +#[cfg(feature = "redis")] +mod valkey_int_tests; pub fn shotover_process(topology_path: &str) -> ShotoverProcessBuilder { ShotoverProcessBuilder::new_with_topology(topology_path) diff --git a/shotover-proxy/tests/runner/observability_int_tests.rs b/shotover-proxy/tests/runner/observability_int_tests.rs index 61a2f41a7..11a0ffb3c 100644 --- a/shotover-proxy/tests/runner/observability_int_tests.rs +++ b/shotover-proxy/tests/runner/observability_int_tests.rs @@ -1,11 +1,11 @@ use crate::shotover_process; -use test_helpers::connection::redis_connection; +use test_helpers::connection::valkey_connection; use test_helpers::docker_compose::docker_compose; use test_helpers::metrics::{assert_metrics_has_keys, assert_metrics_key_value}; #[tokio::test(flavor = "multi_thread")] async fn test_metrics() { - let shotover = shotover_process("tests/test-configs/null-redis/topology.yaml") + let shotover = shotover_process("tests/test-configs/null-valkey/topology.yaml") .start() .await; @@ -95,7 +95,7 @@ shotover_transform_total_count{transform="QueryCounter"} "#; assert_metrics_has_keys("", expected).await; - let mut connection = redis_connection::new_async("127.0.0.1", 6379).await; + let mut connection = valkey_connection::new_async("127.0.0.1", 6379).await; redis::cmd("SET") .arg("the_key") @@ -151,12 +151,12 @@ shotover_query_count{name="valkey-chain",query="SET",type="valkey"} #[tokio::test(flavor = "multi_thread")] async fn test_shotover_with_metrics_disabled() { - let _compose = docker_compose("tests/test-configs/redis/passthrough/docker-compose.yaml"); - let shotover = shotover_process("tests/test-configs/redis/passthrough/topology.yaml") + let _compose = docker_compose("tests/test-configs/valkey/passthrough/docker-compose.yaml"); + let shotover = shotover_process("tests/test-configs/valkey/passthrough/topology.yaml") .with_config("tests/test-configs/shotover-config/config_metrics_disabled.yaml") .start() .await; - let mut connection = redis_connection::new_async("127.0.0.1", 6379).await; + let mut connection = valkey_connection::new_async("127.0.0.1", 6379).await; // Verify Shotover can still process messages with metrics disabled redis::cmd("SET") diff --git a/shotover-proxy/tests/runner/runner_int_tests.rs b/shotover-proxy/tests/runner/runner_int_tests.rs index c439e52cc..bacef3da9 100644 --- a/shotover-proxy/tests/runner/runner_int_tests.rs +++ b/shotover-proxy/tests/runner/runner_int_tests.rs @@ -14,7 +14,7 @@ async fn test_early_shutdown_cassandra_source() { async fn test_shotover_responds_sigterm() { // Ensure it isnt reliant on timing for _ in 0..1000 { - let shotover_process = shotover_process("tests/test-configs/null-redis/topology.yaml") + let shotover_process = shotover_process("tests/test-configs/null-valkey/topology.yaml") .start() .await; shotover_process.send_sigterm(); @@ -31,7 +31,7 @@ async fn test_shotover_responds_sigterm() { #[tokio::test] async fn test_shotover_responds_sigint() { - let shotover_process = shotover_process("tests/test-configs/null-redis/topology.yaml") + let shotover_process = shotover_process("tests/test-configs/null-valkey/topology.yaml") .start() .await; shotover_process.send_sigint(); diff --git a/shotover-proxy/tests/test-configs/null-redis/topology.yaml b/shotover-proxy/tests/test-configs/null-valkey/topology.yaml similarity index 100% rename from shotover-proxy/tests/test-configs/null-redis/topology.yaml rename to shotover-proxy/tests/test-configs/null-valkey/topology.yaml diff --git a/shotover-proxy/tests/test-configs/redis/tls-no-verify-hostname/topology.yaml b/shotover-proxy/tests/test-configs/redis/tls-no-verify-hostname/topology.yaml deleted file mode 100644 index a6c92920f..000000000 --- a/shotover-proxy/tests/test-configs/redis/tls-no-verify-hostname/topology.yaml +++ /dev/null @@ -1,17 +0,0 @@ ---- -sources: - - Valkey: - name: "valkey" - listen_addr: "127.0.0.1:6379" - tls: - certificate_path: "tests/test-configs/redis/tls/certs/localhost.crt" - private_key_path: "tests/test-configs/redis/tls/certs/localhost.key" - chain: - - ValkeySinkSingle: - remote_address: "localhost:1111" - connect_timeout_ms: 3000 - tls: - certificate_authority_path: "tests/test-configs/redis/tls/certs/localhost_CA.crt" - certificate_path: "tests/test-configs/redis/tls/certs/localhost.crt" - private_key_path: "tests/test-configs/redis/tls/certs/localhost.key" - verify_hostname: false diff --git a/shotover-proxy/tests/test-configs/redis/tls/topology-encode.yaml b/shotover-proxy/tests/test-configs/redis/tls/topology-encode.yaml deleted file mode 100644 index 037f7659f..000000000 --- a/shotover-proxy/tests/test-configs/redis/tls/topology-encode.yaml +++ /dev/null @@ -1,20 +0,0 @@ ---- -sources: - - Valkey: - name: "valkey" - listen_addr: "127.0.0.1:6379" - tls: - certificate_path: "tests/test-configs/redis/tls/certs/localhost.crt" - private_key_path: "tests/test-configs/redis/tls/certs/localhost.key" - chain: - - DebugForceEncode: - encode_requests: true - encode_responses: true - - ValkeySinkSingle: - remote_address: "localhost:1111" - connect_timeout_ms: 3000 - tls: - certificate_authority_path: "tests/test-configs/redis/tls/certs/localhost_CA.crt" - certificate_path: "tests/test-configs/redis/tls/certs/localhost.crt" - private_key_path: "tests/test-configs/redis/tls/certs/localhost.key" - verify_hostname: true diff --git a/shotover-proxy/tests/test-configs/redis/tls/topology.yaml b/shotover-proxy/tests/test-configs/redis/tls/topology.yaml deleted file mode 100644 index 93b46d9fe..000000000 --- a/shotover-proxy/tests/test-configs/redis/tls/topology.yaml +++ /dev/null @@ -1,17 +0,0 @@ ---- -sources: - - Valkey: - name: "valkey" - listen_addr: "127.0.0.1:6379" - tls: - certificate_path: "tests/test-configs/redis/tls/certs/localhost.crt" - private_key_path: "tests/test-configs/redis/tls/certs/localhost.key" - chain: - - ValkeySinkSingle: - remote_address: "localhost:1111" - connect_timeout_ms: 3000 - tls: - certificate_authority_path: "tests/test-configs/redis/tls/certs/localhost_CA.crt" - certificate_path: "tests/test-configs/redis/tls/certs/localhost.crt" - private_key_path: "tests/test-configs/redis/tls/certs/localhost.key" - verify_hostname: true diff --git a/shotover-proxy/tests/test-configs/redis/cluster-auth/docker-compose.yaml b/shotover-proxy/tests/test-configs/valkey/cluster-auth/docker-compose.yaml similarity index 100% rename from shotover-proxy/tests/test-configs/redis/cluster-auth/docker-compose.yaml rename to shotover-proxy/tests/test-configs/valkey/cluster-auth/docker-compose.yaml diff --git a/shotover-proxy/tests/test-configs/redis/cluster-auth/topology.yaml b/shotover-proxy/tests/test-configs/valkey/cluster-auth/topology.yaml similarity index 100% rename from shotover-proxy/tests/test-configs/redis/cluster-auth/topology.yaml rename to shotover-proxy/tests/test-configs/valkey/cluster-auth/topology.yaml diff --git a/shotover-proxy/tests/test-configs/redis/cluster-dr/docker-compose.yaml b/shotover-proxy/tests/test-configs/valkey/cluster-dr/docker-compose.yaml similarity index 100% rename from shotover-proxy/tests/test-configs/redis/cluster-dr/docker-compose.yaml rename to shotover-proxy/tests/test-configs/valkey/cluster-dr/docker-compose.yaml diff --git a/shotover-proxy/tests/test-configs/redis/cluster-dr/topology.yaml b/shotover-proxy/tests/test-configs/valkey/cluster-dr/topology.yaml similarity index 100% rename from shotover-proxy/tests/test-configs/redis/cluster-dr/topology.yaml rename to shotover-proxy/tests/test-configs/valkey/cluster-dr/topology.yaml diff --git a/shotover-proxy/tests/test-configs/redis/cluster-handling/docker-compose.yaml b/shotover-proxy/tests/test-configs/valkey/cluster-handling/docker-compose.yaml similarity index 100% rename from shotover-proxy/tests/test-configs/redis/cluster-handling/docker-compose.yaml rename to shotover-proxy/tests/test-configs/valkey/cluster-handling/docker-compose.yaml diff --git a/shotover-proxy/tests/test-configs/redis/cluster-handling/topology.yaml b/shotover-proxy/tests/test-configs/valkey/cluster-handling/topology.yaml similarity index 100% rename from shotover-proxy/tests/test-configs/redis/cluster-handling/topology.yaml rename to shotover-proxy/tests/test-configs/valkey/cluster-handling/topology.yaml diff --git a/shotover-proxy/tests/test-configs/redis/cluster-hiding/docker-compose.yaml b/shotover-proxy/tests/test-configs/valkey/cluster-hiding/docker-compose.yaml similarity index 100% rename from shotover-proxy/tests/test-configs/redis/cluster-hiding/docker-compose.yaml rename to shotover-proxy/tests/test-configs/valkey/cluster-hiding/docker-compose.yaml diff --git a/shotover-proxy/tests/test-configs/redis/cluster-hiding/topology-encode.yaml b/shotover-proxy/tests/test-configs/valkey/cluster-hiding/topology-encode.yaml similarity index 100% rename from shotover-proxy/tests/test-configs/redis/cluster-hiding/topology-encode.yaml rename to shotover-proxy/tests/test-configs/valkey/cluster-hiding/topology-encode.yaml diff --git a/shotover-proxy/tests/test-configs/redis/cluster-hiding/topology.yaml b/shotover-proxy/tests/test-configs/valkey/cluster-hiding/topology.yaml similarity index 100% rename from shotover-proxy/tests/test-configs/redis/cluster-hiding/topology.yaml rename to shotover-proxy/tests/test-configs/valkey/cluster-hiding/topology.yaml diff --git a/shotover-proxy/tests/test-configs/redis/cluster-ports-rewrite/docker-compose.yaml b/shotover-proxy/tests/test-configs/valkey/cluster-ports-rewrite/docker-compose.yaml similarity index 100% rename from shotover-proxy/tests/test-configs/redis/cluster-ports-rewrite/docker-compose.yaml rename to shotover-proxy/tests/test-configs/valkey/cluster-ports-rewrite/docker-compose.yaml diff --git a/shotover-proxy/tests/test-configs/redis/cluster-ports-rewrite/topology.yaml b/shotover-proxy/tests/test-configs/valkey/cluster-ports-rewrite/topology.yaml similarity index 100% rename from shotover-proxy/tests/test-configs/redis/cluster-ports-rewrite/topology.yaml rename to shotover-proxy/tests/test-configs/valkey/cluster-ports-rewrite/topology.yaml diff --git a/shotover-proxy/tests/test-configs/redis/cluster-tls/docker-compose.yaml b/shotover-proxy/tests/test-configs/valkey/cluster-tls/docker-compose.yaml similarity index 80% rename from shotover-proxy/tests/test-configs/redis/cluster-tls/docker-compose.yaml rename to shotover-proxy/tests/test-configs/valkey/cluster-tls/docker-compose.yaml index 0e9f75ecb..d71b835b6 100644 --- a/shotover-proxy/tests/test-configs/redis/cluster-tls/docker-compose.yaml +++ b/shotover-proxy/tests/test-configs/valkey/cluster-tls/docker-compose.yaml @@ -15,16 +15,16 @@ services: ipv4_address: 172.16.1.2 image: &image bitnami/valkey-cluster:7.2.5-debian-12-r4 volumes: - - &keys ../tls/certs:/usr/local/etc/redis/certs + - &keys ../tls/certs:/usr/local/etc/valkey/certs environment: &node_environment - 'ALLOW_EMPTY_PASSWORD=yes' - 'VALKEY_NODES=valkey-node-0 valkey-node-1 valkey-node-2 valkey-node-3 valkey-node-4 valkey-node-5' - 'VALKEY_TLS_PORT=6379' - 'VALKEY_TLS_ENABLED=true' - - 'VALKEY_TLS_CERT_FILE=/usr/local/etc/redis/certs/localhost.crt' - - 'VALKEY_TLS_KEY_FILE=/usr/local/etc/redis/certs/localhost.key' - - 'VALKEY_TLS_CA_FILE=/usr/local/etc/redis/certs/localhost_CA.crt' + - 'VALKEY_TLS_CERT_FILE=/usr/local/etc/valkey/certs/localhost.crt' + - 'VALKEY_TLS_KEY_FILE=/usr/local/etc/valkey/certs/localhost.key' + - 'VALKEY_TLS_CA_FILE=/usr/local/etc/valkey/certs/localhost_CA.crt' - 'VALKEY_TLS_AUTH_CLIENTS=yes' valkey-node-1: @@ -93,6 +93,6 @@ services: - 'VALKEY_NODES=valkey-node-0 valkey-node-1 valkey-node-2 valkey-node-3 valkey-node-4 valkey-node-5' - 'VALKEY_TLS_PORT=6379' - 'VALKEY_TLS_ENABLED=true' - - 'VALKEY_TLS_CERT_FILE=/usr/local/etc/redis/certs/localhost.crt' - - 'VALKEY_TLS_KEY_FILE=/usr/local/etc/redis/certs/localhost.key' - - 'VALKEY_TLS_CA_FILE=/usr/local/etc/redis/certs/localhost_CA.crt' + - 'VALKEY_TLS_CERT_FILE=/usr/local/etc/valkey/certs/localhost.crt' + - 'VALKEY_TLS_KEY_FILE=/usr/local/etc/valkey/certs/localhost.key' + - 'VALKEY_TLS_CA_FILE=/usr/local/etc/valkey/certs/localhost_CA.crt' diff --git a/shotover-proxy/tests/test-configs/redis/cluster-tls/topology-encode.yaml b/shotover-proxy/tests/test-configs/valkey/cluster-tls/topology-encode.yaml similarity index 57% rename from shotover-proxy/tests/test-configs/redis/cluster-tls/topology-encode.yaml rename to shotover-proxy/tests/test-configs/valkey/cluster-tls/topology-encode.yaml index 76c355dbd..d6c6c447b 100644 --- a/shotover-proxy/tests/test-configs/redis/cluster-tls/topology-encode.yaml +++ b/shotover-proxy/tests/test-configs/valkey/cluster-tls/topology-encode.yaml @@ -4,8 +4,8 @@ sources: name: "valkey" listen_addr: "127.0.0.1:6379" tls: - certificate_path: "tests/test-configs/redis/tls/certs/localhost.crt" - private_key_path: "tests/test-configs/redis/tls/certs/localhost.key" + certificate_path: "tests/test-configs/valkey/tls/certs/localhost.crt" + private_key_path: "tests/test-configs/valkey/tls/certs/localhost.key" chain: - DebugForceEncode: encode_requests: true @@ -20,8 +20,8 @@ sources: - "172.16.1.7:6379" connect_timeout_ms: 3000 tls: - certificate_authority_path: "tests/test-configs/redis/tls/certs/localhost_CA.crt" - certificate_path: "tests/test-configs/redis/tls/certs/localhost.crt" - private_key_path: "tests/test-configs/redis/tls/certs/localhost.key" + certificate_authority_path: "tests/test-configs/valkey/tls/certs/localhost_CA.crt" + certificate_path: "tests/test-configs/valkey/tls/certs/localhost.crt" + private_key_path: "tests/test-configs/valkey/tls/certs/localhost.key" verify_hostname: true \ No newline at end of file diff --git a/shotover-proxy/tests/test-configs/redis/cluster-tls/topology-no-source-encryption.yaml b/shotover-proxy/tests/test-configs/valkey/cluster-tls/topology-no-source-encryption.yaml similarity index 63% rename from shotover-proxy/tests/test-configs/redis/cluster-tls/topology-no-source-encryption.yaml rename to shotover-proxy/tests/test-configs/valkey/cluster-tls/topology-no-source-encryption.yaml index c5ce05254..920e03eac 100644 --- a/shotover-proxy/tests/test-configs/redis/cluster-tls/topology-no-source-encryption.yaml +++ b/shotover-proxy/tests/test-configs/valkey/cluster-tls/topology-no-source-encryption.yaml @@ -14,8 +14,8 @@ sources: - "172.16.1.7:6379" connect_timeout_ms: 3000 tls: - certificate_authority_path: "tests/test-configs/redis/tls/certs/localhost_CA.crt" - certificate_path: "tests/test-configs/redis/tls/certs/localhost.crt" - private_key_path: "tests/test-configs/redis/tls/certs/localhost.key" + certificate_authority_path: "tests/test-configs/valkey/tls/certs/localhost_CA.crt" + certificate_path: "tests/test-configs/valkey/tls/certs/localhost.crt" + private_key_path: "tests/test-configs/valkey/tls/certs/localhost.key" verify_hostname: true \ No newline at end of file diff --git a/shotover-proxy/tests/test-configs/redis/cluster-tls/topology.yaml b/shotover-proxy/tests/test-configs/valkey/cluster-tls/topology.yaml similarity index 53% rename from shotover-proxy/tests/test-configs/redis/cluster-tls/topology.yaml rename to shotover-proxy/tests/test-configs/valkey/cluster-tls/topology.yaml index 4c3534742..d4f98b4fc 100644 --- a/shotover-proxy/tests/test-configs/redis/cluster-tls/topology.yaml +++ b/shotover-proxy/tests/test-configs/valkey/cluster-tls/topology.yaml @@ -4,8 +4,8 @@ sources: name: "valkey" listen_addr: "127.0.0.1:6379" tls: - certificate_path: "tests/test-configs/redis/tls/certs/localhost.crt" - private_key_path: "tests/test-configs/redis/tls/certs/localhost.key" + certificate_path: "tests/test-configs/valkey/tls/certs/localhost.crt" + private_key_path: "tests/test-configs/valkey/tls/certs/localhost.key" chain: - ValkeySinkCluster: first_contact_points: @@ -17,8 +17,8 @@ sources: - "172.16.1.7:6379" connect_timeout_ms: 3000 tls: - certificate_authority_path: "tests/test-configs/redis/tls/certs/localhost_CA.crt" - certificate_path: "tests/test-configs/redis/tls/certs/localhost.crt" - private_key_path: "tests/test-configs/redis/tls/certs/localhost.key" + certificate_authority_path: "tests/test-configs/valkey/tls/certs/localhost_CA.crt" + certificate_path: "tests/test-configs/valkey/tls/certs/localhost.crt" + private_key_path: "tests/test-configs/valkey/tls/certs/localhost.key" verify_hostname: true \ No newline at end of file diff --git a/shotover-proxy/tests/test-configs/redis/passthrough/docker-compose.yaml b/shotover-proxy/tests/test-configs/valkey/passthrough/docker-compose.yaml similarity index 100% rename from shotover-proxy/tests/test-configs/redis/passthrough/docker-compose.yaml rename to shotover-proxy/tests/test-configs/valkey/passthrough/docker-compose.yaml diff --git a/shotover-proxy/tests/test-configs/redis/passthrough/redis.conf b/shotover-proxy/tests/test-configs/valkey/passthrough/redis.conf similarity index 100% rename from shotover-proxy/tests/test-configs/redis/passthrough/redis.conf rename to shotover-proxy/tests/test-configs/valkey/passthrough/redis.conf diff --git a/shotover-proxy/tests/test-configs/redis/passthrough/topology-encode.yaml b/shotover-proxy/tests/test-configs/valkey/passthrough/topology-encode.yaml similarity index 100% rename from shotover-proxy/tests/test-configs/redis/passthrough/topology-encode.yaml rename to shotover-proxy/tests/test-configs/valkey/passthrough/topology-encode.yaml diff --git a/shotover-proxy/tests/test-configs/redis/passthrough/topology.yaml b/shotover-proxy/tests/test-configs/valkey/passthrough/topology.yaml similarity index 100% rename from shotover-proxy/tests/test-configs/redis/passthrough/topology.yaml rename to shotover-proxy/tests/test-configs/valkey/passthrough/topology.yaml diff --git a/shotover-proxy/tests/test-configs/redis/tls-no-client-auth/docker-compose.yaml b/shotover-proxy/tests/test-configs/valkey/tls-no-client-auth/docker-compose.yaml similarity index 100% rename from shotover-proxy/tests/test-configs/redis/tls-no-client-auth/docker-compose.yaml rename to shotover-proxy/tests/test-configs/valkey/tls-no-client-auth/docker-compose.yaml diff --git a/shotover-proxy/tests/test-configs/redis/tls-no-client-auth/topology.yaml b/shotover-proxy/tests/test-configs/valkey/tls-no-client-auth/topology.yaml similarity index 51% rename from shotover-proxy/tests/test-configs/redis/tls-no-client-auth/topology.yaml rename to shotover-proxy/tests/test-configs/valkey/tls-no-client-auth/topology.yaml index e56bd01e9..5dba71571 100644 --- a/shotover-proxy/tests/test-configs/redis/tls-no-client-auth/topology.yaml +++ b/shotover-proxy/tests/test-configs/valkey/tls-no-client-auth/topology.yaml @@ -4,12 +4,12 @@ sources: name: "valkey" listen_addr: "127.0.0.1:6379" tls: - certificate_path: "tests/test-configs/redis/tls/certs/localhost.crt" - private_key_path: "tests/test-configs/redis/tls/certs/localhost.key" + certificate_path: "tests/test-configs/valkey/tls/certs/localhost.crt" + private_key_path: "tests/test-configs/valkey/tls/certs/localhost.key" chain: - ValkeySinkSingle: remote_address: "localhost:1111" connect_timeout_ms: 3000 tls: - certificate_authority_path: "tests/test-configs/redis/tls/certs/localhost_CA.crt" + certificate_authority_path: "tests/test-configs/valkey/tls/certs/localhost_CA.crt" verify_hostname: true diff --git a/shotover-proxy/tests/test-configs/redis/tls-no-verify-hostname/docker-compose.yaml b/shotover-proxy/tests/test-configs/valkey/tls-no-verify-hostname/docker-compose.yaml similarity index 100% rename from shotover-proxy/tests/test-configs/redis/tls-no-verify-hostname/docker-compose.yaml rename to shotover-proxy/tests/test-configs/valkey/tls-no-verify-hostname/docker-compose.yaml diff --git a/shotover-proxy/tests/test-configs/valkey/tls-no-verify-hostname/topology.yaml b/shotover-proxy/tests/test-configs/valkey/tls-no-verify-hostname/topology.yaml new file mode 100644 index 000000000..3bdc43486 --- /dev/null +++ b/shotover-proxy/tests/test-configs/valkey/tls-no-verify-hostname/topology.yaml @@ -0,0 +1,17 @@ +--- +sources: + - Valkey: + name: "valkey" + listen_addr: "127.0.0.1:6379" + tls: + certificate_path: "tests/test-configs/valkey/tls/certs/localhost.crt" + private_key_path: "tests/test-configs/valkey/tls/certs/localhost.key" + chain: + - ValkeySinkSingle: + remote_address: "localhost:1111" + connect_timeout_ms: 3000 + tls: + certificate_authority_path: "tests/test-configs/valkey/tls/certs/localhost_CA.crt" + certificate_path: "tests/test-configs/valkey/tls/certs/localhost.crt" + private_key_path: "tests/test-configs/valkey/tls/certs/localhost.key" + verify_hostname: false diff --git a/shotover-proxy/tests/test-configs/redis/tls/docker-compose.yaml b/shotover-proxy/tests/test-configs/valkey/tls/docker-compose.yaml similarity index 100% rename from shotover-proxy/tests/test-configs/redis/tls/docker-compose.yaml rename to shotover-proxy/tests/test-configs/valkey/tls/docker-compose.yaml diff --git a/shotover-proxy/tests/test-configs/redis/tls/redis-cli.sh b/shotover-proxy/tests/test-configs/valkey/tls/redis-cli.sh similarity index 100% rename from shotover-proxy/tests/test-configs/redis/tls/redis-cli.sh rename to shotover-proxy/tests/test-configs/valkey/tls/redis-cli.sh diff --git a/shotover-proxy/tests/test-configs/valkey/tls/topology-encode.yaml b/shotover-proxy/tests/test-configs/valkey/tls/topology-encode.yaml new file mode 100644 index 000000000..ae05a165b --- /dev/null +++ b/shotover-proxy/tests/test-configs/valkey/tls/topology-encode.yaml @@ -0,0 +1,20 @@ +--- +sources: + - Valkey: + name: "valkey" + listen_addr: "127.0.0.1:6379" + tls: + certificate_path: "tests/test-configs/valkey/tls/certs/localhost.crt" + private_key_path: "tests/test-configs/valkey/tls/certs/localhost.key" + chain: + - DebugForceEncode: + encode_requests: true + encode_responses: true + - ValkeySinkSingle: + remote_address: "localhost:1111" + connect_timeout_ms: 3000 + tls: + certificate_authority_path: "tests/test-configs/valkey/tls/certs/localhost_CA.crt" + certificate_path: "tests/test-configs/valkey/tls/certs/localhost.crt" + private_key_path: "tests/test-configs/valkey/tls/certs/localhost.key" + verify_hostname: true diff --git a/shotover-proxy/tests/test-configs/valkey/tls/topology.yaml b/shotover-proxy/tests/test-configs/valkey/tls/topology.yaml new file mode 100644 index 000000000..681e23486 --- /dev/null +++ b/shotover-proxy/tests/test-configs/valkey/tls/topology.yaml @@ -0,0 +1,17 @@ +--- +sources: + - Valkey: + name: "valkey" + listen_addr: "127.0.0.1:6379" + tls: + certificate_path: "tests/test-configs/valkey/tls/certs/localhost.crt" + private_key_path: "tests/test-configs/valkey/tls/certs/localhost.key" + chain: + - ValkeySinkSingle: + remote_address: "localhost:1111" + connect_timeout_ms: 3000 + tls: + certificate_authority_path: "tests/test-configs/valkey/tls/certs/localhost_CA.crt" + certificate_path: "tests/test-configs/valkey/tls/certs/localhost.crt" + private_key_path: "tests/test-configs/valkey/tls/certs/localhost.key" + verify_hostname: true diff --git a/shotover-proxy/tests/transforms/log_to_file.rs b/shotover-proxy/tests/transforms/log_to_file.rs index d6a30e0ae..55cd96085 100644 --- a/shotover-proxy/tests/transforms/log_to_file.rs +++ b/shotover-proxy/tests/transforms/log_to_file.rs @@ -1,7 +1,7 @@ -use crate::redis_int_tests::assert::assert_ok; use crate::shotover_process; +use crate::valkey_int_tests::assert::assert_ok; use pretty_assertions::assert_eq; -use test_helpers::connection::redis_connection; +use test_helpers::connection::valkey_connection; use test_helpers::docker_compose::docker_compose; #[cfg(feature = "alpha-transforms")] @@ -13,7 +13,7 @@ async fn log_to_file() { .await; // CLIENT SETINFO requests sent by driver during connection handshake - let mut connection = redis_connection::new_async("127.0.0.1", 6379).await; + let mut connection = valkey_connection::new_async("127.0.0.1", 6379).await; let request = std::fs::read("message-log/1/requests/message1.bin").unwrap(); assert_eq_string( &request, diff --git a/shotover-proxy/tests/transforms/query_type_filter.rs b/shotover-proxy/tests/transforms/query_type_filter.rs index 4860a2ad9..d6c888dfa 100644 --- a/shotover-proxy/tests/transforms/query_type_filter.rs +++ b/shotover-proxy/tests/transforms/query_type_filter.rs @@ -1,6 +1,6 @@ use crate::shotover_process; use pretty_assertions::assert_eq; -use test_helpers::connection::redis_connection; +use test_helpers::connection::valkey_connection; async fn test_pipeline(connection: &mut redis::aio::Connection) { // using individual queries tests QueryTypeFilter with a MessageWrapper containing a single message at a time. @@ -75,8 +75,8 @@ async fn test_query_type_filter() { .start() .await; - let mut deny_connection = redis_connection::new_async("127.0.0.1", 6379).await; - let mut allow_connection = redis_connection::new_async("127.0.0.1", 6380).await; + let mut deny_connection = valkey_connection::new_async("127.0.0.1", 6379).await; + let mut allow_connection = valkey_connection::new_async("127.0.0.1", 6380).await; test_pipeline(&mut deny_connection).await; test_pipeline(&mut allow_connection).await; diff --git a/shotover-proxy/tests/transforms/tee.rs b/shotover-proxy/tests/transforms/tee.rs index 0f715b0e7..2e911af4f 100644 --- a/shotover-proxy/tests/transforms/tee.rs +++ b/shotover-proxy/tests/transforms/tee.rs @@ -1,6 +1,6 @@ use crate::shotover_process; use pretty_assertions::assert_eq; -use test_helpers::connection::redis_connection; +use test_helpers::connection::valkey_connection; use test_helpers::docker_compose::docker_compose; use test_helpers::shotover_process::{Count, EventMatcher, Level}; @@ -10,7 +10,7 @@ async fn test_ignore_matches() { .start() .await; - let mut connection = redis_connection::new_async("127.0.0.1", 6379).await; + let mut connection = valkey_connection::new_async("127.0.0.1", 6379).await; let result = redis::cmd("SET") .arg("key") @@ -29,7 +29,7 @@ async fn test_ignore_with_mismatch() { .start() .await; - let mut connection = redis_connection::new_async("127.0.0.1", 6379).await; + let mut connection = valkey_connection::new_async("127.0.0.1", 6379).await; let result = redis::cmd("SET") .arg("key") @@ -48,7 +48,7 @@ async fn test_log_matches() { .start() .await; - let mut connection = redis_connection::new_async("127.0.0.1", 6379).await; + let mut connection = valkey_connection::new_async("127.0.0.1", 6379).await; let result = redis::cmd("SET") .arg("key") @@ -67,7 +67,7 @@ async fn test_log_with_mismatch() { .start() .await; - let mut connection = redis_connection::new_async("127.0.0.1", 6379).await; + let mut connection = valkey_connection::new_async("127.0.0.1", 6379).await; let result = redis::cmd("SET") .arg("key") @@ -96,7 +96,7 @@ async fn test_fail_matches() { .start() .await; - let mut connection = redis_connection::new_async("127.0.0.1", 6379).await; + let mut connection = valkey_connection::new_async("127.0.0.1", 6379).await; let result = redis::cmd("SET") .arg("key") @@ -115,7 +115,7 @@ async fn test_fail_with_mismatch() { .start() .await; - let mut connection = redis_connection::new_async("127.0.0.1", 6379).await; + let mut connection = valkey_connection::new_async("127.0.0.1", 6379).await; let err = redis::cmd("SET") .arg("key") @@ -132,13 +132,13 @@ async fn test_fail_with_mismatch() { #[tokio::test(flavor = "multi_thread")] async fn test_subchain_matches() { - let _compose = docker_compose("tests/test-configs/redis/passthrough/docker-compose.yaml"); + let _compose = docker_compose("tests/test-configs/valkey/passthrough/docker-compose.yaml"); let shotover = shotover_process("tests/test-configs/tee/subchain.yaml") .start() .await; - let mut shotover_connection = redis_connection::new_async("127.0.0.1", 6379).await; - let mut mismatch_chain_valkey = redis_connection::new_async("127.0.0.1", 1111).await; + let mut shotover_connection = valkey_connection::new_async("127.0.0.1", 6379).await; + let mut mismatch_chain_valkey = valkey_connection::new_async("127.0.0.1", 1111).await; redis::cmd("SET") .arg("key") .arg("myvalue") @@ -167,13 +167,13 @@ async fn test_subchain_matches() { #[tokio::test(flavor = "multi_thread")] async fn test_subchain_with_mismatch() { - let _compose = docker_compose("tests/test-configs/redis/passthrough/docker-compose.yaml"); + let _compose = docker_compose("tests/test-configs/valkey/passthrough/docker-compose.yaml"); let shotover = shotover_process("tests/test-configs/tee/subchain_with_mismatch.yaml") .start() .await; - let mut shotover_connection = redis_connection::new_async("127.0.0.1", 6379).await; - let mut mismatch_chain_valkey = redis_connection::new_async("127.0.0.1", 1111).await; + let mut shotover_connection = valkey_connection::new_async("127.0.0.1", 6379).await; + let mut mismatch_chain_valkey = valkey_connection::new_async("127.0.0.1", 1111).await; // Set the value on the top level chain valkey let mut result = redis::cmd("SET") @@ -207,7 +207,7 @@ async fn test_switch_main_chain() { let valkey_port = 6370 + i; let switch_port = 1230 + i; - let mut connection = redis_connection::new_async("127.0.0.1", valkey_port).await; + let mut connection = valkey_connection::new_async("127.0.0.1", valkey_port).await; let result = redis::cmd("SET") .arg("key") diff --git a/shotover-proxy/tests/redis_int_tests/assert.rs b/shotover-proxy/tests/valkey_int_tests/assert.rs similarity index 100% rename from shotover-proxy/tests/redis_int_tests/assert.rs rename to shotover-proxy/tests/valkey_int_tests/assert.rs diff --git a/shotover-proxy/tests/redis_int_tests/basic_driver_tests.rs b/shotover-proxy/tests/valkey_int_tests/basic_driver_tests.rs similarity index 97% rename from shotover-proxy/tests/redis_int_tests/basic_driver_tests.rs rename to shotover-proxy/tests/valkey_int_tests/basic_driver_tests.rs index 1286d5d34..980fd9041 100644 --- a/shotover-proxy/tests/redis_int_tests/basic_driver_tests.rs +++ b/shotover-proxy/tests/valkey_int_tests/basic_driver_tests.rs @@ -1,4 +1,4 @@ -use crate::redis_int_tests::assert::*; +use crate::valkey_int_tests::assert::*; use crate::CONNECTION_REFUSED_OS_ERROR; use bytes::BytesMut; use fred::clients::RedisClient; @@ -15,7 +15,7 @@ use shotover::tcp; use std::collections::{HashMap, HashSet}; use std::thread::sleep; use std::time::Duration; -use test_helpers::connection::redis_connection; +use test_helpers::connection::valkey_connection; use tokio::io::{AsyncReadExt, AsyncWriteExt}; use tokio::net::TcpStream; @@ -1218,16 +1218,16 @@ pub async fn test_cluster_replication( // This test case is picky about the ordering of connection auth so we make all the connections ourselves pub async fn test_dr_auth() { // setup 3 different connections in different states - let mut connection_shotover_noauth = redis_connection::new_async("127.0.0.1", 6379).await; + let mut connection_shotover_noauth = valkey_connection::new_async("127.0.0.1", 6379).await; - let mut connection_shotover_auth = redis_connection::new_async("127.0.0.1", 6379).await; + let mut connection_shotover_auth = valkey_connection::new_async("127.0.0.1", 6379).await; assert_ok( redis::cmd("AUTH").arg("default").arg("shotover"), &mut connection_shotover_auth, ) .await; - let mut connection_dr_auth = redis_connection::new_async("127.0.0.1", 2120).await; + let mut connection_dr_auth = valkey_connection::new_async("127.0.0.1", 2120).await; assert_ok( redis::cmd("AUTH").arg("default").arg("shotover"), &mut connection_dr_auth, @@ -1640,14 +1640,14 @@ impl Flusher { Flusher { connections: vec![ // shotover - shotover might have internal handling for flush that we want to run - redis_connection::new_async("127.0.0.1", 6379).await, + valkey_connection::new_async("127.0.0.1", 6379).await, // valkey cluster instances - shotover may or may not run flush on all cluster instances - redis_connection::new_async("172.16.1.2", 6379).await, - redis_connection::new_async("172.16.1.3", 6379).await, - redis_connection::new_async("172.16.1.4", 6379).await, - redis_connection::new_async("172.16.1.5", 6379).await, - redis_connection::new_async("172.16.1.6", 6379).await, - redis_connection::new_async("172.16.1.7", 6379).await, + valkey_connection::new_async("172.16.1.2", 6379).await, + valkey_connection::new_async("172.16.1.3", 6379).await, + valkey_connection::new_async("172.16.1.4", 6379).await, + valkey_connection::new_async("172.16.1.5", 6379).await, + valkey_connection::new_async("172.16.1.6", 6379).await, + valkey_connection::new_async("172.16.1.7", 6379).await, ], } } @@ -1656,14 +1656,14 @@ impl Flusher { Flusher { connections: vec![ // shotover - shotover might have internal handling for flush that we want to run - redis_connection::new_async("127.0.0.1", 6379).await, + valkey_connection::new_async("127.0.0.1", 6379).await, // valkey cluster instances - shotover may or may not run flush on all cluster instances - redis_connection::new_async_tls("172.16.1.2", 6379).await, - redis_connection::new_async_tls("172.16.1.3", 6379).await, - redis_connection::new_async_tls("172.16.1.4", 6379).await, - redis_connection::new_async_tls("172.16.1.5", 6379).await, - redis_connection::new_async_tls("172.16.1.6", 6379).await, - redis_connection::new_async_tls("172.16.1.7", 6379).await, + valkey_connection::new_async_tls("172.16.1.2", 6379).await, + valkey_connection::new_async_tls("172.16.1.3", 6379).await, + valkey_connection::new_async_tls("172.16.1.4", 6379).await, + valkey_connection::new_async_tls("172.16.1.5", 6379).await, + valkey_connection::new_async_tls("172.16.1.6", 6379).await, + valkey_connection::new_async_tls("172.16.1.7", 6379).await, ], } } diff --git a/shotover-proxy/tests/redis_int_tests/mod.rs b/shotover-proxy/tests/valkey_int_tests/mod.rs similarity index 71% rename from shotover-proxy/tests/redis_int_tests/mod.rs rename to shotover-proxy/tests/valkey_int_tests/mod.rs index 9c4beca83..a4eaaa0a7 100644 --- a/shotover-proxy/tests/redis_int_tests/mod.rs +++ b/shotover-proxy/tests/valkey_int_tests/mod.rs @@ -10,7 +10,7 @@ use redis::Commands; use std::path::Path; use std::thread::sleep; use std::time::Duration; -use test_helpers::connection::redis_connection; +use test_helpers::connection::valkey_connection; use test_helpers::docker_compose::docker_compose; use test_helpers::metrics::assert_metrics_key_value; use test_helpers::shotover_process::{Count, EventMatcher, Level}; @@ -32,13 +32,13 @@ Caused by: #[tokio::test(flavor = "multi_thread")] async fn passthrough_standard() { - let _compose = docker_compose("tests/test-configs/redis/passthrough/docker-compose.yaml"); - let shotover = shotover_process("tests/test-configs/redis/passthrough/topology.yaml") + let _compose = docker_compose("tests/test-configs/valkey/passthrough/docker-compose.yaml"); + let shotover = shotover_process("tests/test-configs/valkey/passthrough/topology.yaml") .start() .await; - let connection = || redis_connection::new_async("127.0.0.1", 6379); + let connection = || valkey_connection::new_async("127.0.0.1", 6379); let mut flusher = - Flusher::new_single_connection(redis_connection::new_async("127.0.0.1", 6379).await).await; + Flusher::new_single_connection(valkey_connection::new_async("127.0.0.1", 6379).await).await; run_all(&connection, &mut flusher).await; test_invalid_frame().await; @@ -51,7 +51,7 @@ async fn passthrough_standard() { #[tokio::test(flavor = "multi_thread")] async fn passthrough_redis_down() { - let shotover = shotover_process("tests/test-configs/redis/passthrough/topology.yaml") + let shotover = shotover_process("tests/test-configs/valkey/passthrough/topology.yaml") .start() .await; let client = RedisClient::new(RedisConfig::default(), None, None, None); @@ -105,13 +105,14 @@ Caused by: async fn tls_cluster_sink() { test_helpers::cert::generate_valkey_test_certs(); - let _compose = docker_compose("tests/test-configs/redis/cluster-tls/docker-compose.yaml"); - let shotover = - shotover_process("tests/test-configs/redis/cluster-tls/topology-no-source-encryption.yaml") - .start() - .await; + let _compose = docker_compose("tests/test-configs/valkey/cluster-tls/docker-compose.yaml"); + let shotover = shotover_process( + "tests/test-configs/valkey/cluster-tls/topology-no-source-encryption.yaml", + ) + .start() + .await; - let mut connection = redis_connection::new_async("127.0.0.1", 6379).await; + let mut connection = valkey_connection::new_async("127.0.0.1", 6379).await; let mut flusher = Flusher::new_cluster_tls().await; run_all_cluster_hiding(&mut connection, &mut flusher).await; @@ -125,14 +126,14 @@ async fn tls_source_and_tls_single_sink() { test_helpers::cert::generate_valkey_test_certs(); { - let _compose = docker_compose("tests/test-configs/redis/tls/docker-compose.yaml"); - let shotover = shotover_process("tests/test-configs/redis/tls/topology.yaml") + let _compose = docker_compose("tests/test-configs/valkey/tls/docker-compose.yaml"); + let shotover = shotover_process("tests/test-configs/valkey/tls/topology.yaml") .start() .await; - let connection = || redis_connection::new_async_tls("127.0.0.1", 6379); + let connection = || valkey_connection::new_async_tls("127.0.0.1", 6379); let mut flusher = Flusher::new_single_connection( - redis_connection::new_async_tls("127.0.0.1", 6379).await, + valkey_connection::new_async_tls("127.0.0.1", 6379).await, ) .await; @@ -144,30 +145,30 @@ async fn tls_source_and_tls_single_sink() { // Quick test to verify client authentication disabling works { let _compose = - docker_compose("tests/test-configs/redis/tls-no-client-auth/docker-compose.yaml"); + docker_compose("tests/test-configs/valkey/tls-no-client-auth/docker-compose.yaml"); let shotover = - shotover_process("tests/test-configs/redis/tls-no-client-auth/topology.yaml") + shotover_process("tests/test-configs/valkey/tls-no-client-auth/topology.yaml") .start() .await; - let mut connection = redis_connection::new_async_tls("127.0.0.1", 6379).await; + let mut connection = valkey_connection::new_async_tls("127.0.0.1", 6379).await; test_cluster_basics(&mut connection).await; shotover.shutdown_and_then_consume_events(&[]).await; } // Quick test to verify `verify-hostname: false` works test_helpers::cert::generate_test_certs_with_bad_san(Path::new( - "tests/test-configs/redis/tls/certs", + "tests/test-configs/valkey/tls/certs", )); { let _compose = - docker_compose("tests/test-configs/redis/tls-no-verify-hostname/docker-compose.yaml"); + docker_compose("tests/test-configs/valkey/tls-no-verify-hostname/docker-compose.yaml"); let shotover = - shotover_process("tests/test-configs/redis/tls-no-verify-hostname/topology.yaml") + shotover_process("tests/test-configs/valkey/tls-no-verify-hostname/topology.yaml") .start() .await; - let mut connection = redis_connection::new_async_tls("127.0.0.1", 6379).await; + let mut connection = valkey_connection::new_async_tls("127.0.0.1", 6379).await; test_cluster_basics(&mut connection).await; shotover.shutdown_and_then_consume_events(&[]).await; } @@ -176,14 +177,15 @@ async fn tls_source_and_tls_single_sink() { #[tokio::test(flavor = "multi_thread")] async fn cluster_ports_rewrite() { let _compose = - docker_compose("tests/test-configs/redis/cluster-ports-rewrite/docker-compose.yaml"); - let shotover = shotover_process("tests/test-configs/redis/cluster-ports-rewrite/topology.yaml") - .start() - .await; + docker_compose("tests/test-configs/valkey/cluster-ports-rewrite/docker-compose.yaml"); + let shotover = + shotover_process("tests/test-configs/valkey/cluster-ports-rewrite/topology.yaml") + .start() + .await; - let mut connection = redis_connection::new_async("127.0.0.1", 6380).await; + let mut connection = valkey_connection::new_async("127.0.0.1", 6380).await; let mut flusher = - Flusher::new_single_connection(redis_connection::new_async("127.0.0.1", 6380).await).await; + Flusher::new_single_connection(valkey_connection::new_async("127.0.0.1", 6380).await).await; run_all_cluster_hiding(&mut connection, &mut flusher).await; @@ -195,14 +197,14 @@ async fn cluster_ports_rewrite() { #[tokio::test(flavor = "multi_thread")] async fn cluster_auth() { - let _compose = docker_compose("tests/test-configs/redis/cluster-auth/docker-compose.yaml"); - let shotover = shotover_process("tests/test-configs/redis/cluster-auth/topology.yaml") + let _compose = docker_compose("tests/test-configs/valkey/cluster-auth/docker-compose.yaml"); + let shotover = shotover_process("tests/test-configs/valkey/cluster-auth/topology.yaml") .start() .await; - let mut connection = redis_connection::new_async("127.0.0.1", 6379).await; + let mut connection = valkey_connection::new_async("127.0.0.1", 6379).await; test_auth(&mut connection).await; - let connection = || redis_connection::new_async("127.0.0.1", 6379); + let connection = || valkey_connection::new_async("127.0.0.1", 6379); test_auth_isolation(&connection).await; shotover.shutdown_and_then_consume_events(&[]).await; @@ -210,12 +212,12 @@ async fn cluster_auth() { #[tokio::test(flavor = "multi_thread")] async fn cluster_hiding() { - let _compose = docker_compose("tests/test-configs/redis/cluster-hiding/docker-compose.yaml"); - let shotover = shotover_process("tests/test-configs/redis/cluster-hiding/topology.yaml") + let _compose = docker_compose("tests/test-configs/valkey/cluster-hiding/docker-compose.yaml"); + let shotover = shotover_process("tests/test-configs/valkey/cluster-hiding/topology.yaml") .start() .await; - let mut connection = redis_connection::new_async("127.0.0.1", 6379).await; + let mut connection = valkey_connection::new_async("127.0.0.1", 6379).await; let connection = &mut connection; let mut flusher = Flusher::new_cluster().await; @@ -228,12 +230,12 @@ async fn cluster_hiding() { #[tokio::test(flavor = "multi_thread")] async fn cluster_handling() { - let _compose = docker_compose("tests/test-configs/redis/cluster-handling/docker-compose.yaml"); - let shotover = shotover_process("tests/test-configs/redis/cluster-handling/topology.yaml") + let _compose = docker_compose("tests/test-configs/valkey/cluster-handling/docker-compose.yaml"); + let shotover = shotover_process("tests/test-configs/valkey/cluster-handling/topology.yaml") .start() .await; - let mut connection = redis_connection::new_async("127.0.0.1", 6379).await; + let mut connection = valkey_connection::new_async("127.0.0.1", 6379).await; let connection = &mut connection; let mut flusher = Flusher::new_cluster().await; @@ -247,7 +249,7 @@ async fn cluster_handling() { #[tokio::test(flavor = "multi_thread")] async fn cluster_dr() { - let _compose = docker_compose("tests/test-configs/redis/cluster-dr/docker-compose.yaml"); + let _compose = docker_compose("tests/test-configs/valkey/cluster-dr/docker-compose.yaml"); let nodes = vec![ "redis://127.0.0.1:2120/", @@ -265,10 +267,10 @@ async fn cluster_dr() { // test coalesce sends messages on shotover shutdown { - let shotover = shotover_process("tests/test-configs/redis/cluster-dr/topology.yaml") + let shotover = shotover_process("tests/test-configs/valkey/cluster-dr/topology.yaml") .start() .await; - let mut connection = redis_connection::new_async("127.0.0.1", 6379).await; + let mut connection = valkey_connection::new_async("127.0.0.1", 6379).await; redis::cmd("AUTH") .arg("default") .arg("shotover") @@ -299,12 +301,12 @@ async fn cluster_dr() { 358 ); - let shotover = shotover_process("tests/test-configs/redis/cluster-dr/topology.yaml") + let shotover = shotover_process("tests/test-configs/valkey/cluster-dr/topology.yaml") .start() .await; async fn new_connection() -> Connection { - let mut connection = redis_connection::new_async("127.0.0.1", 6379).await; + let mut connection = valkey_connection::new_async("127.0.0.1", 6379).await; redis::cmd("AUTH") .arg("default") @@ -326,10 +328,10 @@ async fn cluster_dr() { } pub async fn assert_failed_requests_metric_is_incremented_on_error_response() { - let shotover = shotover_process("tests/test-configs/redis/passthrough/topology.yaml") + let shotover = shotover_process("tests/test-configs/valkey/passthrough/topology.yaml") .start() .await; - let mut connection = redis_connection::new_async("127.0.0.1", 6379).await; + let mut connection = valkey_connection::new_async("127.0.0.1", 6379).await; redis::cmd("INVALID_COMMAND") .arg("foo") diff --git a/shotover/benches/benches/chain.rs b/shotover/benches/benches/chain.rs index 28817e460..6f134cafc 100644 --- a/shotover/benches/benches/chain.rs +++ b/shotover/benches/benches/chain.rs @@ -17,8 +17,8 @@ use shotover::transforms::null::NullSink; #[cfg(feature = "alpha-transforms")] use shotover::transforms::protect::{KeyManagerConfig, ProtectConfig}; use shotover::transforms::query_counter::QueryCounter; -use shotover::transforms::redis::cluster_ports_rewrite::ValkeyClusterPortsRewrite; use shotover::transforms::throttling::RequestThrottlingConfig; +use shotover::transforms::valkey::cluster_ports_rewrite::ValkeyClusterPortsRewrite; use shotover::transforms::{ ChainState, TransformConfig, TransformContextBuilder, TransformContextConfig, }; diff --git a/shotover/src/codec/mod.rs b/shotover/src/codec/mod.rs index e17024984..b5815eff5 100644 --- a/shotover/src/codec/mod.rs +++ b/shotover/src/codec/mod.rs @@ -16,7 +16,7 @@ pub mod kafka; #[cfg(feature = "opensearch")] pub mod opensearch; #[cfg(feature = "redis")] -pub mod redis; +pub mod valkey; #[derive(Eq, PartialEq, Copy, Clone)] pub enum Direction { diff --git a/shotover/src/codec/redis.rs b/shotover/src/codec/valkey.rs similarity index 99% rename from shotover/src/codec/redis.rs rename to shotover/src/codec/valkey.rs index 3b81d2e3a..0c36a4472 100644 --- a/shotover/src/codec/redis.rs +++ b/shotover/src/codec/valkey.rs @@ -259,7 +259,7 @@ impl Encoder for ValkeyEncoder { #[cfg(test)] mod valkey_tests { - use crate::codec::{redis::ValkeyCodecBuilder, CodecBuilder, Direction}; + use crate::codec::{valkey::ValkeyCodecBuilder, CodecBuilder, Direction}; use bytes::BytesMut; use hex_literal::hex; use pretty_assertions::assert_eq; diff --git a/shotover/src/config/topology.rs b/shotover/src/config/topology.rs index fffb80be8..0bc198206 100644 --- a/shotover/src/config/topology.rs +++ b/shotover/src/config/topology.rs @@ -87,9 +87,9 @@ mod topology_tests { use crate::transforms::null::NullSinkConfig; use crate::transforms::TransformConfig; use crate::{ - sources::{redis::ValkeyConfig, Source, SourceConfig}, + sources::{valkey::ValkeyConfig, Source, SourceConfig}, transforms::{ - parallel_map::ParallelMapConfig, redis::cache::ValkeyConfig as ValkeyCacheConfig, + parallel_map::ParallelMapConfig, valkey::cache::ValkeyConfig as ValkeyCacheConfig, }, }; use pretty_assertions::assert_eq; diff --git a/shotover/src/frame/mod.rs b/shotover/src/frame/mod.rs index 67335d838..446ad516d 100644 --- a/shotover/src/frame/mod.rs +++ b/shotover/src/frame/mod.rs @@ -24,7 +24,7 @@ pub mod kafka; #[cfg(feature = "opensearch")] pub mod opensearch; #[cfg(feature = "redis")] -pub mod redis; +pub mod valkey; pub mod value; #[derive(PartialEq, Debug, Clone, Copy)] diff --git a/shotover/src/frame/redis.rs b/shotover/src/frame/valkey.rs similarity index 100% rename from shotover/src/frame/redis.rs rename to shotover/src/frame/valkey.rs diff --git a/shotover/src/frame/value.rs b/shotover/src/frame/value.rs index 60fa10e98..e7e942781 100644 --- a/shotover/src/frame/value.rs +++ b/shotover/src/frame/value.rs @@ -2,7 +2,7 @@ #[cfg(feature = "cassandra")] pub mod cassandra; #[cfg(feature = "redis")] -mod redis; +mod valkey; use bigdecimal::BigDecimal; use bytes::Bytes; diff --git a/shotover/src/frame/value/redis.rs b/shotover/src/frame/value/valkey.rs similarity index 100% rename from shotover/src/frame/value/redis.rs rename to shotover/src/frame/value/valkey.rs diff --git a/shotover/src/message/mod.rs b/shotover/src/message/mod.rs index 587113d2c..63eeed8a6 100644 --- a/shotover/src/message/mod.rs +++ b/shotover/src/message/mod.rs @@ -4,7 +4,7 @@ use crate::codec::CodecState; #[cfg(feature = "cassandra")] use crate::frame::{cassandra, cassandra::CassandraMetadata}; #[cfg(feature = "redis")] -use crate::frame::{redis::valkey_query_type, ValkeyFrame}; +use crate::frame::{valkey::valkey_query_type, ValkeyFrame}; use crate::frame::{Frame, MessageType}; use anyhow::{anyhow, Context, Result}; use bytes::Bytes; diff --git a/shotover/src/sources/mod.rs b/shotover/src/sources/mod.rs index b27f92933..05501d1ae 100644 --- a/shotover/src/sources/mod.rs +++ b/shotover/src/sources/mod.rs @@ -7,7 +7,7 @@ use crate::sources::kafka::{KafkaConfig, KafkaSource}; #[cfg(feature = "opensearch")] use crate::sources::opensearch::{OpenSearchConfig, OpenSearchSource}; #[cfg(feature = "redis")] -use crate::sources::redis::{ValkeyConfig, ValkeySource}; +use crate::sources::valkey::{ValkeyConfig, ValkeySource}; use anyhow::Result; use serde::{Deserialize, Serialize}; use tokio::sync::watch; @@ -20,7 +20,7 @@ pub mod kafka; #[cfg(feature = "opensearch")] pub mod opensearch; #[cfg(feature = "redis")] -pub mod redis; +pub mod valkey; #[derive(Serialize, Deserialize, Debug, Clone, Copy)] #[serde(deny_unknown_fields)] diff --git a/shotover/src/sources/redis.rs b/shotover/src/sources/valkey.rs similarity index 97% rename from shotover/src/sources/redis.rs rename to shotover/src/sources/valkey.rs index 90bc47765..380b7674c 100644 --- a/shotover/src/sources/redis.rs +++ b/shotover/src/sources/valkey.rs @@ -1,4 +1,4 @@ -use crate::codec::{redis::ValkeyCodecBuilder, CodecBuilder, Direction}; +use crate::codec::{valkey::ValkeyCodecBuilder, CodecBuilder, Direction}; use crate::config::chain::TransformChainConfig; use crate::server::TcpCodecListener; use crate::sources::{Source, Transport}; diff --git a/shotover/src/transforms/mod.rs b/shotover/src/transforms/mod.rs index 60ee70835..efbc0f991 100644 --- a/shotover/src/transforms/mod.rs +++ b/shotover/src/transforms/mod.rs @@ -31,12 +31,12 @@ pub mod parallel_map; #[cfg(all(feature = "alpha-transforms", feature = "cassandra"))] pub mod protect; pub mod query_counter; -#[cfg(feature = "redis")] -pub mod redis; pub mod tee; #[cfg(feature = "cassandra")] pub mod throttling; pub mod util; +#[cfg(feature = "redis")] +pub mod valkey; /// Provides extra context that may be needed when creating a Transform #[derive(Clone, Debug)] diff --git a/shotover/src/transforms/query_counter.rs b/shotover/src/transforms/query_counter.rs index 229f56636..9b20bee51 100644 --- a/shotover/src/transforms/query_counter.rs +++ b/shotover/src/transforms/query_counter.rs @@ -78,7 +78,7 @@ impl Transform for QueryCounter { } #[cfg(feature = "redis")] Some(Frame::Valkey(frame)) => { - if let Some(query_type) = crate::frame::redis::valkey_query_name(frame) { + if let Some(query_type) = crate::frame::valkey::valkey_query_name(frame) { self.increment_counter(query_type, "valkey"); } else { self.increment_counter("unknown".to_string(), "valkey"); diff --git a/shotover/src/transforms/util/cluster_connection_pool.rs b/shotover/src/transforms/util/cluster_connection_pool.rs index d4c71cfbd..95bf61dcc 100644 --- a/shotover/src/transforms/util/cluster_connection_pool.rs +++ b/shotover/src/transforms/util/cluster_connection_pool.rs @@ -308,7 +308,7 @@ async fn rx_process( #[cfg(all(test, feature = "redis"))] mod test { use super::spawn_read_write_tasks; - use crate::codec::redis::ValkeyCodecBuilder; + use crate::codec::valkey::ValkeyCodecBuilder; use crate::codec::{CodecBuilder, Direction}; use std::mem; use std::time::Duration; diff --git a/shotover/src/transforms/redis/cache.rs b/shotover/src/transforms/valkey/cache.rs similarity index 99% rename from shotover/src/transforms/redis/cache.rs rename to shotover/src/transforms/valkey/cache.rs index f7d9102eb..9a509dfba 100644 --- a/shotover/src/transforms/redis/cache.rs +++ b/shotover/src/transforms/valkey/cache.rs @@ -652,7 +652,7 @@ mod test { use crate::transforms::chain::TransformChainBuilder; use crate::transforms::debug::printer::DebugPrinter; use crate::transforms::null::NullSink; - use crate::transforms::redis::cache::{ + use crate::transforms::valkey::cache::{ build_valkey_key_from_cql3, HashAddress, SimpleValkeyCacheBuilder, TableCacheSchema, }; use crate::transforms::TransformBuilder; diff --git a/shotover/src/transforms/redis/cluster_ports_rewrite.rs b/shotover/src/transforms/valkey/cluster_ports_rewrite.rs similarity index 99% rename from shotover/src/transforms/redis/cluster_ports_rewrite.rs rename to shotover/src/transforms/valkey/cluster_ports_rewrite.rs index 3090caf4b..048849a6e 100644 --- a/shotover/src/transforms/redis/cluster_ports_rewrite.rs +++ b/shotover/src/transforms/valkey/cluster_ports_rewrite.rs @@ -255,9 +255,9 @@ fn is_cluster_slots(frame: &Frame) -> bool { #[cfg(test)] mod test { use super::*; - use crate::codec::redis::ValkeyDecoder; + use crate::codec::valkey::ValkeyDecoder; use crate::codec::Direction; - use crate::transforms::redis::sink_cluster::parse_slots; + use crate::transforms::valkey::sink_cluster::parse_slots; use pretty_assertions::assert_eq; use tokio_util::codec::Decoder; diff --git a/shotover/src/transforms/redis/mod.rs b/shotover/src/transforms/valkey/mod.rs similarity index 100% rename from shotover/src/transforms/redis/mod.rs rename to shotover/src/transforms/valkey/mod.rs diff --git a/shotover/src/transforms/redis/sink_cluster.rs b/shotover/src/transforms/valkey/sink_cluster.rs similarity index 99% rename from shotover/src/transforms/redis/sink_cluster.rs rename to shotover/src/transforms/valkey/sink_cluster.rs index f7e6e90c5..fc7313834 100644 --- a/shotover/src/transforms/redis/sink_cluster.rs +++ b/shotover/src/transforms/valkey/sink_cluster.rs @@ -1,12 +1,12 @@ -use crate::codec::redis::ValkeyCodecBuilder; +use crate::codec::valkey::ValkeyCodecBuilder; use crate::codec::{CodecBuilder, Direction}; use crate::frame::{Frame, MessageType, ValkeyFrame}; use crate::message::{Message, Messages}; use crate::tls::TlsConnectorConfig; -use crate::transforms::redis::TransformError; -use crate::transforms::redis::ValkeyError; use crate::transforms::util::cluster_connection_pool::{Authenticator, ConnectionPool}; use crate::transforms::util::{Request, Response}; +use crate::transforms::valkey::TransformError; +use crate::transforms::valkey::ValkeyError; use crate::transforms::{ ChainState, DownChainProtocol, ResponseFuture, Transform, TransformBuilder, TransformConfig, TransformContextBuilder, TransformContextConfig, UpChainProtocol, @@ -1197,7 +1197,7 @@ impl Authenticator for ValkeyAuthenticator { #[cfg(test)] mod test { use super::*; - use crate::codec::redis::ValkeyDecoder; + use crate::codec::valkey::ValkeyDecoder; use crate::codec::Direction; use pretty_assertions::assert_eq; use tokio_util::codec::Decoder; diff --git a/shotover/src/transforms/redis/sink_single.rs b/shotover/src/transforms/valkey/sink_single.rs similarity index 98% rename from shotover/src/transforms/redis/sink_single.rs rename to shotover/src/transforms/valkey/sink_single.rs index 640dc690f..53374ba45 100644 --- a/shotover/src/transforms/redis/sink_single.rs +++ b/shotover/src/transforms/valkey/sink_single.rs @@ -7,7 +7,7 @@ use crate::transforms::{ ChainState, DownChainProtocol, Transform, TransformBuilder, TransformConfig, TransformContextBuilder, UpChainProtocol, }; -use crate::{codec::redis::ValkeyCodecBuilder, transforms::TransformContextConfig}; +use crate::{codec::valkey::ValkeyCodecBuilder, transforms::TransformContextConfig}; use anyhow::Result; use async_trait::async_trait; use metrics::{counter, Counter}; diff --git a/shotover/src/transforms/redis/timestamp_tagging.rs b/shotover/src/transforms/valkey/timestamp_tagging.rs similarity index 100% rename from shotover/src/transforms/redis/timestamp_tagging.rs rename to shotover/src/transforms/valkey/timestamp_tagging.rs diff --git a/test-helpers/src/cert.rs b/test-helpers/src/cert.rs index 3cdd2f739..407c52f51 100644 --- a/test-helpers/src/cert.rs +++ b/test-helpers/src/cert.rs @@ -99,7 +99,7 @@ pub fn generate_cassandra_test_certs() { } pub fn generate_valkey_test_certs() { - generate_test_certs(Path::new("tests/test-configs/redis/tls/certs")); + generate_test_certs(Path::new("tests/test-configs/valkey/tls/certs")); } pub fn generate_kafka_test_certs() { diff --git a/test-helpers/src/connection/mod.rs b/test-helpers/src/connection/mod.rs index 85b814d84..84126763e 100644 --- a/test-helpers/src/connection/mod.rs +++ b/test-helpers/src/connection/mod.rs @@ -3,4 +3,4 @@ pub mod cassandra; pub(crate) mod java; pub mod kafka; // redis_connection is named differently to the cassandra module because it contains raw functions instead of a struct with methods -pub mod redis_connection; +pub mod valkey_connection; diff --git a/test-helpers/src/connection/redis_connection.rs b/test-helpers/src/connection/valkey_connection.rs similarity index 90% rename from test-helpers/src/connection/redis_connection.rs rename to test-helpers/src/connection/valkey_connection.rs index 84cd7d2c6..9ca4f9c49 100644 --- a/test-helpers/src/connection/redis_connection.rs +++ b/test-helpers/src/connection/valkey_connection.rs @@ -32,9 +32,9 @@ pub async fn new_async(address: &str, port: u16) -> redis::aio::Connection { } pub async fn new_async_tls(address: &str, port: u16) -> redis::aio::Connection { - let certificate_authority_path = "tests/test-configs/redis/tls/certs/localhost_CA.crt"; - let certificate_path = "tests/test-configs/redis/tls/certs/localhost.crt"; - let private_key_path = "tests/test-configs/redis/tls/certs/localhost.key"; + let certificate_authority_path = "tests/test-configs/valkey/tls/certs/localhost_CA.crt"; + let certificate_path = "tests/test-configs/valkey/tls/certs/localhost.crt"; + let private_key_path = "tests/test-configs/valkey/tls/certs/localhost.key"; let mut builder = SslConnector::builder(SslMethod::tls()).unwrap(); builder.set_ca_file(certificate_authority_path).unwrap();