summaryrefslogtreecommitdiffstats
path: root/tests/dogtag/acceptance/cli-tests
diff options
context:
space:
mode:
authorNiranjan Mallapadi <mrniranjan@redhat.com>2014-11-26 18:03:49 +0530
committerNiranjan Mallapadi <mrniranjan@redhat.com>2014-11-26 18:05:49 +0530
commit3b7a8fcc533a212af06fa7a8b00dda01b57cc66a (patch)
treecebeea81e76c71b2fb1b210ea46284497dcfc517 /tests/dogtag/acceptance/cli-tests
parente1b4f5b01e2632e24e6d13ce6f7381c5f7e9b293 (diff)
downloadpki-3b7a8fcc533a212af06fa7a8b00dda01b57cc66a.tar.gz
pki-3b7a8fcc533a212af06fa7a8b00dda01b57cc66a.tar.xz
pki-3b7a8fcc533a212af06fa7a8b00dda01b57cc66a.zip
Remove /dev/urandom from ca-cert-cli
Replace /dev/urandom for junk characters with openssl rand and user $RANDOM for random integer values
Diffstat (limited to 'tests/dogtag/acceptance/cli-tests')
-rwxr-xr-xtests/dogtag/acceptance/cli-tests/pki-ca-cert-cli/pki-ca-cert-cli-cert-ca.sh4
-rwxr-xr-xtests/dogtag/acceptance/cli-tests/pki-ca-cert-cli/pki-ca-cert-cli-cert-hold-ca.sh7
-rwxr-xr-xtests/dogtag/acceptance/cli-tests/pki-ca-cert-cli/pki-ca-cert-cli-find-ca.sh16
-rwxr-xr-xtests/dogtag/acceptance/cli-tests/pki-ca-cert-cli/pki-ca-cert-cli-release-hold-ca.sh4
-rwxr-xr-xtests/dogtag/acceptance/cli-tests/pki-ca-cert-cli/pki-ca-cert-cli-request-find-ca.sh8
-rwxr-xr-xtests/dogtag/acceptance/cli-tests/pki-ca-cert-cli/pki-ca-cert-cli-request-profile-find-ca.sh4
-rwxr-xr-xtests/dogtag/acceptance/cli-tests/pki-ca-cert-cli/pki-ca-cert-cli-request-profile-show-ca.sh2
-rwxr-xr-xtests/dogtag/acceptance/cli-tests/pki-ca-cert-cli/pki-ca-cert-cli-request-review-ca.sh4
-rwxr-xr-xtests/dogtag/acceptance/cli-tests/pki-ca-cert-cli/pki-ca-cert-cli-request-show-ca.sh6
-rwxr-xr-xtests/dogtag/acceptance/cli-tests/pki-ca-cert-cli/pki-ca-cert-cli-request-submit-ca.sh6
-rwxr-xr-xtests/dogtag/acceptance/cli-tests/pki-ca-cert-cli/pki-ca-cert-cli-revoke-ca.sh4
-rwxr-xr-xtests/dogtag/acceptance/cli-tests/pki-ca-cert-cli/pki-ca-cert-cli-show-ca.sh4
12 files changed, 34 insertions, 35 deletions
diff --git a/tests/dogtag/acceptance/cli-tests/pki-ca-cert-cli/pki-ca-cert-cli-cert-ca.sh b/tests/dogtag/acceptance/cli-tests/pki-ca-cert-cli/pki-ca-cert-cli-cert-ca.sh
index 6161f1527..15765159c 100755
--- a/tests/dogtag/acceptance/cli-tests/pki-ca-cert-cli/pki-ca-cert-cli-cert-ca.sh
+++ b/tests/dogtag/acceptance/cli-tests/pki-ca-cert-cli/pki-ca-cert-cli-cert-ca.sh
@@ -65,9 +65,9 @@ run_pki-ca-cert-ca_tests()
rlPhaseStartTest "pki_ca_cert001: pki ca-cert with junk characters should return invalid module"
local temp_out1="$TmpDir/pki_cert001"
- local rand=`cat /dev/urandom | tr -dc 'a-zA-Z0-9*?$@#!%^&*()' | fold -w 40 | head -n 1`
+ local junk=$(openssl rand -base64 50 | perl -p -e 's/\n//')
rlLog "Executing pki ca-cert \"$junk\" characters"
- rlRun "pki ca-cert \"$rand\" 2> $temp_out1" 1,255 "Command pki cert with junk characters"
+ rlRun "pki ca-cert \"$junk\" 2> $temp_out1" 1,255 "Command pki cert with junk characters"
rlAssertGrep "Error: Invalid module" "$temp_out1"
rlPhaseEnd
diff --git a/tests/dogtag/acceptance/cli-tests/pki-ca-cert-cli/pki-ca-cert-cli-cert-hold-ca.sh b/tests/dogtag/acceptance/cli-tests/pki-ca-cert-cli/pki-ca-cert-cli-cert-hold-ca.sh
index 10c22c6d1..c3903f97b 100755
--- a/tests/dogtag/acceptance/cli-tests/pki-ca-cert-cli/pki-ca-cert-cli-cert-hold-ca.sh
+++ b/tests/dogtag/acceptance/cli-tests/pki-ca-cert-cli/pki-ca-cert-cli-cert-hold-ca.sh
@@ -64,17 +64,16 @@ run_pki-ca-cert-hold-ca_tests()
local TEMP_NSS_DB="$TmpDir/nssdb"
local TEMP_NSS_DB_PWD="redhat123"
local exp="$TmpDir/expfile.out"
- local invalid_Number=$(cat /dev/urandom | tr -dc '1-9' | fold -w 10 | head -n 1)
- local junk=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9?@\!~#*()*^*_' | fold -w 32 | head -n 1)
+ local invalid_Number=$RANDOM
+ local junk=$(openssl rand -base64 50 | perl -p -e 's/\n//')
local expout="$TmpDir/exp_out"
local certout="$TmpDir/cert_out"
local cert_info="$TmpDir/cert_info"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local target_https_port=$(eval echo \$${CA_INST}_SECURE_PORT)
local tmp_ca_host=$(eval echo \$${cs_Role})
local target_host=$tmp_ca_host
local target_port=$(eval echo \$${CA_INST}_UNSECURE_PORT)
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
# pki ca-cert-hold config test
rlPhaseStartTest "pki_cert_hold-configtest: pki cert-release-hold --help configuration test"
diff --git a/tests/dogtag/acceptance/cli-tests/pki-ca-cert-cli/pki-ca-cert-cli-find-ca.sh b/tests/dogtag/acceptance/cli-tests/pki-ca-cert-cli/pki-ca-cert-cli-find-ca.sh
index 56e574260..681fd76a6 100755
--- a/tests/dogtag/acceptance/cli-tests/pki-ca-cert-cli/pki-ca-cert-cli-find-ca.sh
+++ b/tests/dogtag/acceptance/cli-tests/pki-ca-cert-cli/pki-ca-cert-cli-find-ca.sh
@@ -70,7 +70,7 @@ run_pki-ca-cert-find-ca_tests()
local CA_adminR_user=$CA_INST\_adminR
local CA_adminE_user=$CA_INST\_adminE
local CA_agentE_user=$CA_INST\_agentE
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local i18n_user1_fullname="Örjan Äke $rand"
local i18n_user1="Örjan_Äke_$rand"
local i18n_user2_fullname="Éric Têko $rand"
@@ -81,7 +81,7 @@ run_pki-ca-cert-find-ca_tests()
local i18n_user4="kakskümmend_üks_$rand"
local i18n_user5_fullname="двадцять один тридцять $rand"
local i18n_user5="двадцять_один_тридцять_$rand"
- local tmp_junk_data=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 200 | head -n 1)
+ local tmp_junk_data=$(openssl rand -base64 50 | perl -p -e 's/\n//')
local admin_cert_nickname="PKI Administrator for $CA_DOMAIN"
local target_host=$(eval echo \$${cs_Role})
local target_port=$(eval echo \$${CA_INST}_UNSECURE_PORT)
@@ -419,7 +419,7 @@ run_pki-ca-cert-find-ca_tests()
rlPhaseStartSetup "Create a new profile based on caServerCert with Netscape Extension nsCertSSLServer"
local tmp_profile=caServerCert
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local tmp_new_sslserver_profile=caServerCert$rand
rlLog "Get $tmp_profile xml file"
rlRun "pki -d $CERTDB_DIR -h $target_host -p $target_port -n $CA_adminV_user -c $CERTDB_DIR_PASSWORD ca-profile-show $tmp_profile --output $TmpDir/$tmp_new_sslserver_profile-Temp1.xml"
@@ -526,7 +526,7 @@ run_pki-ca-cert-find-ca_tests()
rlPhaseStartSetup "Create a new profile based on caServerCert with Netscape Extension nsCertSSLServer and nsCertSSLClient"
local tmp_profile=caServerCert
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local tmp_new_server_client_profile=caServerCert$rand
rlLog "Get $tmp_profile xml file"
rlRun "pki -d $CERTDB_DIR -h $target_host -p $target_port -n $CA_adminV_user -c $CERTDB_DIR_PASSWORD ca-profile-show $tmp_profile --output $TmpDir/$tmp_new_server_client_profile-Temp1.xml"
@@ -571,7 +571,7 @@ run_pki-ca-cert-find-ca_tests()
rlPhaseStartSetup "Create a new profile based on caOtherCert with Netscape Extension nsCertEmailCA"
local tmp_profile=caOtherCert
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local tmp_new_emailca_profile=caOtherCert$rand
rlLog "Get $tmp_profile xml file"
rlRun "pki -d $CERTDB_DIR -h $target_host -p $target_port -n $CA_adminV_user -c $CERTDB_DIR_PASSWORD ca-profile-show $tmp_profile --output $TmpDir/$tmp_new_emailca_profile-Temp1.xml"
@@ -678,7 +678,7 @@ run_pki-ca-cert-find-ca_tests()
rlPhaseStartSetup "Create a new profile based on caOtherCert with Netscape Extension nsCertSSLCA"
local tmp_profile=caOtherCert
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local tmp_new_sslca_profile=caOtherCert$rand
rlLog "Get $tmp_profile xml file"
rlRun "pki -d $CERTDB_DIR -h $target_host -p $target_port -n $CA_adminV_user -c $CERTDB_DIR_PASSWORD ca-profile-show $tmp_profile --output $TmpDir/$tmp_new_sslca_profile-Temp1.xml"
@@ -785,7 +785,7 @@ run_pki-ca-cert-find-ca_tests()
rlPhaseStartSetup "Create a new profile based on caOtherCert with Netscape Extension nsCertEmailCA and nsCertSSLCA"
local tmp_profile=caOtherCert
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local tmp_new_email_ssl_ca_profile=caOtherCert$rand
rlLog "Get $tmp_profile xml file"
rlRun "pki -d $CERTDB_DIR -h $target_host -p $target_port -n $CA_adminV_user -c $CERTDB_DIR_PASSWORD ca-profile-show $tmp_profile --output $TmpDir/$tmp_new_email_ssl_ca_profile-Temp1.xml"
@@ -3139,7 +3139,7 @@ run_pki-ca-cert-find-ca_tests()
rlPhaseEnd
rlPhaseStartTest "pki_ca_cert_find-0129: verify if search results are returned if a very large number is passed to --size"
- local tmp_search_size=$(cat /dev/urandom | tr -dc '0-9' | fold -w 20 | head -n 1)
+ local tmp_search_size="987654321123456789"
rlLog "Executing pki ca-cert-find --size $tmp_search_size"
rlRun "pki -h $target_host -p $target_port ca-cert-find --size $tmp_search_size > $cert_find_info 2>&1" 1,255
rlAssertGrep "NumberFormatException: For input string: \"$tmp_search_size\"" "$cert_find_info"
diff --git a/tests/dogtag/acceptance/cli-tests/pki-ca-cert-cli/pki-ca-cert-cli-release-hold-ca.sh b/tests/dogtag/acceptance/cli-tests/pki-ca-cert-cli/pki-ca-cert-cli-release-hold-ca.sh
index 8d0bab6d7..c54b7107f 100755
--- a/tests/dogtag/acceptance/cli-tests/pki-ca-cert-cli/pki-ca-cert-cli-release-hold-ca.sh
+++ b/tests/dogtag/acceptance/cli-tests/pki-ca-cert-cli/pki-ca-cert-cli-release-hold-ca.sh
@@ -63,8 +63,8 @@ run_pki-ca-cert-release-hold-ca_tests()
local TEMP_NSS_DB="$TmpDir/nssdb"
local TEMP_NSS_DB_PWD="redhat123"
local exp="$TmpDir/expfile.out"
- local invalid_Number=$(cat /dev/urandom | tr -dc '1-9' | fold -w 10 | head -n 1)
- local junk=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9?@\!~#*()*^*_' | fold -w 32 | head -n 1)
+ local invalid_Number=$RANDOM
+ local junk=$(openssl rand -base64 50 | perl -p -e 's/\n//')
local temp_cert_out="$TmpDir/cert-request.out"
local temp_out="$TmpDir/cert-request-show.out"
local expout="$TmpDir/exp_out"
diff --git a/tests/dogtag/acceptance/cli-tests/pki-ca-cert-cli/pki-ca-cert-cli-request-find-ca.sh b/tests/dogtag/acceptance/cli-tests/pki-ca-cert-cli/pki-ca-cert-cli-request-find-ca.sh
index 23998731c..06c57e6f9 100755
--- a/tests/dogtag/acceptance/cli-tests/pki-ca-cert-cli/pki-ca-cert-cli-request-find-ca.sh
+++ b/tests/dogtag/acceptance/cli-tests/pki-ca-cert-cli/pki-ca-cert-cli-request-find-ca.sh
@@ -71,9 +71,9 @@ run_pki-ca-cert-request-find-ca_tests()
local target_https_port=$(eval echo \$${CA_INST}_SECURE_PORT)
local tmp_ca_host=$(eval echo \$${cs_Role})
local target_host=$(eval echo \$${cs_Role})
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local cert_request_submit="$TEMP_NSS_DB/pki-cert-request-submit.out"
- local tmp_junk_data=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 200 | head -n 1)
+ local tmp_junk_data=$(openssl rand -base64 50 | perl -p -e 's/\n//')
local profile=caUserCert
# Config test of pki ca-cert-request-find
@@ -767,7 +767,7 @@ run_pki-ca-cert-request-find-ca_tests()
rlPhaseEnd
rlPhaseStartTest "pki_ca_cert_request_find-0020: Issue pki ca-cert-request-find with --start <Maximum integer value>"
- local tmp_large_number1=$(cat /dev/urandom | tr -dc '0-9' | fold -w 200 | head -n 1)
+ local tmp_large_number1="1234567890987654321123456789987654321123456789012327809893343437654321"
rlLog "Executing pki ca-cert-request-find --start $tmp_large_number1"
rlRun "pki -d $CERTDB_DIR \
-h $target_host \
@@ -830,7 +830,7 @@ run_pki-ca-cert-request-find-ca_tests()
rlPhaseEnd
rlPhaseStartTest "pki_ca_cert_request_find-0024: Issue pki ca-cert-request-find with --maxResults <maximum Integer value>"
- local tmp_large_number1=$(cat /dev/urandom | tr -dc '0-9' | fold -w 50 | head -n 1)
+ local tmp_large_number1="12345678901234567890098765432113467908248614908601"
rlLog "Executing pki ca-cert-request-find with --maxResults <no-value>"
rlRun "pki -d $CERTDB_DIR \
-h $target_host \
diff --git a/tests/dogtag/acceptance/cli-tests/pki-ca-cert-cli/pki-ca-cert-cli-request-profile-find-ca.sh b/tests/dogtag/acceptance/cli-tests/pki-ca-cert-cli/pki-ca-cert-cli-request-profile-find-ca.sh
index 915dfcd99..74fccb94c 100755
--- a/tests/dogtag/acceptance/cli-tests/pki-ca-cert-cli/pki-ca-cert-cli-request-profile-find-ca.sh
+++ b/tests/dogtag/acceptance/cli-tests/pki-ca-cert-cli/pki-ca-cert-cli-request-profile-find-ca.sh
@@ -72,7 +72,7 @@ run_pki-ca-cert-request-profile-find-ca_tests()
local exp="$TmpDir/expfile.out"
local expout="$TmpDir/exp_out"
local certout="$TmpDir/cert_out"
- local tmp_junk_data=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 200 | head -n 1)
+ local tmp_junk_data=$(openssl rand -base64 50 | perl -p -e 's/\n//')
local i18n_user1="Örjan_Äke_$rand"
local i18n_user2="Éric_Têko_$rand"
local i18n_user3="éénentwintig_dvidešimt_$rand"
@@ -82,7 +82,7 @@ run_pki-ca-cert-request-profile-find-ca_tests()
local tmp_ca_host=$(eval echo \$${cs_Role})
local target_port=$(eval echo \$${CA_INST}_UNSECURE_PORT)
local target_host=$tmp_ca_host
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
rlPhaseStartTest "pki_cert_cli-configtest: pki ca-cert-request-profile-find --help configuration test"
diff --git a/tests/dogtag/acceptance/cli-tests/pki-ca-cert-cli/pki-ca-cert-cli-request-profile-show-ca.sh b/tests/dogtag/acceptance/cli-tests/pki-ca-cert-cli/pki-ca-cert-cli-request-profile-show-ca.sh
index a6c71c9a5..ea2fa1e0b 100755
--- a/tests/dogtag/acceptance/cli-tests/pki-ca-cert-cli/pki-ca-cert-cli-request-profile-show-ca.sh
+++ b/tests/dogtag/acceptance/cli-tests/pki-ca-cert-cli/pki-ca-cert-cli-request-profile-show-ca.sh
@@ -81,7 +81,7 @@ run_pki-ca-cert-request-profile-show-ca_tests()
local tmp_ca_host=$(eval echo \$${cs_Role})
local target_host=$tmp_ca_host
local target_port=$(eval echo \$${CA_INST}_UNSECURE_PORT)
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
rlPhaseStartTest "pki_cert_cli-configtest: pki ca-cert-request-profile-show --help configuration test"
rlRun "pki -h $target_host -p $target_port ca-cert-request-profile-show --help 1> $cert_request_profile_show_info" 0 "pki -h $target_host -p $target_port ca-cert-request-profile-show --help"
diff --git a/tests/dogtag/acceptance/cli-tests/pki-ca-cert-cli/pki-ca-cert-cli-request-review-ca.sh b/tests/dogtag/acceptance/cli-tests/pki-ca-cert-cli/pki-ca-cert-cli-request-review-ca.sh
index da74b6036..2703b2974 100755
--- a/tests/dogtag/acceptance/cli-tests/pki-ca-cert-cli/pki-ca-cert-cli-request-review-ca.sh
+++ b/tests/dogtag/acceptance/cli-tests/pki-ca-cert-cli/pki-ca-cert-cli-request-review-ca.sh
@@ -71,10 +71,10 @@ run_pki-ca-cert-request-review-ca_tests()
local target_https_port=$(eval echo \$${CA_INST}_SECURE_PORT)
local tmp_ca_host=$(eval echo \$${cs_Role})
local target_host=$tmp_ca_host
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local i18n_array=("Örjan Äke:Örjan_Äke" "Éric Têko:Éric_Têko" "éénentwintig dvidešimt:éénentwintig_dvidešimt" "kakskümmend üks:kakskümmend_üks" "двадцять один тридцять:двадцять_один_тридцять")
local cert_request_submit="$TEMP_NSS_DB/pki-cert-request-submit.out"
- local tmp_junk_data=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 200 | head -n 1)
+ local tmp_junk_data=$(openssl rand -base64 50 | perl -p -e 's/\n//')
local exp="$TmpDir/expfile.out"
local expout="$TmpDir/exp_out"
local admin_cert_nickname="caadmincert"
diff --git a/tests/dogtag/acceptance/cli-tests/pki-ca-cert-cli/pki-ca-cert-cli-request-show-ca.sh b/tests/dogtag/acceptance/cli-tests/pki-ca-cert-cli/pki-ca-cert-cli-request-show-ca.sh
index 5d6314e7f..a48590f53 100755
--- a/tests/dogtag/acceptance/cli-tests/pki-ca-cert-cli/pki-ca-cert-cli-request-show-ca.sh
+++ b/tests/dogtag/acceptance/cli-tests/pki-ca-cert-cli/pki-ca-cert-cli-request-show-ca.sh
@@ -64,8 +64,8 @@ run_pki-ca-cert-request-show-ca_tests()
local TEMP_NSS_DB="$TmpDir/nssdb"
local ret_reqstatus
local ret_requestid
- local invalid_requestid=$(cat /dev/urandom | tr -dc '0-9' | fold -w 10 | head -n 1)
- local junk_requestid=$(cat /dev/urandom | tr -dc 'a-bA-Z0-9' | fold -w 40 | head -n 1)
+ local invalid_requestid=$RANDOM
+ local junk_requestid=$(openssl rand -base64 50 | perl -p -e 's/\n//')
local temp_cert_out="$TmpDir/cert-request.out"
local hex_invalid_upp_reqid=$(echo "obase=16;$invalid_requestid"|bc)
local hex_invalid_requestid=0x"${hex_invalid_upp_reqid,,}"
@@ -79,7 +79,7 @@ run_pki-ca-cert-request-show-ca_tests()
local target_https_port=$(eval echo \$${CA_INST}_SECURE_PORT)
local tmp_ca_host=$(eval echo \$${cs_Role})
local target_host=$(eval echo \$${cs_Role})
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local profile=caUserCert
diff --git a/tests/dogtag/acceptance/cli-tests/pki-ca-cert-cli/pki-ca-cert-cli-request-submit-ca.sh b/tests/dogtag/acceptance/cli-tests/pki-ca-cert-cli/pki-ca-cert-cli-request-submit-ca.sh
index d2353c563..597cc97e4 100755
--- a/tests/dogtag/acceptance/cli-tests/pki-ca-cert-cli/pki-ca-cert-cli-request-submit-ca.sh
+++ b/tests/dogtag/acceptance/cli-tests/pki-ca-cert-cli/pki-ca-cert-cli-request-submit-ca.sh
@@ -58,7 +58,7 @@ run_pki-ca-cert-request-submit_tests()
#local variables
get_topo_stack $cs_Role $TmpDir/topo_file
local CA_INST=$(cat $TmpDir/topo_file | grep MY_CA | cut -d= -f2)
- local invalid_serialNumber=$(cat /dev/urandom | tr -dc '1-9' | fold -w 10 | head -n 1)
+ local invalid_serialNumber=$RANDOM
local invalid_hex_serialNumber=0x$(echo "ibase=16;$invalid_serialNumber"|bc)
local CA_agentV_user=$CA_INST\_agentV
local CA_auditV_user=$CA_INST\_auditV
@@ -73,7 +73,7 @@ run_pki-ca-cert-request-submit_tests()
local crmf_reqstatus
local crmf_requestid
local decimal_valid_serialNumber
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local cert_req_info="$TmpDir/cert_req_info.out"
local target_host=$(eval echo \$${cs_Role})
local target_port=$(eval echo \$${CA_INST}_UNSECURE_PORT)
@@ -358,7 +358,7 @@ run_pki-ca-cert-request-submit_tests()
rlPhaseEnd
rlPhaseStartTest "pki_ca_cert_request_submit-009: Submit a request using invalid xml file"
- local invalid_data=$(cat /dev/urandom | tr -dc '0-9a-zA-Z' | fold -w 9000 | head -n 1)
+ local invalid_data=$(openssl rand -base64 50 | perl -p -e 's/\n//')
rlRun "echo $invalid_data > $TmpDir/$rand-cert-profile.xml"
rlRun "pki -h $target_host -p $target_port ca-cert-request-submit $TmpDir/$rand-cert-profile.xml 2> $TmpDir/pki-ca-cert-request-submit.out" 255
rlAssertGrep "Error: null" "$TmpDir/pki-ca-cert-request-submit.out"
diff --git a/tests/dogtag/acceptance/cli-tests/pki-ca-cert-cli/pki-ca-cert-cli-revoke-ca.sh b/tests/dogtag/acceptance/cli-tests/pki-ca-cert-cli/pki-ca-cert-cli-revoke-ca.sh
index d919f27ff..ec7fff514 100755
--- a/tests/dogtag/acceptance/cli-tests/pki-ca-cert-cli/pki-ca-cert-cli-revoke-ca.sh
+++ b/tests/dogtag/acceptance/cli-tests/pki-ca-cert-cli/pki-ca-cert-cli-revoke-ca.sh
@@ -60,11 +60,11 @@ run_pki-ca-cert-revoke-ca_tests()
local CA_adminR_user=$CA_INST\_adminR
local CA_adminE_user=$CA_INST\_adminE
local CA_agentE_user=$CA_INST\_agentE
- local invalid_serialNumber=$(cat /dev/urandom | tr -dc '1-9' | fold -w 10 | head -n 1)
+ local invalid_serialNumber=$RANDOM
local invalid_hex_serialNumber=0x$(echo "ibase=16;$invalid_serialNumber"|bc)
local pkcs10_reqstatus
local pkcs10_requestid
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local sub_ca_ldap_port=1800
local sub_ca_http_port=14080
local sub_ca_https_port=14443
diff --git a/tests/dogtag/acceptance/cli-tests/pki-ca-cert-cli/pki-ca-cert-cli-show-ca.sh b/tests/dogtag/acceptance/cli-tests/pki-ca-cert-cli/pki-ca-cert-cli-show-ca.sh
index 12c6a1ba6..1db97969d 100755
--- a/tests/dogtag/acceptance/cli-tests/pki-ca-cert-cli/pki-ca-cert-cli-show-ca.sh
+++ b/tests/dogtag/acceptance/cli-tests/pki-ca-cert-cli/pki-ca-cert-cli-show-ca.sh
@@ -64,7 +64,7 @@ run_pki-ca-cert-show-ca_tests()
local CA_adminR_user=$CA_INST\_adminR
local CA_adminE_user=$CA_INST\_adminE
local CA_agentE_user=$CA_INST\_agentE
- local invalid_serialNumber=$(cat /dev/urandom | tr -dc '1-9' | fold -w 10 | head -n 1)
+ local invalid_serialNumber=$RANDOM
local invalid_hex_serialNumber=0x$(echo "ibase=16;$invalid_serialNumber"|bc)
local pkcs10_reqstatus
local pkcs10_requestid
@@ -84,7 +84,7 @@ run_pki-ca-cert-show-ca_tests()
local i18n_user4="kakskümmend_üks"
local i18n_user5_fullname="двадцять один тридцять"
local i18n_user5="двадцять_один_тридцять"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local junk="axb124?$5@@_%^$#$@\!(_)043112321412321"
local cert_req_info="$TmpDir/cert_req_info.out"
local target_port=$(eval echo \$${CA_INST}_UNSECURE_PORT)