jdk/test/com/sun/management/OperatingSystemMXBean/TestTotalSwap.java
author jbachorik
Mon, 16 Feb 2015 10:53:49 +0100
changeset 29104 e3a6844eed40
parent 5506 jdk/test/com/sun/management/OperatingSystemMXBean/GetTotalSwapSpaceSize.java@202f599c92aa
child 30376 2ccf2cf7ea48
permissions -rw-r--r--
8072908: com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh fails on OS X with exit code 2 Reviewed-by: dholmes, sla
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
29104
e3a6844eed40 8072908: com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh fails on OS X with exit code 2
jbachorik
parents: 5506
diff changeset
     2
 * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    21
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
/*
29104
e3a6844eed40 8072908: com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh fails on OS X with exit code 2
jbachorik
parents: 5506
diff changeset
    25
 * @test
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
 * @bug     4858522
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
 * @summary Basic unit test of OperatingSystemMXBean.getTotalSwapSpaceSize()
29104
e3a6844eed40 8072908: com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh fails on OS X with exit code 2
jbachorik
parents: 5506
diff changeset
    28
 *
e3a6844eed40 8072908: com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh fails on OS X with exit code 2
jbachorik
parents: 5506
diff changeset
    29
 * @library /lib/testlibrary
e3a6844eed40 8072908: com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh fails on OS X with exit code 2
jbachorik
parents: 5506
diff changeset
    30
 * @build TestTotalSwap jdk.testlibrary.*
e3a6844eed40 8072908: com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh fails on OS X with exit code 2
jbachorik
parents: 5506
diff changeset
    31
 * @run main TestTotalSwap
e3a6844eed40 8072908: com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh fails on OS X with exit code 2
jbachorik
parents: 5506
diff changeset
    32
 *
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
 * @author  Steve Bohne
29104
e3a6844eed40 8072908: com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh fails on OS X with exit code 2
jbachorik
parents: 5506
diff changeset
    34
 * @author  Jaroslav Bachorik
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
 * This test tests the actual swap size on linux and solaris.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
 * The correct value should be checked manually:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
 * Solaris:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
 *   1. In a shell, enter the command: "swap -l"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
 *   2. The value (reported in blocks) is in the "blocks" column.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
 * Linux:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
 *   1. In a shell, enter the command: "cat /proc/meminfo"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
 *   2. The value (reported in bytes) is in "Swap" entry, "total" column.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
 * Windows NT/XP/2000:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
 *   1. Run Start->Accessories->System Tools->System Information.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
 *   2. The value (reported in Kbytes) is in the "Page File Space" entry
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
 * Windows 98/ME:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
 *   Unknown.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
 * Usage: GetTotalSwapSpaceSize <expected swap size | "sanity-only"> [trace]
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
import com.sun.management.OperatingSystemMXBean;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
import java.lang.management.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
29104
e3a6844eed40 8072908: com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh fails on OS X with exit code 2
jbachorik
parents: 5506
diff changeset
    58
import jdk.testlibrary.OSInfo;
e3a6844eed40 8072908: com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh fails on OS X with exit code 2
jbachorik
parents: 5506
diff changeset
    59
import jdk.testlibrary.ProcessTools;
e3a6844eed40 8072908: com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh fails on OS X with exit code 2
jbachorik
parents: 5506
diff changeset
    60
import jdk.testlibrary.OutputAnalyzer;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
29104
e3a6844eed40 8072908: com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh fails on OS X with exit code 2
jbachorik
parents: 5506
diff changeset
    62
public class TestTotalSwap {
e3a6844eed40 8072908: com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh fails on OS X with exit code 2
jbachorik
parents: 5506
diff changeset
    63
e3a6844eed40 8072908: com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh fails on OS X with exit code 2
jbachorik
parents: 5506
diff changeset
    64
    private static final OperatingSystemMXBean mbean =
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
        (com.sun.management.OperatingSystemMXBean)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
        ManagementFactory.getOperatingSystemMXBean();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
    // Careful with these values.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
    // Min size for pass dynamically determined below.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
    // zero if no swap space is configured.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
    private static long       min_size_for_pass = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
    private static final long MAX_SIZE_FOR_PASS = Long.MAX_VALUE;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
29104
e3a6844eed40 8072908: com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh fails on OS X with exit code 2
jbachorik
parents: 5506
diff changeset
    74
    public static void main(String args[]) throws Throwable {
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
29104
e3a6844eed40 8072908: com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh fails on OS X with exit code 2
jbachorik
parents: 5506
diff changeset
    76
        long expected_swap_size = getSwapSizeFromOs();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
        long min_size = mbean.getFreeSwapSpaceSize();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
        if (min_size > 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
            min_size_for_pass = min_size;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
        long size = mbean.getTotalSwapSpaceSize();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
29104
e3a6844eed40 8072908: com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh fails on OS X with exit code 2
jbachorik
parents: 5506
diff changeset
    85
        System.out.println("Total swap space size in bytes: " + size);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
29104
e3a6844eed40 8072908: com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh fails on OS X with exit code 2
jbachorik
parents: 5506
diff changeset
    87
        if (expected_swap_size > -1) {
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
            if (size != expected_swap_size) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
                throw new RuntimeException("Expected total swap size      : " +
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
                                           expected_swap_size +
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
                                           " but getTotalSwapSpaceSize returned: " +
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
                                           size);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
29104
e3a6844eed40 8072908: com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh fails on OS X with exit code 2
jbachorik
parents: 5506
diff changeset
    96
        // sanity check
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
        if (size < min_size_for_pass || size > MAX_SIZE_FOR_PASS) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
            throw new RuntimeException("Total swap space size " +
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
                                       "illegal value: " + size + " bytes " +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
                                       "(MIN = " + min_size_for_pass + "; " +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
                                       "MAX = " + MAX_SIZE_FOR_PASS + ")");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
        System.out.println("Test passed.");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
    }
29104
e3a6844eed40 8072908: com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh fails on OS X with exit code 2
jbachorik
parents: 5506
diff changeset
   106
e3a6844eed40 8072908: com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh fails on OS X with exit code 2
jbachorik
parents: 5506
diff changeset
   107
    private static long getSwapSizeFromOs() throws Throwable {
e3a6844eed40 8072908: com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh fails on OS X with exit code 2
jbachorik
parents: 5506
diff changeset
   108
        OSInfo.OSType os = OSInfo.getOSType();
e3a6844eed40 8072908: com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh fails on OS X with exit code 2
jbachorik
parents: 5506
diff changeset
   109
e3a6844eed40 8072908: com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh fails on OS X with exit code 2
jbachorik
parents: 5506
diff changeset
   110
        switch (os) {
e3a6844eed40 8072908: com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh fails on OS X with exit code 2
jbachorik
parents: 5506
diff changeset
   111
            // total       used       free     shared    buffers     cached
e3a6844eed40 8072908: com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh fails on OS X with exit code 2
jbachorik
parents: 5506
diff changeset
   112
            // Mem:    16533540864 13638467584 2895073280  534040576 1630248960 6236909568
e3a6844eed40 8072908: com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh fails on OS X with exit code 2
jbachorik
parents: 5506
diff changeset
   113
            // -/+ buffers/cache: 5771309056 10762231808
e3a6844eed40 8072908: com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh fails on OS X with exit code 2
jbachorik
parents: 5506
diff changeset
   114
            // Swap:   15999168512          0 15999168512
e3a6844eed40 8072908: com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh fails on OS X with exit code 2
jbachorik
parents: 5506
diff changeset
   115
e3a6844eed40 8072908: com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh fails on OS X with exit code 2
jbachorik
parents: 5506
diff changeset
   116
            case LINUX: {
e3a6844eed40 8072908: com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh fails on OS X with exit code 2
jbachorik
parents: 5506
diff changeset
   117
                String swapSizeStr = ProcessTools.executeCommand("free", "-b")
e3a6844eed40 8072908: com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh fails on OS X with exit code 2
jbachorik
parents: 5506
diff changeset
   118
                                        .firstMatch("Swap:\\s+([0-9]+)\\s+.*", 1);
e3a6844eed40 8072908: com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh fails on OS X with exit code 2
jbachorik
parents: 5506
diff changeset
   119
                return Long.parseLong(swapSizeStr);
e3a6844eed40 8072908: com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh fails on OS X with exit code 2
jbachorik
parents: 5506
diff changeset
   120
            }
e3a6844eed40 8072908: com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh fails on OS X with exit code 2
jbachorik
parents: 5506
diff changeset
   121
            case SOLARIS: {
e3a6844eed40 8072908: com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh fails on OS X with exit code 2
jbachorik
parents: 5506
diff changeset
   122
                // swapfile             dev   swaplo blocks   free
e3a6844eed40 8072908: com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh fails on OS X with exit code 2
jbachorik
parents: 5506
diff changeset
   123
                // /dev/dsk/c0t0d0s1   136,1      16 1638608 1600528
e3a6844eed40 8072908: com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh fails on OS X with exit code 2
jbachorik
parents: 5506
diff changeset
   124
                OutputAnalyzer out= ProcessTools.executeCommand(
e3a6844eed40 8072908: com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh fails on OS X with exit code 2
jbachorik
parents: 5506
diff changeset
   125
                    "/usr/sbin/swap",
e3a6844eed40 8072908: com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh fails on OS X with exit code 2
jbachorik
parents: 5506
diff changeset
   126
                    "-l"
e3a6844eed40 8072908: com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh fails on OS X with exit code 2
jbachorik
parents: 5506
diff changeset
   127
                );
e3a6844eed40 8072908: com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh fails on OS X with exit code 2
jbachorik
parents: 5506
diff changeset
   128
e3a6844eed40 8072908: com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh fails on OS X with exit code 2
jbachorik
parents: 5506
diff changeset
   129
                long swapSize = 0;
e3a6844eed40 8072908: com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh fails on OS X with exit code 2
jbachorik
parents: 5506
diff changeset
   130
e3a6844eed40 8072908: com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh fails on OS X with exit code 2
jbachorik
parents: 5506
diff changeset
   131
                for (String line : out.asLines()) {
e3a6844eed40 8072908: com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh fails on OS X with exit code 2
jbachorik
parents: 5506
diff changeset
   132
                    if (line.contains("swapfile")) continue;
e3a6844eed40 8072908: com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh fails on OS X with exit code 2
jbachorik
parents: 5506
diff changeset
   133
e3a6844eed40 8072908: com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh fails on OS X with exit code 2
jbachorik
parents: 5506
diff changeset
   134
                    String[] vals = line.split("\\s+");
e3a6844eed40 8072908: com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh fails on OS X with exit code 2
jbachorik
parents: 5506
diff changeset
   135
                    if (vals.length == 5) {
e3a6844eed40 8072908: com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh fails on OS X with exit code 2
jbachorik
parents: 5506
diff changeset
   136
                        swapSize += Long.parseLong(vals[3]) * 512; // size is reported in 512b blocks
e3a6844eed40 8072908: com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh fails on OS X with exit code 2
jbachorik
parents: 5506
diff changeset
   137
                    }
e3a6844eed40 8072908: com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh fails on OS X with exit code 2
jbachorik
parents: 5506
diff changeset
   138
                }
e3a6844eed40 8072908: com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh fails on OS X with exit code 2
jbachorik
parents: 5506
diff changeset
   139
e3a6844eed40 8072908: com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh fails on OS X with exit code 2
jbachorik
parents: 5506
diff changeset
   140
                return swapSize;
e3a6844eed40 8072908: com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh fails on OS X with exit code 2
jbachorik
parents: 5506
diff changeset
   141
            }
e3a6844eed40 8072908: com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh fails on OS X with exit code 2
jbachorik
parents: 5506
diff changeset
   142
            case MACOSX: {
e3a6844eed40 8072908: com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh fails on OS X with exit code 2
jbachorik
parents: 5506
diff changeset
   143
                // total = 8192.00M used = 7471.11M free = 720.89M (encrypted)
e3a6844eed40 8072908: com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh fails on OS X with exit code 2
jbachorik
parents: 5506
diff changeset
   144
                String swapSizeStr = ProcessTools.executeCommand(
e3a6844eed40 8072908: com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh fails on OS X with exit code 2
jbachorik
parents: 5506
diff changeset
   145
                    "/usr/sbin/sysctl",
e3a6844eed40 8072908: com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh fails on OS X with exit code 2
jbachorik
parents: 5506
diff changeset
   146
                    "-n",
e3a6844eed40 8072908: com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh fails on OS X with exit code 2
jbachorik
parents: 5506
diff changeset
   147
                    "vm.swapusage"
e3a6844eed40 8072908: com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh fails on OS X with exit code 2
jbachorik
parents: 5506
diff changeset
   148
                ).firstMatch("total\\s+=\\s+([0-9]+(\\.[0-9]+)?[Mm]?).*", 1);
e3a6844eed40 8072908: com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh fails on OS X with exit code 2
jbachorik
parents: 5506
diff changeset
   149
                if (swapSizeStr.toLowerCase().endsWith("m")) {
e3a6844eed40 8072908: com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh fails on OS X with exit code 2
jbachorik
parents: 5506
diff changeset
   150
                    swapSizeStr = swapSizeStr.substring(0, swapSizeStr.length() - 1);
e3a6844eed40 8072908: com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh fails on OS X with exit code 2
jbachorik
parents: 5506
diff changeset
   151
                    return (long)(Double.parseDouble(swapSizeStr) * 1024 * 1024); // size in MB
e3a6844eed40 8072908: com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh fails on OS X with exit code 2
jbachorik
parents: 5506
diff changeset
   152
                }
e3a6844eed40 8072908: com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh fails on OS X with exit code 2
jbachorik
parents: 5506
diff changeset
   153
                return (long)(Double.parseDouble(swapSizeStr) * 1024 * 1024);
e3a6844eed40 8072908: com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh fails on OS X with exit code 2
jbachorik
parents: 5506
diff changeset
   154
            }
e3a6844eed40 8072908: com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh fails on OS X with exit code 2
jbachorik
parents: 5506
diff changeset
   155
            default: {
e3a6844eed40 8072908: com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh fails on OS X with exit code 2
jbachorik
parents: 5506
diff changeset
   156
                System.err.println("Unsupported operating system: " + os);
e3a6844eed40 8072908: com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh fails on OS X with exit code 2
jbachorik
parents: 5506
diff changeset
   157
            }
e3a6844eed40 8072908: com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh fails on OS X with exit code 2
jbachorik
parents: 5506
diff changeset
   158
        }
e3a6844eed40 8072908: com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh fails on OS X with exit code 2
jbachorik
parents: 5506
diff changeset
   159
e3a6844eed40 8072908: com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh fails on OS X with exit code 2
jbachorik
parents: 5506
diff changeset
   160
        return -1;
e3a6844eed40 8072908: com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh fails on OS X with exit code 2
jbachorik
parents: 5506
diff changeset
   161
    }
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
}