8194869: [TESTBUG][aix, s390] Adapt tests to platforms

Reviewed-by: mbaesken, simonis, dholmes, serb
diff --git a/test/failure_handler/src/share/classes/jdk/test/failurehandler/jtreg/OS.java b/test/failure_handler/src/share/classes/jdk/test/failurehandler/jtreg/OS.java
index ccc1861..354c636 100644
--- a/test/failure_handler/src/share/classes/jdk/test/failurehandler/jtreg/OS.java
+++ b/test/failure_handler/src/share/classes/jdk/test/failurehandler/jtreg/OS.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -38,7 +38,9 @@
     }
 
     private OS(String name) {
-        if (name.startsWith("Linux")) {
+        if (name.startsWith("AIX")) {
+            family = "aix";
+        } else if (name.startsWith("Linux")) {
             family = "linux";
         } else if (name.startsWith("Mac") || name.startsWith("Darwin")) {
             family = "mac";
diff --git a/test/jdk/java/awt/FontClass/CreateFont/fileaccess/TestFontFile.sh b/test/jdk/java/awt/FontClass/CreateFont/fileaccess/TestFontFile.sh
index 860a946..46c1bde 100644
--- a/test/jdk/java/awt/FontClass/CreateFont/fileaccess/TestFontFile.sh
+++ b/test/jdk/java/awt/FontClass/CreateFont/fileaccess/TestFontFile.sh
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -46,7 +46,7 @@
 # set platform-dependent variables
 OS=`uname -s`
 case "$OS" in
-  SunOS | Linux | Darwin )
+  AIX | Darwin | Linux | SunOS )
     NULL=/dev/null
     PS=":"
     FS="/"
diff --git a/test/jdk/java/awt/JAWT/JAWT.sh b/test/jdk/java/awt/JAWT/JAWT.sh
index df47003..20ffc27 100644
--- a/test/jdk/java/awt/JAWT/JAWT.sh
+++ b/test/jdk/java/awt/JAWT/JAWT.sh
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -62,6 +62,10 @@
 	MAKE="make"
 	LD_LIBRARY_PATH="."
     ;;
+  AIX )
+      echo "Test passed. Not supported on AIX."
+      exit 0
+    ;;
   SunOS )
     NULL=/dev/null
     PS=":"
diff --git a/test/jdk/java/awt/Toolkit/AutoShutdown/EventQueuePush/EventQueuePushAutoshutdown.sh b/test/jdk/java/awt/Toolkit/AutoShutdown/EventQueuePush/EventQueuePushAutoshutdown.sh
index 5ebb6c6..70efdc6 100644
--- a/test/jdk/java/awt/Toolkit/AutoShutdown/EventQueuePush/EventQueuePushAutoshutdown.sh
+++ b/test/jdk/java/awt/Toolkit/AutoShutdown/EventQueuePush/EventQueuePushAutoshutdown.sh
@@ -1,7 +1,7 @@
 #!/bin/ksh -p
 
 #
-# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -60,7 +60,7 @@
 # The beginning of the script proper
 OS=`uname -s`
 case "$OS" in
-   SunOS | Linux | Darwin | CYGWIN* )
+   AIX | CYGWIN* | Darwin | Linux | SunOS )
       FILESEP="/"
       ;;
 
diff --git a/test/jdk/java/awt/Toolkit/Headless/WrappedToolkitTest/WrappedToolkitTest.sh b/test/jdk/java/awt/Toolkit/Headless/WrappedToolkitTest/WrappedToolkitTest.sh
index 714d100..ef1545a 100644
--- a/test/jdk/java/awt/Toolkit/Headless/WrappedToolkitTest/WrappedToolkitTest.sh
+++ b/test/jdk/java/awt/Toolkit/Headless/WrappedToolkitTest/WrappedToolkitTest.sh
@@ -1,7 +1,7 @@
 #!/bin/ksh -p
 
 #
-# Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -59,7 +59,7 @@
 # Checking for proper OS
 OS=`uname -s`
 case "$OS" in
-   SunOS | Linux | Darwin | CYGWIN* )
+   AIX | CYGWIN* | Darwin | Linux | SunOS )
       FILESEP="/"
       ;;
     
@@ -172,7 +172,7 @@
     fi
     ;;
 
