changeset 8231:a476addbc2a4 jdk7u79-b10

8041740: Test sun/security/tools/keytool/ListKeychainStore.sh fails on Mac Reviewed-by: mullan
author vinnie
date Thu, 12 Feb 2015 18:29:00 +0000
parents 358f1ba5749f
children 994e555b3160
files test/sun/security/tools/keytool/ListKeychainStore.sh
diffstat 1 files changed, 12 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/test/sun/security/tools/keytool/ListKeychainStore.sh	Wed Feb 11 15:27:03 2015 +0300
+++ b/test/sun/security/tools/keytool/ListKeychainStore.sh	Thu Feb 12 18:29:00 2015 +0000
@@ -22,7 +22,7 @@
 #
 
 # @test
-# @bug 7133495
+# @bug 7133495 8041740
 # @summary [macosx] KeyChain KeyStore implementation retrieves only one private key entry
 
 if [ "${TESTJAVA}" = "" ] ; then
@@ -49,8 +49,10 @@
 KEYTOOL="${TESTJAVA}/bin/keytool -storetype KeychainStore -keystore NONE -storepass $PWD"
 TEMPORARY_P12="$TESTCLASSES/7133495.p12"
 TEMPORARY_KC="$TESTCLASSES/7133495.keychain"
+TEMPORARY_LIST="$TESTCLASSES/7133495.tmp"
 CLEANUP_P12="rm -f $TEMPORARY_P12"
 CLEANUP_KC="security delete-keychain $TEMPORARY_KC"
+CLEANUP_LIST="rm -f $TEMPORARY_LIST"
 
 # Count the number of private key entries in the Keychain keystores
 
@@ -115,6 +117,15 @@
 fi
 echo "Imported keypairs from PKCS12 keystore into the keychain"
 
+# Adjust the keychain search order
+
+echo "\"$TEMPORARY_KC\"" > $TEMPORARY_LIST
+security list-keychains >> $TEMPORARY_LIST
+security list-keychains -s `xargs < ${TEMPORARY_LIST}`
+`$CLEANUP_LIST`
+echo "Temporary keychain search order:"
+security list-keychains
+
 # Recount the number of private key entries in the Keychain keystores
 
 COUNT=`$KEYTOOL -list | grep PrivateKeyEntry | wc -l`