summaryrefslogtreecommitdiffstats
path: root/ipatests
diff options
context:
space:
mode:
authorPetr Viktorin <pviktori@redhat.com>2014-01-23 13:08:04 +0100
committerPetr Viktorin <pviktori@redhat.com>2014-04-10 12:05:26 +0200
commit85b8d8d5aeda0bedfab55a4a0e6d15ddc865d59f (patch)
tree9299731e1834f94509c403cc6038c60bd7834690 /ipatests
parent13f3ba5eb009a4af3bdb60a54e058fb5f62545dd (diff)
downloadfreeipa-85b8d8d5aeda0bedfab55a4a0e6d15ddc865d59f.tar.gz
freeipa-85b8d8d5aeda0bedfab55a4a0e6d15ddc865d59f.tar.xz
freeipa-85b8d8d5aeda0bedfab55a4a0e6d15ddc865d59f.zip
CA-less tests: Use sequential certificate serial numbers
When serial numbers were generated with $RANDOM, there could be collisions. Use sequential numbers instead. Reviewed-By: Adam Misnyovszki <amisnyov@redhat.com>
Diffstat (limited to 'ipatests')
-rw-r--r--ipatests/test_integration/scripts/caless-create-pki5
1 files changed, 4 insertions, 1 deletions
diff --git a/ipatests/test_integration/scripts/caless-create-pki b/ipatests/test_integration/scripts/caless-create-pki
index a0b6f13c0..f428ebae1 100644
--- a/ipatests/test_integration/scripts/caless-create-pki
+++ b/ipatests/test_integration/scripts/caless-create-pki
@@ -5,6 +5,8 @@ profile_server=(-t ,, -v 12)
crl_path=${crl_path-$(readlink -f $dbdir)}
+serial_number=0
+
gen_cert() {
local profile="$1" nick="$2" subject="$3" ca options pwfile noise csr crt
shift 3
@@ -46,7 +48,8 @@ file://$crl_path/$ca.crl
n
n
EOF
- certutil -C -d "$dbdir" -f "$pwfile" -m "$RANDOM" -i "$csr" -o "$crt" "${options[@]}" "$@"
+ serial_number=$(($serial_number+1))
+ certutil -C -d "$dbdir" -f "$pwfile" -m "$serial_number" -i "$csr" -o "$crt" "${options[@]}" "$@"
certutil -A -d "$dbdir" -n "$nick" -f "$pwfile" -i "$crt" "${options[@]}"
rm -f "$pwfile" "$noise" "$csr" "$crt"