diff options
author | Michal Reznik <mreznik@redhat.com> | 2017-03-03 11:17:17 +0100 |
---|---|---|
committer | Martin Babinsky <mbabinsk@redhat.com> | 2017-03-07 13:18:14 +0100 |
commit | 83e2c2b65eeb5a3aa4a59c0535e9177aac5e4637 (patch) | |
tree | 467f81503c74f085d8fc612ebd155829258d8bd8 /ipatests/test_ipaclient | |
parent | 30d7c210a4d153fcb5007651a80d8d53512abba3 (diff) | |
download | freeipa-83e2c2b65eeb5a3aa4a59c0535e9177aac5e4637.tar.gz freeipa-83e2c2b65eeb5a3aa4a59c0535e9177aac5e4637.tar.xz freeipa-83e2c2b65eeb5a3aa4a59c0535e9177aac5e4637.zip |
test_csrgen: adjusted comparison test scripts for CSRGenerator
Commit ada91c2 introduced changes in "csrgen/templates/openssl_base.tmpl"
which broke the following 2 tests:
test_CSRGenerator.test_userCert_OpenSSL
test_CSRGenerator.test_caIPAserviceCert_OpenSSL
The tests use files caIPAserviceCert_openssl.sh and userCert_openssl.sh
as expected scripts in order to compare scripts generated by CSRGenerator.
E.g. as other parameter was introduced we are now not checking with
"if [[ $# -ne 2 ]]" but rather with if "[[ $# -lt 2 ]]".
https://pagure.io/freeipa/issue/6724
Reviewed-By: Milan Kubik <mkubik@redhat.com>
Reviewed-By: Christian Heimes <cheimes@redhat.com>
Diffstat (limited to 'ipatests/test_ipaclient')
-rw-r--r-- | ipatests/test_ipaclient/data/test_csrgen/scripts/caIPAserviceCert_openssl.sh | 9 | ||||
-rw-r--r-- | ipatests/test_ipaclient/data/test_csrgen/scripts/userCert_openssl.sh | 9 |
2 files changed, 10 insertions, 8 deletions
diff --git a/ipatests/test_ipaclient/data/test_csrgen/scripts/caIPAserviceCert_openssl.sh b/ipatests/test_ipaclient/data/test_csrgen/scripts/caIPAserviceCert_openssl.sh index c621a69bc..811bfd763 100644 --- a/ipatests/test_ipaclient/data/test_csrgen/scripts/caIPAserviceCert_openssl.sh +++ b/ipatests/test_ipaclient/data/test_csrgen/scripts/caIPAserviceCert_openssl.sh @@ -1,14 +1,15 @@ #!/bin/bash -e -if [[ $# -ne 2 ]]; then -echo "Usage: $0 <outfile> <keyfile>" +if [[ $# -lt 2 ]]; then +echo "Usage: $0 <outfile> <keyfile> <other openssl arguments>" echo "Called as: $0 $@" exit 1 fi CONFIG="$(mktemp)" CSR="$1" -shift +KEYFILE="$2" +shift; shift echo \ '[ req ] @@ -29,5 +30,5 @@ DNS = machine.example.com subjectAltName = @sec1 ' > "$CONFIG" -openssl req -new -config "$CONFIG" -out "$CSR" -key $1 +openssl req -new -config "$CONFIG" -out "$CSR" -key "$KEYFILE" "$@" rm "$CONFIG" diff --git a/ipatests/test_ipaclient/data/test_csrgen/scripts/userCert_openssl.sh b/ipatests/test_ipaclient/data/test_csrgen/scripts/userCert_openssl.sh index cdbe8a1fa..2edf067a5 100644 --- a/ipatests/test_ipaclient/data/test_csrgen/scripts/userCert_openssl.sh +++ b/ipatests/test_ipaclient/data/test_csrgen/scripts/userCert_openssl.sh @@ -1,14 +1,15 @@ #!/bin/bash -e -if [[ $# -ne 2 ]]; then -echo "Usage: $0 <outfile> <keyfile>" +if [[ $# -lt 2 ]]; then +echo "Usage: $0 <outfile> <keyfile> <other openssl arguments>" echo "Called as: $0 $@" exit 1 fi CONFIG="$(mktemp)" CSR="$1" -shift +KEYFILE="$2" +shift; shift echo \ '[ req ] @@ -29,5 +30,5 @@ email = testuser@example.com subjectAltName = @sec1 ' > "$CONFIG" -openssl req -new -config "$CONFIG" -out "$CSR" -key $1 +openssl req -new -config "$CONFIG" -out "$CSR" -key "$KEYFILE" "$@" rm "$CONFIG" |