/* * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2021 SAP SE. 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 * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions.
*/
for (String line : lines) { if (line.contains(warning_kernel_no_pids_support)) {
System.out.println("Docker pids limitation seems not to work, avoiding check"); return;
}
if (line.contains(lineMarker)) {
lineMarkerFound = true;
String[] parts = line.split(":");
System.out.println("DEBUG: line = " + line);
System.out.println("DEBUG: parts.length = " + parts.length); if (expectedValue.equals("any_integer")) {
Asserts.assertEquals(parts.length, 2);
String ivalue = parts[1].replaceAll("\\s",""); try { int ai = Integer.parseInt(ivalue);
System.out.println("Found " + lineMarker + " with value: " + ai + ". PASS.");
} catch (NumberFormatException ex) { thrownew RuntimeException("Could not convert " + ivalue + " to an integer, log line was " + line);
} break;
}
Asserts.assertEquals(parts.length, 2);
String actual = parts[1].replaceAll("\\s",""); // Unlimited pids leads on some setups not to "max" in the output, but to a high number if (expectedValue.equals("max")) { if (actual.equals("max")) {
System.out.println("Found expected max for unlimited pids value.");
} else { try { int ai = Integer.parseInt(actual); if (ai > 20000) {
System.out.println("Limit value " + ai + " got accepted as unlimited, log line was "+ line);
} else { thrownew RuntimeException("Limit value " + ai + " is not accepted as unlimited, log line was " + line);
}
} catch (NumberFormatException ex) { thrownew RuntimeException("Could not convert " + actual + " to an integer, log line was " + line);
}
}
} else {
Asserts.assertEquals(actual, expectedValue);
} break;
}
}
Asserts.assertTrue(lineMarkerFound);
}
List<String> lines = Common.run(opts).asLines(); if (value.equals("Unlimited")) {
checkResult(lines, "Maximum number of tasks is: ", "max");
} else {
checkResult(lines, "Maximum number of tasks is: ", value);
} // current number of tasks value is hard to predict, so better expect no value
checkResult(lines, "Current number of tasks is: ", "any_integer");
}
}
Messung V0.5
¤ Dauer der Verarbeitung: 0.11 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.