summaryrefslogtreecommitdiffstats
path: root/tests/dogtag/acceptance/cli-tests/pki-user-cli/ca/pki-user-cli-user-add-ca.sh
diff options
context:
space:
mode:
authorAsha Akkiangady <aakkiang@redhat.com>2014-12-06 08:13:56 -0500
committerAsha Akkiangady <aakkiang@redhat.com>2014-12-06 08:19:26 -0500
commit713f1840695c684a63898e29524946c01f1d55a0 (patch)
tree744e1f2738b54978e49abd03ef2095a8c8889c16 /tests/dogtag/acceptance/cli-tests/pki-user-cli/ca/pki-user-cli-user-add-ca.sh
parent7ed1c2e78f7531821c7e5a998b97ee1b7fb6b5a8 (diff)
downloadpki-713f1840695c684a63898e29524946c01f1d55a0.tar.gz
pki-713f1840695c684a63898e29524946c01f1d55a0.tar.xz
pki-713f1840695c684a63898e29524946c01f1d55a0.zip
CLI user-add and ca-user-add tests modified
to have random strings generated with openssl rand and $RANDOM.
Diffstat (limited to 'tests/dogtag/acceptance/cli-tests/pki-user-cli/ca/pki-user-cli-user-add-ca.sh')
-rwxr-xr-xtests/dogtag/acceptance/cli-tests/pki-user-cli/ca/pki-user-cli-user-add-ca.sh32
1 files changed, 24 insertions, 8 deletions
diff --git a/tests/dogtag/acceptance/cli-tests/pki-user-cli/ca/pki-user-cli-user-add-ca.sh b/tests/dogtag/acceptance/cli-tests/pki-user-cli/ca/pki-user-cli-user-add-ca.sh
index c149083d1..a07556ab7 100755
--- a/tests/dogtag/acceptance/cli-tests/pki-user-cli/ca/pki-user-cli-user-add-ca.sh
+++ b/tests/dogtag/acceptance/cli-tests/pki-user-cli/ca/pki-user-cli-user-add-ca.sh
@@ -120,7 +120,8 @@ run_pki-user-cli-user-add-ca_tests(){
rlPhaseEnd
rlPhaseStartTest "pki_user_cli_user_add-CA-002:maximum length of user id"
- user2=`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 2048 | head -n 1`
+ user2=$(openssl rand -base64 30000 | strings | grep -io [[:alnum:]] | head -n 2047 | tr -d '\n')
+ rlLog "user2=$user2"
rlRun "pki -d $CERTDB_DIR \
-n ${prefix}_adminV \
-c $CERTDB_DIR_PASSWORD \
@@ -215,7 +216,7 @@ run_pki-user-cli-user-add-ca_tests(){
rlPhaseEnd
rlPhaseStartTest "pki_user_cli_user_add-CA-008:--email with maximum length"
- email=`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 2048 | head -n 1`
+ email=$(openssl rand -base64 30000 | strings | grep -io [[:alnum:]] | head -n 2047 | tr -d '\n')
rlRun "pki -d $CERTDB_DIR \
-n ${prefix}_adminV \
-c $CERTDB_DIR_PASSWORD \
@@ -237,7 +238,10 @@ run_pki-user-cli-user-add-ca_tests(){
rlPhaseEnd
rlPhaseStartTest "pki_user_cli_user_add-CA-009:--email with maximum length and symbols"
- email=`cat /dev/urandom | tr -dc 'a-zA-Z0-9!?@~#*^_+$' | fold -w 2048 | head -n 1`
+ specialcharacters="!?@~#*^_+$"
+ email=$(openssl rand -base64 30000 | strings | grep -io [[:alnum:]] | head -n 2037 | tr -d '\n')
+ email=$email$specialcharacters
+ rlLog "email=$email"
rlRun "pki -d $CERTDB_DIR \
-n ${prefix}_adminV \
-c $CERTDB_DIR_PASSWORD \
@@ -319,7 +323,7 @@ run_pki-user-cli-user-add-ca_tests(){
rlPhaseEnd
rlPhaseStartTest "pki_user_cli_user_add-CA-014:--state with maximum length"
- state=`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 2048 | head -n 1`
+ state=$(openssl rand -base64 30000 | strings | grep -io [[:alnum:]] | head -n 2047 | tr -d '\n')
rlRun "pki -d $CERTDB_DIR \
-n ${prefix}_adminV \
-c $CERTDB_DIR_PASSWORD \
@@ -341,7 +345,10 @@ run_pki-user-cli-user-add-ca_tests(){
rlPhaseEnd
rlPhaseStartTest "pki_user_cli_user_add-CA-015:--state with maximum length and symbols"
- state=`cat /dev/urandom | tr -dc 'a-zA-Z0-9!?@~#*^_+$' | fold -w 2048 | head -n 1`
+ specialcharacters="!?@~#*^_+$"
+ state=$(openssl rand -base64 30000 | strings | grep -io [[:alnum:]] | head -n 2037 | tr -d '\n')
+ state=$state$specialcharacters
+ rlLog "state=$state"
rlRun "pki -d $CERTDB_DIR \
-n ${prefix}_adminV \
-c $CERTDB_DIR_PASSWORD \
@@ -423,7 +430,14 @@ run_pki-user-cli-user-add-ca_tests(){
rlPhaseEnd
rlPhaseStartTest "pki_user_cli_user_add-CA-020:--phone with maximum length"
- phone=`cat /dev/urandom | tr -dc '0-9' | fold -w 2048 | head -n 1`
+ phone=`echo $RANDOM`
+ stringlength=0
+ while [[ $stringlength -lt 2049 ]] ; do
+ phone="$phone$RANDOM"
+ stringlength=`echo $phone | wc -m`
+ done
+ phone=`echo $phone | cut -c1-2047`
+ rlLog "phone=$phone"
rlRun "pki -d $CERTDB_DIR \
-n ${prefix}_adminV \
-c $CERTDB_DIR_PASSWORD \
@@ -439,7 +453,9 @@ run_pki-user-cli-user-add-ca_tests(){
rlPhaseEnd
rlPhaseStartTest "pki_user_cli_user_add-CA-021:--phone with maximum length and symbols"
- phone=`cat /dev/urandom | tr -dc 'a-zA-Z0-9!?@~#*^_+$' | fold -w 2048 | head -n 1`
+ specialcharacters="!?@~#*^_+$"
+ phone=$(openssl rand -base64 30000 | strings | grep -io [[:alnum:]] | head -n 2037 | tr -d '\n')
+ phone=$state$specialcharacters
rlRun "pki -d $CERTDB_DIR \
-n ${prefix}_adminV \
-c $CERTDB_DIR_PASSWORD \
@@ -973,7 +989,7 @@ run_pki-user-cli-user-add-ca_tests(){
rlPhaseEnd
rlPhaseStartTest "pki_user_cli_user_add-CA-050: user id length exceeds maximum limit defined in the schema"
- user_length_exceed_max=`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 10000 | head -n 1`
+ user_length_exceed_max=$(openssl rand -base64 80000 | strings | grep -io [[:alnum:]] | head -n 10000 | tr -d '\n')
rlLog "pki -d $CERTDB_DIR \
-n ${prefix}_adminV \
-c $CERTDB_DIR_PASSWORD \