diff --git a/e2e-tests/functions b/e2e-tests/functions index b3a4e313b4..4d03587a10 100755 --- a/e2e-tests/functions +++ b/e2e-tests/functions @@ -1277,6 +1277,10 @@ function generate_vs_json() { } check_passwords_leak() { + local secrets + local passwords + local pods + secrets=$(kubectl_bin get secrets -o json | jq -r '.items[].data | to_entries | .[] | select(.key | (contains("_PASSWORD"))) | .value') echo secrets=$secrets @@ -1289,9 +1293,10 @@ check_passwords_leak() { pods=$(kubectl_bin get pods -o name | awk -F "/" '{print $2}') echo pods=$pods - TEMP_DIR=$(mktemp -d) - collect_logs() { + local containers + local count + NS=$1 for p in $pods; do containers=$(kubectl_bin -n "$NS" get pod $p -o jsonpath='{.spec.containers[*].name}') @@ -1300,12 +1305,12 @@ check_passwords_leak() { if [[ ${c} =~ "pmm" ]]; then continue fi - kubectl_bin -n "$NS" logs $p -c $c >${TEMP_DIR}/logs_output-$p-$c.txt - echo logs saved in: ${TEMP_DIR}/logs_output-$p-$c.txt + kubectl_bin -n "$NS" logs $p -c $c >${tmp_dir}/logs_output-$p-$c.txt + echo logs saved in: ${tmp_dir}/logs_output-$p-$c.txt for pass in $passwords; do - count=$(grep -c --fixed-strings -- "$pass" ${TEMP_DIR}/logs_output-$p-$c.txt || :) + count=$(grep -c --fixed-strings -- "$pass" ${tmp_dir}/logs_output-$p-$c.txt || :) if [[ $count != 0 ]]; then - echo leaked passwords are found in log ${TEMP_DIR}/logs_output-$p-$c.txt + echo leaked passwords are found in log ${tmp_dir}/logs_output-$p-$c.txt false fi done diff --git a/e2e-tests/monitoring-2-0/run b/e2e-tests/monitoring-2-0/run index c1df2a1b52..19569f91e2 100755 --- a/e2e-tests/monitoring-2-0/run +++ b/e2e-tests/monitoring-2-0/run @@ -13,8 +13,7 @@ desc 'install PMM Server' deploy_pmm_server sleep 20 -SERVICE="postgres" -until kubectl_bin exec monitoring-0 -- bash -c "pgrep -x $SERVICE >/dev/null"; do +until kubectl_bin exec monitoring-0 -- bash -c "ls -l /proc/*/exe 2>/dev/null| grep postgres >/dev/null"; do echo "Retry $retry" sleep 5 let retry+=1