Skip to content

Commit

Permalink
test configs folder cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
conorbros committed Aug 23, 2023
1 parent 10052e0 commit eb342b6
Show file tree
Hide file tree
Showing 88 changed files with 219 additions and 163 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
.idea/
*.gz
/.vscode
/shotover-proxy/tests/test-configs/redis-tls/certs
/shotover-proxy/tests/test-configs/cassandra-tls/certs
/shotover-proxy/tests/test-configs/redis/tls/certs
/shotover-proxy/tests/test-configs/cassandra/tls/certs
.workspace.code-workspace
**/.DS_Store
/.project
Expand Down
4 changes: 2 additions & 2 deletions shotover-proxy/benches/windsock/cassandra.rs
Original file line number Diff line number Diff line change
Expand Up @@ -531,8 +531,8 @@ impl Bench for CassandraBench {
(_, Shotover::ForcedMessageParsed) => todo!(),
};
let config_dir = match &self.topology {
Topology::Single => "tests/test-configs/cassandra-passthrough",
Topology::Cluster3 => "tests/test-configs/cassandra-cluster-v4",
Topology::Single => "tests/test-configs/cassandra/passthrough",
Topology::Cluster3 => "tests/test-configs/cassandra/cluster-v4",
};

let _db_instance = match (&self.db, &self.topology) {
Expand Down
14 changes: 7 additions & 7 deletions shotover-proxy/benches/windsock/redis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,12 +194,12 @@ impl Bench for RedisBench {
) => "redis://127.0.0.1:6379",
};
let config_dir = match (self.topology, self.encryption) {
(RedisTopology::Single, Encryption::None) => "tests/test-configs/redis-passthrough",
(RedisTopology::Single, Encryption::None) => "tests/test-configs/redis/passthrough",
(RedisTopology::Cluster3, Encryption::None) => {
"tests/test-configs/redis-cluster-hiding"
"tests/test-configs/redis/cluster-hiding"
}
(RedisTopology::Single, Encryption::Tls) => "tests/test-configs/redis-tls",
(RedisTopology::Cluster3, Encryption::Tls) => "tests/test-configs/redis-cluster-tls",
(RedisTopology::Single, Encryption::Tls) => "tests/test-configs/redis/tls",
(RedisTopology::Cluster3, Encryption::Tls) => "tests/test-configs/redis/cluster-tls",
};
let _compose = docker_compose(&format!("{config_dir}/docker-compose.yaml"));
let mut profiler = ProfilerRunner::new(self.name(), profiling);
Expand Down Expand Up @@ -240,13 +240,13 @@ impl Bench for RedisBench {

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");
let certs = load_certs("tests/test-configs/redis-tls/certs/localhost.crt");
let private_key = load_private_key("tests/test-configs/redis/tls/certs/localhost.key");
let certs = load_certs("tests/test-configs/redis/tls/certs/localhost.crt");
config.tls = Some(
ClientConfig::builder()
.with_safe_defaults()
.with_root_certificates(load_ca(
"tests/test-configs/redis-tls/certs/localhost_CA.crt",
"tests/test-configs/redis/tls/certs/localhost_CA.crt",
))
.with_client_auth_cert(certs, private_key)
.unwrap()
Expand Down
110 changes: 55 additions & 55 deletions shotover-proxy/tests/cassandra_int_tests/mod.rs

Large diffs are not rendered by default.

70 changes: 35 additions & 35 deletions shotover-proxy/tests/redis_int_tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ 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/redis/passthrough/docker-compose.yaml");
let shotover = shotover_process("tests/test-configs/redis/passthrough/topology.yaml")
.start()
.await;
let connection = || redis_connection::new_async("127.0.0.1", 6379);
Expand All @@ -44,7 +44,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/redis/passthrough/topology.yaml")
.start()
.await;
let mut connection = redis_connection::new_async("127.0.0.1", 6379).await;
Expand Down Expand Up @@ -78,9 +78,9 @@ Caused by:
async fn tls_cluster_sink() {
test_helpers::cert::generate_redis_test_certs();

let _compose = docker_compose("tests/test-configs/redis-cluster-tls/docker-compose.yaml");
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")
shotover_process("tests/test-configs/redis/cluster-tls/topology-no-source-encryption.yaml")
.start()
.await;

Expand All @@ -98,8 +98,8 @@ async fn tls_source_and_tls_single_sink() {
test_helpers::cert::generate_redis_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/redis/tls/docker-compose.yaml");
let shotover = shotover_process("tests/test-configs/redis/tls/topology.yaml")
.start()
.await;

Expand All @@ -117,9 +117,9 @@ 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/redis/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/redis/tls-no-client-auth/topology.yaml")
.start()
.await;

Expand All @@ -130,27 +130,27 @@ async fn tls_source_and_tls_single_sink() {

// 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/redis/tls/certs",
));
{
let _compose =
docker_compose("tests/test-configs/redis-tls-no-verify-hostname/docker-compose.yaml");
let shotover =
shotover_process("tests/test-configs/redis-tls-no-verify-hostname/topology.yaml")
.start()
.await;

let mut connection = redis_connection::new_async_tls("127.0.0.1", 6379).await;
test_cluster_basics(&mut connection).await;
shotover.shutdown_and_then_consume_events(&[]).await;
}
// {
// let _compose =
// docker_compose("tests/test-configs/redis/tls-no-verify-hostname/docker-compose.yaml");
// let shotover =
// shotover_process("tests/test-configs/redis/tls-no-verify-hostname/topology.yaml")
// .start()
// .await;
//
// let mut connection = redis_connection::new_async_tls("127.0.0.1", 6379).await;
// test_cluster_basics(&mut connection).await;
// shotover.shutdown_and_then_consume_events(&[]).await;
// }
}

#[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")
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;

Expand All @@ -168,8 +168,8 @@ async fn cluster_ports_rewrite() {

#[tokio::test(flavor = "multi_thread")]
async fn multi() {
let _compose = docker_compose("tests/test-configs/redis-multi/docker-compose.yaml");
let shotover = shotover_process("tests/test-configs/redis-multi/topology.yaml")
let _compose = docker_compose("tests/test-configs/redis/multi/docker-compose.yaml");
let shotover = shotover_process("tests/test-configs/redis/multi/topology.yaml")
.start()
.await;
let mut connection = redis_connection::new_async("127.0.0.1", 6379).await;
Expand All @@ -195,8 +195,8 @@ Caused by:

#[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/redis/cluster-auth/docker-compose.yaml");
let shotover = shotover_process("tests/test-configs/redis/cluster-auth/topology.yaml")
.start()
.await;
let mut connection = redis_connection::new_async("127.0.0.1", 6379).await;
Expand All @@ -210,8 +210,8 @@ 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/redis/cluster-hiding/docker-compose.yaml");
let shotover = shotover_process("tests/test-configs/redis/cluster-hiding/topology.yaml")
.start()
.await;

Expand All @@ -228,8 +228,8 @@ 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/redis/cluster-handling/docker-compose.yaml");
let shotover = shotover_process("tests/test-configs/redis/cluster-handling/topology.yaml")
.start()
.await;

Expand All @@ -247,7 +247,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/redis/cluster-dr/docker-compose.yaml");

let nodes = vec![
"redis://127.0.0.1:2120/",
Expand All @@ -265,7 +265,7 @@ 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/redis/cluster-dr/topology.yaml")
.start()
.await;
let mut connection = redis_connection::new_async("127.0.0.1", 6379).await;
Expand Down Expand Up @@ -299,7 +299,7 @@ async fn cluster_dr() {
358
);

let shotover = shotover_process("tests/test-configs/redis-cluster-dr/topology.yaml")
let shotover = shotover_process("tests/test-configs/redis/cluster-dr/topology.yaml")
.start()
.await;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ services:
- type: tmpfs
target: /var/lib/cassandra
- type: bind
source: "../cassandra-tls/certs/keystore.p12"
source: "../tls/certs/keystore.p12"
target: "/etc/cassandra/certs/keystore.p12"

cassandra-two:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ sources:
Cassandra:
listen_addr: "127.0.0.1:9042"
tls:
certificate_path: "tests/test-configs/cassandra-tls/certs/localhost.crt"
private_key_path: "tests/test-configs/cassandra-tls/certs/localhost.key"
certificate_path: "tests/test-configs/cassandra/tls/certs/localhost.crt"
private_key_path: "tests/test-configs/cassandra/tls/certs/localhost.key"
chain_config:
main_chain:
- CassandraSinkCluster:
Expand All @@ -18,9 +18,9 @@ chain_config:
host_id: "2dd022d6-2937-4754-89d6-02d2933a8f7a"
connect_timeout_ms: 3000
tls:
certificate_authority_path: "tests/test-configs/cassandra-tls/certs/localhost_CA.crt"
certificate_path: "tests/test-configs/cassandra-tls/certs/localhost.crt"
private_key_path: "tests/test-configs/cassandra-tls/certs/localhost.key"
certificate_authority_path: "tests/test-configs/cassandra/tls/certs/localhost_CA.crt"
certificate_path: "tests/test-configs/cassandra/tls/certs/localhost.crt"
private_key_path: "tests/test-configs/cassandra/tls/certs/localhost.key"
verify_hostname: false
source_to_chain_mapping:
cassandra_prod: main_chain
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ services:
- type: tmpfs
target: /var/lib/cassandra
- type: bind
source: "../cassandra-tls/certs/keystore.p12"
source: "../tls/certs/keystore.p12"
target: "/etc/cassandra/certs/keystore.p12"
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ sources:
listen_addr: "127.0.0.1:9042"
transport: WebSocket
tls:
certificate_path: "tests/test-configs/cassandra-tls/certs/localhost.crt"
private_key_path: "tests/test-configs/cassandra-tls/certs/localhost.key"
certificate_path: "tests/test-configs/cassandra/tls/certs/localhost.crt"
private_key_path: "tests/test-configs/cassandra/tls/certs/localhost.key"
chain_config:
main_chain:
- CassandraSinkSingle:
remote_address: "127.0.0.1:9043"
connect_timeout_ms: 3000
tls:
certificate_authority_path: "tests/test-configs/cassandra-tls/certs/localhost_CA.crt"
certificate_path: "tests/test-configs/cassandra-tls/certs/localhost.crt"
private_key_path: "tests/test-configs/cassandra-tls/certs/localhost.key"
certificate_authority_path: "tests/test-configs/cassandra/tls/certs/localhost_CA.crt"
certificate_path: "tests/test-configs/cassandra/tls/certs/localhost.crt"
private_key_path: "tests/test-configs/cassandra/tls/certs/localhost.key"
verify_hostname: false
source_to_chain_mapping:
cassandra_prod: main_chain
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
-----BEGIN CERTIFICATE-----
MIIBujCCAWCgAwIBAgIJAMApKCmyUIFdMAoGCCqGSM49BAMCMEQxHjAcBgNVBAMM
FUNlcnRpZmljYXRlIEF1dGhvcml0eTEiMCAGA1UECgwZU2hvdG92ZXIgdGVzdCBj
ZXJ0aWZpY2F0ZTAgFw03NTAxMDEwMDAwMDBaGA80MDk2MDEwMTAwMDAwMFowOzEV
MBMGA1UEAwwMR2VuZXJpYy1DZXJ0MSIwIAYDVQQKDBlTaG90b3ZlciB0ZXN0IGNl
cnRpZmljYXRlMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEa5ATjMT4gwzLmIJJ
tqZMyhQrDBss2tIn2urHcSzcbqf+isfx2blkL0hR3bYl6tVbdDWDc37rFwhjwZLA
v8VdW6NCMEAwPgYDVR0RBDcwNYIJbG9jYWxob3N0hwR/AAABhwSsEAEChwSsEAED
hwSsEAEEhwSsEAEFhwSsEAEGhwSsEAEHMAoGCCqGSM49BAMCA0gAMEUCIG+IXJ+3
HQ1gkaXuZhGkNQixt9RTYGMIELT4aHhn/l4zAiEAr1FsleQZnJm59XWCyto9pJKi
sgYtwEUb3jRAznS5Qvc=
-----END CERTIFICATE-----
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-----BEGIN PRIVATE KEY-----
MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgwZHv+bAG5VPz3WKF
6ECyB8/gTDdZCMQ36mcttiCpxYihRANCAARrkBOMxPiDDMuYgkm2pkzKFCsMGyza
0ifa6sdxLNxup/6Kx/HZuWQvSFHdtiXq1Vt0NYNzfusXCGPBksC/xV1b
-----END PRIVATE KEY-----
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
-----BEGIN CERTIFICATE-----
MIIBszCCAVmgAwIBAgIJAIoUWebQ9TPvMAoGCCqGSM49BAMCMEQxHjAcBgNVBAMM
FUNlcnRpZmljYXRlIEF1dGhvcml0eTEiMCAGA1UECgwZU2hvdG92ZXIgdGVzdCBj
ZXJ0aWZpY2F0ZTAgFw03NTAxMDEwMDAwMDBaGA80MDk2MDEwMTAwMDAwMFowRDEe
MBwGA1UEAwwVQ2VydGlmaWNhdGUgQXV0aG9yaXR5MSIwIAYDVQQKDBlTaG90b3Zl
ciB0ZXN0IGNlcnRpZmljYXRlMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEg7ZQ
CaHM5wjefJ+hCkW82+w4UpRxyInlFfLws54bMMtQYnV75R4fr/kD4Zsf7Ue4lra2
ryFCWRxYhUAUNyIDsaMyMDAwHQYDVR0OBBYEFO8z9dDmWRSKopcm7dxWzRuBvRUR
MA8GA1UdEwEB/wQFMAMBAf8wCgYIKoZIzj0EAwIDSAAwRQIhALELyJDNxaE2kaRp
3KOv6t7cGyr6HscJ/vc8FNTL4JrqAiAumz2OQADyE4gHvyT5V32Lw/HPGNNX2c3x
qx+duzqYXA==
-----END CERTIFICATE-----
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ sources:
Cassandra:
listen_addr: "127.0.0.1:9043"
tls:
certificate_path: "tests/test-configs/cassandra-tls/certs/localhost.crt"
private_key_path: "tests/test-configs/cassandra-tls/certs/localhost.key"
certificate_path: "tests/test-configs/cassandra/tls/certs/localhost.crt"
private_key_path: "tests/test-configs/cassandra/tls/certs/localhost.key"
chain_config:
main_chain:
- CassandraSinkSingle:
remote_address: "localhost:9042"
connect_timeout_ms: 3000
tls:
certificate_authority_path: "tests/test-configs/cassandra-tls/certs/localhost_CA.crt"
certificate_path: "tests/test-configs/cassandra-tls/certs/localhost.crt"
private_key_path: "tests/test-configs/cassandra-tls/certs/localhost.key"
certificate_authority_path: "tests/test-configs/cassandra/tls/certs/localhost_CA.crt"
certificate_path: "tests/test-configs/cassandra/tls/certs/localhost.crt"
private_key_path: "tests/test-configs/cassandra/tls/certs/localhost.key"
verify_hostname: true
source_to_chain_mapping:
cassandra_prod: main_chain
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ sources:
Cassandra:
listen_addr: "127.0.0.1:9043"
tls:
certificate_path: "tests/test-configs/cassandra-tls/certs/localhost.crt"
private_key_path: "tests/test-configs/cassandra-tls/certs/localhost.key"
certificate_path: "tests/test-configs/cassandra/tls/certs/localhost.crt"
private_key_path: "tests/test-configs/cassandra/tls/certs/localhost.key"
chain_config:
main_chain:
- CassandraSinkSingle:
remote_address: "localhost:9042"
connect_timeout_ms: 3000
tls:
certificate_authority_path: "tests/test-configs/cassandra-tls/certs/localhost_CA.crt"
certificate_authority_path: "tests/test-configs/cassandra/tls/certs/localhost_CA.crt"
verify_hostname: true
source_to_chain_mapping:
cassandra_prod: main_chain
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ services:
ipv4_address: 172.16.1.2
image: &image bitnami/redis-cluster:6.2.12-debian-11-r26
volumes:
- &keys ../redis-tls/certs:/usr/local/etc/redis/certs
- &keys ../tls/certs:/usr/local/etc/redis/certs

environment:
&node_environment
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ sources:
Redis:
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/redis/tls/certs/localhost.crt"
private_key_path: "tests/test-configs/redis/tls/certs/localhost.key"
chain_config:
redis_chain:
- DebugForceEncode:
Expand All @@ -21,9 +21,9 @@ chain_config:
- "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/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
source_to_chain_mapping:
redis_prod: redis_chain
Loading

0 comments on commit eb342b6

Please sign in to comment.