Skip to content

Commit

Permalink
Fix e2e test for rabbitmq controller (#241)
Browse files Browse the repository at this point in the history
Signed-off-by: Xudong Sun <[email protected]>
  • Loading branch information
marshtompsxd authored Sep 6, 2023
1 parent cc43b97 commit 1bd7584
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
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

0 comments on commit 1bd7584

Please sign in to comment.