-  SunOS | Linux )
+  AIX | Linux | SunOS )
     ${TESTJAVA}/bin/java ${TESTVMOPTS} -Djava.awt.headless=true \
                          --add-opens java.desktop/sun.awt=ALL-UNNAMED \
                          --add-opens java.desktop/sun.awt.X11=ALL-UNNAMED ${CP} \
diff --git a/test/jdk/javax/imageio/spi/AppletContextTest/BadPluginConfigurationTest.sh b/test/jdk/javax/imageio/spi/AppletContextTest/BadPluginConfigurationTest.sh
index f70099a..0eb1688 100644
--- a/test/jdk/javax/imageio/spi/AppletContextTest/BadPluginConfigurationTest.sh
+++ b/test/jdk/javax/imageio/spi/AppletContextTest/BadPluginConfigurationTest.sh
@@ -1,5 +1,5 @@
 #!/bin/ksh -p
-# Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -86,8 +86,24 @@
 
 # Checking for proper OS
 OS=`uname -s`
+MKTEMP="mktemp"
 case "$OS" in
-   SunOS | Linux | Darwin )
+   AIX )
+      FILESEP="/"
+      PATHSEP=":"
+      TMP=`cd /tmp; pwd -P`
+
+      type ${MKTEMP} > /dev/null 2>&1
+
+      if ! [ $? -ne 0 ] ; then 
+        MKTEMP="/opt/freeware/bin/mktemp"
+      fi
+      if ! [ -e ${MKTEMP} ] ; then 
+        pass "Test skipped because no mktemp found on this machine"
+      fi
+      ;;
+
+   Darwin | Linux | SunOS )
       FILESEP="/"
       PATHSEP=":"
       TMP=`cd /tmp; pwd -P`
@@ -180,7 +196,7 @@
 # app have file read permission for all subdirs of the
 # scratch dir
 
-PLUGINDST_DIR=$(mktemp -d ${TMP}/iio_test.XXXXXXXX)
+PLUGINDST_DIR=$(${MKTEMP} -d ${TMP}/iio_test.XXXXXXXX)
 echo "Created PLUGINDST_DIR as ${PLUGINDST_DIR}"
 
 TEST_PLUGIN=dummy.jar
diff --git a/test/jdk/sun/security/mscapi/ShortRSAKey1024.sh b/test/jdk/sun/security/mscapi/ShortRSAKey1024.sh
index 6cad182..67f5ecb 100644
--- a/test/jdk/sun/security/mscapi/ShortRSAKey1024.sh
+++ b/test/jdk/sun/security/mscapi/ShortRSAKey1024.sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 #
-# Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -50,7 +50,7 @@
 
 OS=`uname -s`
 case "$OS" in
-  SunOS | Linux | Darwin | CYGWIN* )
+  AIX | CYGWIN* | Darwin | Linux | SunOS )
     FS="/"
     ;;
   Windows_* )
diff --git a/test/jdk/sun/security/pkcs11/PKCS11Test.java b/test/jdk/sun/security/pkcs11/PKCS11Test.java
index 49d0a0e..531e8af 100644
--- a/test/jdk/sun/security/pkcs11/PKCS11Test.java
+++ b/test/jdk/sun/security/pkcs11/PKCS11Test.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -624,6 +624,7 @@
             "/usr/lib64/"});
         osMap.put("Linux-ppc64-64", new String[]{"/usr/lib64/"});
         osMap.put("Linux-ppc64le-64", new String[]{"/usr/lib64/"});
+        osMap.put("Linux-s390x-64", new String[]{"/usr/lib64/"});
         osMap.put("Windows-x86-32", new String[]{
             PKCS11_BASE + "/nss/lib/windows-i586/".replace('/', SEP)});
         osMap.put("Windows-amd64-64", new String[]{
diff --git a/test/jdk/sun/security/tools/keytool/i18n.sh b/test/jdk/sun/security/tools/keytool/i18n.sh
index b363a7f..72fb336 100644
--- a/test/jdk/sun/security/tools/keytool/i18n.sh
+++ b/test/jdk/sun/security/tools/keytool/i18n.sh
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -44,7 +44,7 @@
 # set platform-dependent variables
 OS=`uname -s`
 case "$OS" in
-  SunOS | Linux | Darwin )
+  AIX | Darwin | Linux | SunOS )
     NULL=/dev/null
     PS=":"
     FS="/"