Merge
authordsamersoff
Tue, 04 Aug 2015 19:25:59 +0000
changeset 32218 c4a59b9f5c12
parent 32217 56f5aebb508e (current diff)
parent 32216 653e7ee1fea8 (diff)
child 32220 602c828cf7dc
Merge
--- a/jdk/test/com/sun/management/OperatingSystemMXBean/TestTotalSwap.java	Tue Aug 04 18:11:40 2015 +0300
+++ b/jdk/test/com/sun/management/OperatingSystemMXBean/TestTotalSwap.java	Tue Aug 04 19:25:59 2015 +0000
@@ -73,6 +73,8 @@
     private static final long MAX_SIZE_FOR_PASS = Long.MAX_VALUE;
 
     public static void main(String args[]) throws Throwable {
+        // yocto might ignore the request to report swap size in bytes
+        boolean swapInKB = mbean.getVersion().contains("yocto");
 
         long expected_swap_size = getSwapSizeFromOs();
 
@@ -87,10 +89,13 @@
 
         if (expected_swap_size > -1) {
             if (size != expected_swap_size) {
-                throw new RuntimeException("Expected total swap size      : " +
-                                           expected_swap_size +
-                                           " but getTotalSwapSpaceSize returned: " +
-                                           size);
+                // try the expected size in kiloBytes
+                if (!(swapInKB && expected_swap_size * 1024 == size)) {
+                    throw new RuntimeException("Expected total swap size      : " +
+                                               expected_swap_size +
+                                               " but getTotalSwapSpaceSize returned: " +
+                                               size);
+                }
             }
         }