Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/test/jdk/sun/security/pkcs11/Provider/MultipleLogins.sh
51712 views
1
#
2
# Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
#
5
# This code is free software; you can redistribute it and/or modify it
6
# under the terms of the GNU General Public License version 2 only, as
7
# published by the Free Software Foundation.
8
#
9
# This code is distributed in the hope that it will be useful, but WITHOUT
10
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12
# version 2 for more details (a copy is included in the LICENSE file that
13
# accompanied this code).
14
#
15
# You should have received a copy of the GNU General Public License version
16
# 2 along with this work; if not, write to the Free Software Foundation,
17
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18
#
19
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20
# or visit www.oracle.com if you need additional information or have any
21
# questions.
22
#
23
24
# @test
25
# @bug 7777777
26
# @summary
27
# @library /test/lib/
28
# @build jdk.test.lib.util.ForceGC
29
# @run shell MultipleLogins.sh
30
31
# set a few environment variables so that the shell-script can run stand-alone
32
# in the source directory
33
34
# if running by hand on windows, change TESTSRC and TESTCLASSES to "."
35
if [ "${TESTSRC}" = "" ] ; then
36
TESTSRC=`pwd`
37
fi
38
if [ "${TESTCLASSES}" = "" ] ; then
39
TESTCLASSES=`pwd`
40
fi
41
42
if [ "${TESTCLASSPATH}" = "" ] ; then
43
TESTCLASSPATH=`pwd`
44
fi
45
46
if [ "${COMPILEJAVA}" = "" ]; then
47
COMPILEJAVA="${TESTJAVA}"
48
fi
49
echo TESTSRC=${TESTSRC}
50
echo TESTCLASSES=${TESTCLASSES}
51
echo TESTJAVA=${TESTJAVA}
52
echo COMPILEJAVA=${COMPILEJAVA}
53
echo ""
54
55
# let java test exit if platform unsupported
56
57
OS=`uname -s`
58
case "$OS" in
59
Linux )
60
FS="/"
61
PS=":"
62
CP="${FS}bin${FS}cp"
63
CHMOD="${FS}bin${FS}chmod"
64
;;
65
Darwin )
66
FS="/"
67
PS=":"
68
CP="${FS}bin${FS}cp"
69
CHMOD="${FS}bin${FS}chmod"
70
;;
71
AIX )
72
FS="/"
73
PS=":"
74
CP="${FS}bin${FS}cp"
75
CHMOD="${FS}bin${FS}chmod"
76
;;
77
Windows* )
78
FS="\\"
79
PS=";"
80
CP="cp"
81
CHMOD="chmod"
82
;;
83
CYGWIN* )
84
FS="/"
85
PS=";"
86
CP="cp"
87
CHMOD="chmod"
88
#
89
# javac does not like /cygdrive produced by `pwd`
90
#
91
TESTSRC=`cygpath -d ${TESTSRC}`
92
;;
93
* )
94
echo "Unrecognized system!"
95
exit 1;
96
;;
97
esac
98
99
# first make cert/key DBs writable
100
101
${CP} ${TESTSRC}${FS}..${FS}nss${FS}db${FS}cert8.db ${TESTCLASSES}
102
${CHMOD} +w ${TESTCLASSES}${FS}cert8.db
103
104
${CP} ${TESTSRC}${FS}..${FS}nss${FS}db${FS}key3.db ${TESTCLASSES}
105
${CHMOD} +w ${TESTCLASSES}${FS}key3.db
106
107
# compile test
108
${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} \
109
-classpath ${TESTCLASSPATH} \
110
-d ${TESTCLASSES} \
111
--add-modules jdk.crypto.cryptoki \
112
--add-exports jdk.crypto.cryptoki/sun.security.pkcs11=ALL-UNNAMED \
113
${TESTSRC}${FS}..${FS}..${FS}..${FS}..${FS}..${FS}lib${FS}jdk${FS}test${FS}lib${FS}artifacts${FS}*.java \
114
${TESTSRC}${FS}MultipleLogins.java \
115
${TESTSRC}${FS}..${FS}PKCS11Test.java
116
117
# run test
118
${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} \
119
-classpath ${TESTCLASSPATH} \
120
--add-modules jdk.crypto.cryptoki \
121
--add-exports jdk.crypto.cryptoki/sun.security.pkcs11=ALL-UNNAMED \
122
-DCUSTOM_DB_DIR=${TESTCLASSES} \
123
-DCUSTOM_P11_CONFIG=${TESTSRC}${FS}MultipleLogins-nss.txt \
124
-DNO_DEFAULT=true \
125
-DNO_DEIMOS=true \
126
-Dtest.src=${TESTSRC} \
127
-Dtest.classes=${TESTCLASSES} \
128
-Djava.security.debug=${DEBUG} \
129
MultipleLogins
130
131
# save error status
132
status=$?
133
134
# return
135
exit $status
136
137