1 /* |
1 /* |
2 * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
123 |
123 |
124 |
124 |
125 private static void testCpus(int valueToSet, int expectedTraceValue) throws Exception { |
125 private static void testCpus(int valueToSet, int expectedTraceValue) throws Exception { |
126 Common.logNewTestCase("test cpus: " + valueToSet); |
126 Common.logNewTestCase("test cpus: " + valueToSet); |
127 DockerRunOptions opts = Common.newOpts(imageName) |
127 DockerRunOptions opts = Common.newOpts(imageName) |
128 .addDockerOpts("--cpus", "" + valueToSet); |
128 .addDockerOpts("--cpu-period=" + 10000) |
|
129 .addDockerOpts("--cpu-quota=" + valueToSet * 10000); |
129 Common.run(opts) |
130 Common.run(opts) |
130 .shouldMatch("active_processor_count.*" + expectedTraceValue); |
131 .shouldMatch("active_processor_count.*" + expectedTraceValue); |
131 } |
132 } |
132 |
133 |
133 |
134 |