Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix e2e test for rabbitmq controller #241

Merged
merged 3 commits into from
Sep 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions deploy/rabbitmq/perf-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash

set -xeu

instance=$1
username=$(kubectl get secret ${instance}-default-user -o jsonpath="{.data.username}" | base64 --decode)
password=$(kubectl get secret ${instance}-default-user -o jsonpath="{.data.password}" | base64 --decode)
service=${instance}
kubectl run perf-test --image=pivotalrabbitmq/perf-test -- --uri "amqp://${username}:${password}@${service}"
7 changes: 4 additions & 3 deletions e2e/src/rabbitmq_e2e.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ pub fn rabbitmq_cluster() -> String {
replicas: 3
rabbitmqConfig:
additionalConfig: |
log.console.level = debug
default_user = new_user
default_pass = new_pass
"
.to_string()
}
Expand Down Expand Up @@ -79,8 +80,8 @@ pub async fn rabbitmq_e2e_test() -> Result<(), Error> {
Ok(cm) => {
let data = cm.data.unwrap();
let user_config = data.get("userDefinedConfiguration.conf").unwrap();
if !user_config.contains("default_user=new_user")
|| !user_config.contains("default_pass=new_pass")
if !user_config.contains("default_user = new_user")
|| !user_config.contains("default_pass = new_pass")
{
println!(
"Configmap is not consistent with rabbitmq cluster spec. E2e test failed."
Expand Down
Loading