You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by cd...@apache.org on 2023/06/15 14:37:39 UTC
[plc4x] 01/04: bug(plc4j/test-utils): Added support for detecting parallels VMs on ARM systems.
This is an automated email from the ASF dual-hosted git repository.
cdutz pushed a commit to branch chore/profinet-phase-3
in repository https://gitbox.apache.org/repos/asf/plc4x.git
commit ae16cc8d7da4478a4dbcf3762a5df42491c93ef2
Author: Christofer Dutz <cd...@apache.org>
AuthorDate: Thu Jun 15 16:36:23 2023 +0200
bug(plc4j/test-utils): Added support for detecting parallels VMs on ARM systems.
---
.../org/apache/plc4x/test/DisableOnParallelsVmFlagCondition.java | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/plc4j/utils/test-utils/src/main/java/org/apache/plc4x/test/DisableOnParallelsVmFlagCondition.java b/plc4j/utils/test-utils/src/main/java/org/apache/plc4x/test/DisableOnParallelsVmFlagCondition.java
index 437504a2be..c40712a769 100644
--- a/plc4j/utils/test-utils/src/main/java/org/apache/plc4x/test/DisableOnParallelsVmFlagCondition.java
+++ b/plc4j/utils/test-utils/src/main/java/org/apache/plc4x/test/DisableOnParallelsVmFlagCondition.java
@@ -29,7 +29,8 @@ import java.nio.charset.StandardCharsets;
public class DisableOnParallelsVmFlagCondition implements ExecutionCondition {
- private static final String PARALLELS_STRING = "Parallels Virtual Platform";
+ private static final String PARALLELS_STRING_AMD = "Parallels Virtual Platform";
+ private static final String PARALLELS_STRING_ARM = "Parallels ARM Virtual Machine";
private static final boolean isParallels;
static {
boolean localIsParallels = false;
@@ -43,7 +44,7 @@ public class DisableOnParallelsVmFlagCondition implements ExecutionCondition {
new InputStreamReader(process.getInputStream()))) {
String line;
while ((line = reader.readLine()) != null) {
- if(line.contains(PARALLELS_STRING)) {
+ if(line.contains(PARALLELS_STRING_AMD) || line.contains(PARALLELS_STRING_ARM)) {
localIsParallels = true;
break;
}
@@ -57,7 +58,7 @@ public class DisableOnParallelsVmFlagCondition implements ExecutionCondition {
File productNameFile = new File("/sys/devices/virtual/dmi/id/product_name");
try(InputStream is = new FileInputStream(productNameFile)) {
String content = IOUtils.toString(is, StandardCharsets.UTF_8);
- localIsParallels = content.contains(PARALLELS_STRING);
+ localIsParallels = content.contains(PARALLELS_STRING_AMD) || content.contains(PARALLELS_STRING_ARM);
} catch (IOException e) {
// Ignore this...
}