Skip to content

Commit d2f8244

Browse files
committed
Remove spaces on getting ISSUER details
It happens that the cert issuer output contains spaces, which later in the condition where it is comparing with expected issuer it just fails. Signed-off-by: Daniel Pawlik <dpawlik@redhat.com>
1 parent 1ec2176 commit d2f8244

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

tests/kuttl/common/osp_check_cert_issuer.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ for url in $(openstack endpoint list -c URL -f value | grep "$endpoint_filter");
6161

6262
echo "Checking $host_port ..."
6363
if [[ "$ENDPOINT_TYPE" == "public" ]]; then
64-
ISSUER=$(echo | openssl s_client -connect "$host_port" 2>/dev/null | openssl x509 -noout -issuer | sed -n 's/^.*CN=\([^,]*\).*$/\1/p')
64+
ISSUER=$(echo | openssl s_client -connect "$host_port" 2>/dev/null | openssl x509 -noout -issuer | sed -n 's/^.*CN=\([^,]*\).*$/\1/p' | sed 's/ //g')
6565
else
66-
ISSUER=$(openssl s_client -connect $host_port < /dev/null 2>/dev/null | openssl x509 -issuer -noout -in /dev/stdin)
66+
ISSUER=$(openssl s_client -connect $host_port </dev/null 2>/dev/null | openssl x509 -issuer -noout -in /dev/stdin | sed 's/ //g')
6767
fi
6868

6969
if [[ "$ISSUER" != "$EXPECTED_ISSUER" ]]; then

0 commit comments

Comments
 (0)