@@ -178,45 +178,14 @@ public static void main(PKCS11Test test, String[] args) throws Exception {
178
178
Provider [] oldProviders = Security .getProviders ();
179
179
try {
180
180
System .out .println ("Beginning test run " + test .getClass ().getName () + "..." );
181
- boolean skippedDefault = false ;
182
- boolean skippedNSS = false ;
183
- boolean skippedDeimos = false ;
184
-
185
- // Use separate try-catch for each test to allow all test run
186
- try {
187
- testDefault (test );
188
- } catch (SkippedException se ) {
189
- System .out .println ("testDefault: Skipped" );
190
- skippedDefault = true ;
191
- se .printStackTrace (System .out );
192
- }
193
-
194
- try {
195
- testNSS (test );
196
- } catch (SkippedException se ) {
197
- System .out .println ("testNSS: Skipped" );
198
- skippedNSS = true ;
199
- se .printStackTrace (System .out );
200
- }
201
-
202
- try {
203
- testDeimos (test );
204
- } catch (SkippedException se ) {
205
- System .out .println ("testDeimos: Skipped" );
206
- skippedDeimos = true ;
207
- se .printStackTrace (System .out );
208
- }
209
-
210
- if (skippedDefault && skippedNSS && skippedDeimos ) {
211
- throw new SkippedException ("All tests are skipped, check logs" );
212
- }
181
+ testNSS (test );
213
182
214
183
} finally {
215
184
// NOTE: Do not place a 'return' in any finally block
216
185
// as it will suppress exceptions and hide test failures.
217
186
Provider [] newProviders = Security .getProviders ();
218
187
boolean found = true ;
219
- // Do not restore providers if nothing changed. This is especailly
188
+ // Do not restore providers if nothing changed. This is especially
220
189
// useful for ./Provider/Login.sh, where a SecurityManager exists.
221
190
if (oldProviders .length == newProviders .length ) {
222
191
found = false ;
@@ -238,51 +207,6 @@ public static void main(PKCS11Test test, String[] args) throws Exception {
238
207
}
239
208
}
240
209
241
- public static void testDeimos (PKCS11Test test ) throws Exception {
242
- System .out .println ("===> testDeimos: Starting test run" );
243
- if ("true" .equals (System .getProperty ("NO_DEIMOS" ))) {
244
- System .out .println ("Skip Deimos software as test configured with NO_DEIMOS" );
245
- return ;
246
- }
247
-
248
- if (!new File ("/opt/SUNWconn/lib/libpkcs11.so" ).isFile ()) {
249
- throw new SkippedException ("testDeimos: \" /opt/SUNWconn/lib/libpkcs11.so\" " +
250
- "file required for Deimos not found" );
251
- }
252
-
253
- String base = getBase ();
254
- String p11config = base + SEP + "nss" + SEP + "p11-deimos.txt" ;
255
- Provider p = getSunPKCS11 (p11config );
256
- test .premain (p );
257
- System .out .println ("testDeimos: Completed" );
258
- }
259
-
260
- // Run test for default configured PKCS11 providers (if any)
261
- public static void testDefault (PKCS11Test test ) throws Exception {
262
- System .out .println ("===> testDefault: Starting test run" );
263
- boolean foundPKCS11 = false ;
264
-
265
- if ("true" .equals (System .getProperty ("NO_DEFAULT" ))) {
266
- System .out .println ("Skip default provider as test configured with NO_DEFAULT" );
267
- return ;
268
- }
269
-
270
- Provider [] providers = Security .getProviders ();
271
- for (Provider p : providers ) {
272
- if (p .getName ().startsWith ("SunPKCS11-" )) {
273
- foundPKCS11 = true ;
274
- test .premain (p );
275
- }
276
- }
277
-
278
- if (!foundPKCS11 ) {
279
- throw new SkippedException ("testDefault: Skip default test as SunPKCS11 " +
280
- "provider is not configured" );
281
- }
282
-
283
- System .out .println ("testDefault: Completed" );
284
- }
285
-
286
210
public static String getBase () throws Exception {
287
211
if (PKCS11_BASE != null ) {
288
212
return PKCS11_BASE ;
@@ -913,8 +837,6 @@ <T> T[] concat(T[] a, T[] b) {
913
837
914
838
protected void setCommonSystemProps () {
915
839
System .setProperty ("java.security.debug" , "true" );
916
- System .setProperty ("NO_DEIMOS" , "true" );
917
- System .setProperty ("NO_DEFAULT" , "true" );
918
840
System .setProperty ("CUSTOM_DB_DIR" , TEST_CLASSES );
919
841
}
920
842
1 commit comments
openjdk-notifier[bot] commentedon Jan 25, 2024
Review
Issues