From 5e16ba500662b04c7ef9639939082b5b3dc77b1a Mon Sep 17 00:00:00 2001 From: Martin Simka Date: Tue, 3 Oct 2023 17:41:51 +0200 Subject: [PATCH 1/3] add WildFly 29 --- CHANGELOG.md | 2 +- README.md | 23 +++++++ .../extras/creaper/core/ServerVersion.java | 5 +- .../creaper/core/ServerVersionTest.java | 2 + .../offline/OfflineServerVersionTest.java | 19 +++++- testsuite/pom.xml | 65 +++++++++++++++++-- 6 files changed, 107 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f315094f..c03119ec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## 2.0.3 (not yet released) -- added support for WildFly 28 +- added support for WildFly 28 - 29 ## 2.0.2 (2023-01-18) diff --git a/README.md b/README.md index 8a7f8557..0a5d2871 100644 --- a/README.md +++ b/README.md @@ -519,6 +519,29 @@ Dependencies for `creaper-commands`: 20.0.2.Final +#### WildFly 29 (29.0.1) (based on WildFly Core 21) + +Dependencies for `creaper-core`: + + + org.wildfly.core + wildfly-controller-client + 21.1.1.Final + + + org.wildfly.core + wildfly-cli + 21.1.1.Final + + +Dependencies for `creaper-commands`: + + + org.wildfly.core + wildfly-patching + 21.1.1.Final + + ### Transitive Dependencies These are the dependencies that you will get transitively when you depend diff --git a/core/src/main/java/org/wildfly/extras/creaper/core/ServerVersion.java b/core/src/main/java/org/wildfly/extras/creaper/core/ServerVersion.java index 2ac2582f..30272080 100644 --- a/core/src/main/java/org/wildfly/extras/creaper/core/ServerVersion.java +++ b/core/src/main/java/org/wildfly/extras/creaper/core/ServerVersion.java @@ -100,6 +100,8 @@ public final class ServerVersion { public static final ServerVersion VERSION_20_0_0 = new ServerVersion(20, 0, 0); /** WF 28.0.x.Final */ public static final ServerVersion VERSION_21_0_0 = new ServerVersion(21, 0, 0); + /** WF 29.0.x.Final */ + public static final ServerVersion VERSION_22_0_0 = new ServerVersion(22, 0, 0); private static final ServerVersion[] KNOWN_VERSIONS = { VERSION_0_0_0, @@ -134,7 +136,8 @@ public final class ServerVersion { VERSION_18_0_0, VERSION_19_0_0, VERSION_20_0_0, - VERSION_21_0_0 + VERSION_21_0_0, + VERSION_22_0_0 }; /** diff --git a/core/src/test/java/org/wildfly/extras/creaper/core/ServerVersionTest.java b/core/src/test/java/org/wildfly/extras/creaper/core/ServerVersionTest.java index 843f9e99..2a90a273 100644 --- a/core/src/test/java/org/wildfly/extras/creaper/core/ServerVersionTest.java +++ b/core/src/test/java/org/wildfly/extras/creaper/core/ServerVersionTest.java @@ -44,6 +44,7 @@ public void referenceEquality() { assertSame(ServerVersion.VERSION_19_0_0, ServerVersion.from(19, 0, 0)); assertSame(ServerVersion.VERSION_20_0_0, ServerVersion.from(20, 0, 0)); assertSame(ServerVersion.VERSION_21_0_0, ServerVersion.from(21, 0, 0)); + assertSame(ServerVersion.VERSION_22_0_0, ServerVersion.from(22, 0, 0)); assertNotSame(ServerVersion.from(42, 42, 42), ServerVersion.from(42, 42, 42)); } @@ -83,6 +84,7 @@ public void equality() { assertSame(ServerVersion.VERSION_19_0_0, ServerVersion.from(19, 0, 0)); assertSame(ServerVersion.VERSION_20_0_0, ServerVersion.from(20, 0, 0)); assertSame(ServerVersion.VERSION_21_0_0, ServerVersion.from(21, 0, 0)); + assertSame(ServerVersion.VERSION_22_0_0, ServerVersion.from(22, 0, 0)); assertEquals(ServerVersion.from(42, 42, 42), ServerVersion.from(42, 42, 42)); } diff --git a/core/src/test/java/org/wildfly/extras/creaper/core/offline/OfflineServerVersionTest.java b/core/src/test/java/org/wildfly/extras/creaper/core/offline/OfflineServerVersionTest.java index ac190e1f..6912188f 100644 --- a/core/src/test/java/org/wildfly/extras/creaper/core/offline/OfflineServerVersionTest.java +++ b/core/src/test/java/org/wildfly/extras/creaper/core/offline/OfflineServerVersionTest.java @@ -67,6 +67,7 @@ public class OfflineServerVersionTest { private static final String WFLY26_ROOT = "19.0"; private static final String WFLY27_ROOT = "20.0"; private static final String WFLY28_ROOT = "21.0"; + private static final String WFLY29_ROOT = "22.0"; private static final String COMMUNITY = "community"; private static final String PREVIEW = "preview"; @@ -201,20 +202,24 @@ public void discoverStandaloneXml_wfly28() throws IOException { } @Test + public void discoverStandaloneXml_wfly29() throws IOException { + test(ServerVersion.VERSION_22_0_0, STANDALONE_XML, WFLY29_ROOT, EAP7_LOGGING, EAP8_EE); + } + public void discoverStandaloneXml_wfly34_community() throws IOException { - test(ServerVersion.VERSION_20_0_0, STANDALONE_XML, COMMUNITY, WFLY27_ROOT, EAP7_LOGGING, EAP8_EE); + test(ServerVersion.VERSION_20_0_0, STANDALONE_XML, COMMUNITY, WFLY27_ROOT, EAP7_LOGGING, EAP8_EE); } @Test public void discoverStandaloneXml_wfly34_experimental() throws IOException { // Doesn't currently exist but verify it can be parsed correctly. - test(ServerVersion.VERSION_20_0_0, STANDALONE_XML, EXPERIMENTAL, WFLY27_ROOT, EAP7_LOGGING, EAP8_EE); + test(ServerVersion.VERSION_20_0_0, STANDALONE_XML, EXPERIMENTAL, WFLY27_ROOT, EAP7_LOGGING, EAP8_EE); } @Test public void discoverStandaloneXml_wfly34_preview() throws IOException { // Doesn't currently exist but verify it can be parsed correctly. - test(ServerVersion.VERSION_20_0_0, STANDALONE_XML, PREVIEW, WFLY27_ROOT, EAP7_LOGGING, EAP8_EE); + test(ServerVersion.VERSION_20_0_0, STANDALONE_XML, PREVIEW, WFLY27_ROOT, EAP7_LOGGING, EAP8_EE); } @Test @@ -318,6 +323,10 @@ public void discoverHostXml_wfly28() throws IOException { } @Test + public void discoverHostXml_wfly29() throws IOException { + test(ServerVersion.VERSION_22_0_0, HOST_XML, WFLY29_ROOT, EAP7_LOGGING, EAP8_EE); + } + public void discoverHostXml_wfly34_community() throws IOException { test(ServerVersion.VERSION_20_0_0, HOST_XML, COMMUNITY, WFLY27_ROOT, EAP7_LOGGING, EAP8_EE); } @@ -435,6 +444,10 @@ public void discoverDomainXml_wfly28() throws IOException { } @Test + public void discoverDomainXml_wfly29() throws IOException { + test(ServerVersion.VERSION_22_0_0, DOMAIN_XML, WFLY29_ROOT, EAP7_LOGGING, EAP8_EE); + } + public void discoverDomainXml_wfly34_community() throws IOException { test(ServerVersion.VERSION_20_0_0, DOMAIN_XML, COMMUNITY, WFLY27_ROOT, EAP7_LOGGING, EAP8_EE); } diff --git a/testsuite/pom.xml b/testsuite/pom.xml index 05806da4..274e5f0c 100644 --- a/testsuite/pom.xml +++ b/testsuite/pom.xml @@ -77,6 +77,9 @@ 28.0.1.Final 20.0.2.Final 5.0.0.Alpha6 + 29.0.1.Final + 21.1.1.Final + 5.0.0.Final 9990 @@ -217,6 +220,13 @@ wildfly-arquillian-container-managed ${version.wildfly28.arquillian} + org.wildfly + wildfly-dist + ${version.wildfly29} + org.wildfly.arquillian + wildfly-arquillian-container-managed + ${version.wildfly29.arquillian} + MUST-BE-DEFINED @@ -1260,10 +1270,6 @@ wildfly28 - - - true - 1.8 @@ -1309,5 +1315,56 @@ + + wildfly29 + + + true + + + + 1.8 + + ${wildfly29.applicationServer.groupId} + ${wildfly29.applicationServer.artifactId} + ${wildfly29.applicationServer.version} + ${managementPort.wildfly} + + ${wildfly29.arquillianContainer.groupId} + ${wildfly29.arquillianContainer.artifactId} + ${wildfly29.arquillianContainer.version} + + ${ignoredCategory.wildfly11} + + + + + + org.wildfly.extras.creaper + creaper-core + + + org.wildfly.extras.creaper + creaper-commands + + + + org.wildfly.core + wildfly-controller-client + ${version.wildfly29.core} + + + org.wildfly.core + wildfly-cli + ${version.wildfly29.core} + + + org.wildfly.core + wildfly-patching + ${version.wildfly29.core} + + + + From 73a525fcdebde715e788b781b0369b535f820ab2 Mon Sep 17 00:00:00 2001 From: Martin Simka Date: Wed, 4 Oct 2023 10:46:11 +0200 Subject: [PATCH 2/3] skip AddConnectionFactoryToRAOnlineTest tests that require legacy security on WF 29+ --- .../commands/ra/AddConnectionFactoryToRAOnlineTest.java | 3 +++ .../commands/ra/RemoveConnectionFactoryFromRAOnlineTest.java | 3 +++ 2 files changed, 6 insertions(+) diff --git a/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/ra/AddConnectionFactoryToRAOnlineTest.java b/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/ra/AddConnectionFactoryToRAOnlineTest.java index b416e988..5c3414f3 100644 --- a/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/ra/AddConnectionFactoryToRAOnlineTest.java +++ b/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/ra/AddConnectionFactoryToRAOnlineTest.java @@ -56,6 +56,9 @@ public void addConnectionFactoryTestcase() throws Exception { @Test public void addConnectionFactoryWithDetailsTestcase() throws Exception { + // uses legacy security which no longer works in WildFly 29+ + // (likely it was already no-op in few previous WF releases) + Assume.assumeTrue(client.version().lessThan(ServerVersion.VERSION_22_0_0)); client.apply(new AddResourceAdapter.Builder(RA_ID, "org.jboss.genericjms", TransactionType.NONE).build()); admin.reloadIfRequired(); client.apply(new AddConnectionFactoryToRA.Builder("cf1", "java:/jms/myRAConnectionFactory", RA_ID) diff --git a/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/ra/RemoveConnectionFactoryFromRAOnlineTest.java b/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/ra/RemoveConnectionFactoryFromRAOnlineTest.java index cdd07ea6..cf45d3e1 100644 --- a/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/ra/RemoveConnectionFactoryFromRAOnlineTest.java +++ b/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/ra/RemoveConnectionFactoryFromRAOnlineTest.java @@ -42,6 +42,9 @@ public void close() throws Exception { @Test public void removeConnectionFactoryTestcase() throws Exception { + // uses legacy security which no longer works in WildFly 29+ + // (likely it was already no-op in few previous WF releases) + Assume.assumeTrue(client.version().lessThan(ServerVersion.VERSION_22_0_0)); client.apply(new AddResourceAdapter.Builder(RA_ID, "org.jboss.genericjms", TransactionType.NONE).build()); admin.reloadIfRequired(); client.apply(new AddConnectionFactoryToRA.Builder("cf1", "java:/jms/myRAConnectionFactory", RA_ID) From e1e5eb69bfea67dd6129abac937a966f2f2adc62 Mon Sep 17 00:00:00 2001 From: Martin Simka Date: Fri, 6 Sep 2024 18:06:24 +0200 Subject: [PATCH 3/3] make PatchingOperations and commands unavailable on WildFly 29+ Patching has been removed * https://issues.redhat.com/browse/WFCORE-6206 * https://issues.redhat.com/browse/WFCORE-6541 The "patch" command should be only functional in Domain Mode since it still needs to be used to patch secondary hosts running on legacy versions from a Domain Controller. --- .../creaper/commands/patching/ApplyPatch.java | 6 ++++ .../commands/patching/PatchingOperations.java | 19 ++++++++++++ .../commands/patching/RollbackLastPatch.java | 5 ++++ .../commands/patching/RollbackPatch.java | 5 ++++ .../ApplyRollbackExistingPatchTest.java | 29 +++++++++++++++++-- .../ApplyRollbackNonexistingPatchTest.java | 13 +++++++++ .../patching/PatchingOperationsTest.java | 13 +++++++++ 7 files changed, 87 insertions(+), 3 deletions(-) diff --git a/commands/src/main/java/org/wildfly/extras/creaper/commands/patching/ApplyPatch.java b/commands/src/main/java/org/wildfly/extras/creaper/commands/patching/ApplyPatch.java index 101c5b7f..dea45314 100644 --- a/commands/src/main/java/org/wildfly/extras/creaper/commands/patching/ApplyPatch.java +++ b/commands/src/main/java/org/wildfly/extras/creaper/commands/patching/ApplyPatch.java @@ -1,6 +1,7 @@ package org.wildfly.extras.creaper.commands.patching; import org.wildfly.extras.creaper.core.CommandFailedException; +import org.wildfly.extras.creaper.core.ServerVersion; import org.wildfly.extras.creaper.core.online.CliException; import org.wildfly.extras.creaper.core.online.OnlineCommand; import org.wildfly.extras.creaper.core.online.OnlineCommandContext; @@ -31,6 +32,11 @@ private ApplyPatch(Builder builder) { @Override public void apply(OnlineCommandContext ctx) throws CliException, CommandFailedException, IOException { + if (ctx.options.isStandalone && ctx.version.greaterThan(ServerVersion.VERSION_21_0_0)) { + // https://issues.redhat.com/browse/WFCORE-6206 + throw new AssertionError("Patching has been removed in WildFly 29."); + } + StringBuilder cmd = new StringBuilder("patch apply " + patchPath); if (ctx.options.isDomain) { cmd.append(" --host="); diff --git a/commands/src/main/java/org/wildfly/extras/creaper/commands/patching/PatchingOperations.java b/commands/src/main/java/org/wildfly/extras/creaper/commands/patching/PatchingOperations.java index a56b73be..480f43ed 100644 --- a/commands/src/main/java/org/wildfly/extras/creaper/commands/patching/PatchingOperations.java +++ b/commands/src/main/java/org/wildfly/extras/creaper/commands/patching/PatchingOperations.java @@ -1,6 +1,7 @@ package org.wildfly.extras.creaper.commands.patching; import org.jboss.dmr.ModelNode; +import org.wildfly.extras.creaper.core.ServerVersion; import org.wildfly.extras.creaper.core.online.ModelNodeResult; import org.wildfly.extras.creaper.core.online.OnlineManagementClient; import org.wildfly.extras.creaper.core.online.operations.Address; @@ -13,10 +14,12 @@ import java.util.List; public final class PatchingOperations { + private final OnlineManagementClient client; private final Operations ops; private final Address patchingAddress; public PatchingOperations(OnlineManagementClient client) { + this.client = client; this.ops = new Operations(client); this.patchingAddress = Address.coreService("patching"); } @@ -25,6 +28,7 @@ public PatchingOperations(OnlineManagementClient client) { * @return list of history entries of all patches that have been applied; never {@code null} */ public List getHistory() throws IOException { + checkServerVersionIsSupported(); List asList = ops.invoke("show-history", patchingAddress).listValue(); List entries = new ArrayList(asList.size()); @@ -59,6 +63,7 @@ public PatchHistoryEntry getHistoryEntry(String patchId) throws IOException { * @return information about current patch state as a {@code PatchInfo} object; never {@code null} */ public PatchInfo getPatchInfo() throws IOException { + checkServerVersionIsSupported(); ModelNodeResult modelNodeResult = ops.readResource(patchingAddress, ReadResourceOption.RECURSIVE, ReadResourceOption.INCLUDE_RUNTIME); modelNodeResult.assertDefinedValue(); @@ -80,6 +85,7 @@ public PatchInfo getPatchInfo() throws IOException { * @throws IOException when IO error occurs */ public String getCumulativePatchId() throws IOException { + checkServerVersionIsSupported(); return ops.readAttribute(patchingAddress, "cumulative-patch-id").stringValue(null); } @@ -89,6 +95,7 @@ public String getCumulativePatchId() throws IOException { * @throws IOException when IO error occurs */ public String getCurrentServerVersion() throws IOException { + checkServerVersionIsSupported(); return ops.readAttribute(patchingAddress, "version").stringValue(null); } @@ -97,6 +104,7 @@ public String getCurrentServerVersion() throws IOException { * @throws IOException when IO error occurs */ public List getPatchesIds() throws IOException { + checkServerVersionIsSupported(); return ops.readAttribute(patchingAddress, "patches").stringListValue(Collections.emptyList()); } @@ -235,4 +243,15 @@ public String toString() { return "PatchHistoryEntry {patchId='" + patchId + "\', type='" + type + "\', appliedAt='" + appliedAt + "\'}"; } } + + private void checkServerVersionIsSupported() { + try { + if (client.version().greaterThan(ServerVersion.VERSION_21_0_0)) { + // https://issues.redhat.com/browse/WFCORE-6206 + throw new AssertionError("Patching subsystem has been removed in WildFly 29."); + } + } catch (IOException ioe) { + throw new IllegalStateException(ioe); + } + } } diff --git a/commands/src/main/java/org/wildfly/extras/creaper/commands/patching/RollbackLastPatch.java b/commands/src/main/java/org/wildfly/extras/creaper/commands/patching/RollbackLastPatch.java index 3445a681..5c91c364 100644 --- a/commands/src/main/java/org/wildfly/extras/creaper/commands/patching/RollbackLastPatch.java +++ b/commands/src/main/java/org/wildfly/extras/creaper/commands/patching/RollbackLastPatch.java @@ -1,5 +1,6 @@ package org.wildfly.extras.creaper.commands.patching; +import org.wildfly.extras.creaper.core.ServerVersion; import org.wildfly.extras.creaper.core.online.OnlineCommand; import org.wildfly.extras.creaper.core.online.OnlineCommandContext; import org.wildfly.extras.creaper.core.online.operations.Address; @@ -31,6 +32,10 @@ private RollbackLastPatch(Builder builder) { @Override public void apply(OnlineCommandContext ctx) throws IOException { + if (ctx.version.greaterThan(ServerVersion.VERSION_21_0_0)) { + // https://issues.redhat.com/browse/WFCORE-6206 + throw new AssertionError("Patching has been removed in WildFly 29."); + } Operations ops = new Operations(ctx.client); ops.invoke("rollback-last", Address.coreService("patching"), Values.empty() .andOptional("reset-configuration", resetConfiguration) diff --git a/commands/src/main/java/org/wildfly/extras/creaper/commands/patching/RollbackPatch.java b/commands/src/main/java/org/wildfly/extras/creaper/commands/patching/RollbackPatch.java index 08590214..622f28c6 100644 --- a/commands/src/main/java/org/wildfly/extras/creaper/commands/patching/RollbackPatch.java +++ b/commands/src/main/java/org/wildfly/extras/creaper/commands/patching/RollbackPatch.java @@ -1,5 +1,6 @@ package org.wildfly.extras.creaper.commands.patching; +import org.wildfly.extras.creaper.core.ServerVersion; import org.wildfly.extras.creaper.core.online.OnlineCommand; import org.wildfly.extras.creaper.core.online.OnlineCommandContext; import org.wildfly.extras.creaper.core.online.operations.Address; @@ -35,6 +36,10 @@ private RollbackPatch(Builder builder) { @Override public void apply(OnlineCommandContext ctx) throws IOException { + if (ctx.version.greaterThan(ServerVersion.VERSION_21_0_0)) { + // https://issues.redhat.com/browse/WFCORE-6206 + throw new AssertionError("Patching has been removed in WildFly 29."); + } Operations ops = new Operations(ctx.client); ops.invoke("rollback", Address.coreService("patching"), Values.empty() .andOptional("patch-id", patchId) diff --git a/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/patching/ApplyRollbackExistingPatchTest.java b/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/patching/ApplyRollbackExistingPatchTest.java index d3c987c3..0a9e2906 100644 --- a/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/patching/ApplyRollbackExistingPatchTest.java +++ b/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/patching/ApplyRollbackExistingPatchTest.java @@ -5,8 +5,10 @@ import org.jboss.arquillian.junit.Arquillian; import org.jboss.arquillian.junit.InSequence; import org.jboss.arquillian.test.api.ArquillianResource; +import org.junit.Assume; import org.wildfly.extras.creaper.core.CommandFailedException; import org.wildfly.extras.creaper.core.ManagementClient; +import org.wildfly.extras.creaper.core.ServerVersion; import org.wildfly.extras.creaper.core.online.ModelNodeResult; import org.wildfly.extras.creaper.core.online.OnlineManagementClient; import org.wildfly.extras.creaper.core.online.OnlineOptions; @@ -62,6 +64,8 @@ public void startServer() { @Test @InSequence(2) public void applyPatch() throws Exception { + checkServerVersionIsSupported(); + File patchZip = tmp.newFile("test-patch.zip"); String serverName = "WildFly"; @@ -93,7 +97,9 @@ public void applyPatch() throws Exception { @Test @InSequence(3) - public void restartServerAfterPatchApply() throws TimeoutException, InterruptedException { + public void restartServerAfterPatchApply() throws TimeoutException, InterruptedException, IOException { + checkServerVersionIsSupported(); + controller.stop(ManualTests.ARQUILLIAN_CONTAINER); controller.start(ManualTests.ARQUILLIAN_CONTAINER); client.reconnect(10); @@ -102,18 +108,24 @@ public void restartServerAfterPatchApply() throws TimeoutException, InterruptedE @Test @InSequence(4) public void assertPatchInstalled() throws IOException { + checkServerVersionIsSupported(); + assertTrue(patching.isPatchInstalled("test-patch")); } @Test @InSequence(5) - public void rollbackPatch() throws CommandFailedException { + public void rollbackPatch() throws CommandFailedException, IOException { + checkServerVersionIsSupported(); + client.apply(new RollbackPatch.Builder("test-patch").resetConfiguration(false).build()); } @Test @InSequence(6) - public void restartServerAfterPatchRollback() throws TimeoutException, InterruptedException { + public void restartServerAfterPatchRollback() throws TimeoutException, InterruptedException, IOException { + checkServerVersionIsSupported(); + controller.stop(ManualTests.ARQUILLIAN_CONTAINER); controller.start(ManualTests.ARQUILLIAN_CONTAINER); client.reconnect(10); @@ -122,6 +134,8 @@ public void restartServerAfterPatchRollback() throws TimeoutException, Interrupt @Test @InSequence(7) public void assertPatchNotInstalled() throws IOException { + checkServerVersionIsSupported(); + assertFalse(patching.isAnyPatchInstalled()); } @@ -135,4 +149,13 @@ public void stopServer() { public void tearDown() throws IOException { client.close(); } + + private void checkServerVersionIsSupported() throws IOException { + // check version is supported + ServerVersion serverVersion + = client.version(); + // https://issues.redhat.com/browse/WFCORE-6206 + Assume.assumeFalse("Patching has been removed in WildFly 29.", + serverVersion.greaterThan(ServerVersion.VERSION_21_0_0)); + } } diff --git a/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/patching/ApplyRollbackNonexistingPatchTest.java b/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/patching/ApplyRollbackNonexistingPatchTest.java index 197f5dff..8a285cf7 100644 --- a/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/patching/ApplyRollbackNonexistingPatchTest.java +++ b/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/patching/ApplyRollbackNonexistingPatchTest.java @@ -1,9 +1,12 @@ package org.wildfly.extras.creaper.commands.patching; import org.jboss.arquillian.junit.Arquillian; +import org.junit.Assume; +import org.junit.BeforeClass; import org.junit.runner.RunWith; import org.wildfly.extras.creaper.core.CommandFailedException; import org.wildfly.extras.creaper.core.ManagementClient; +import org.wildfly.extras.creaper.core.ServerVersion; import org.wildfly.extras.creaper.core.online.OnlineManagementClient; import org.wildfly.extras.creaper.core.online.OnlineOptions; import org.junit.After; @@ -16,6 +19,16 @@ public class ApplyRollbackNonexistingPatchTest { private OnlineManagementClient client; + @BeforeClass + public static void checkServerVersionIsSupported() throws Exception { + // check version is supported + ServerVersion serverVersion + = ManagementClient.online(OnlineOptions.standalone().localDefault().build()).version(); + // https://issues.redhat.com/browse/WFCORE-6206 + Assume.assumeFalse("Patching subsystem has been removed in WildFly 29.", + serverVersion.greaterThan(ServerVersion.VERSION_21_0_0)); + } + @Before public void connect() throws IOException { client = ManagementClient.online(OnlineOptions.standalone().localDefault().build()); diff --git a/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/patching/PatchingOperationsTest.java b/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/patching/PatchingOperationsTest.java index 691bffdf..2e4d766b 100644 --- a/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/patching/PatchingOperationsTest.java +++ b/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/patching/PatchingOperationsTest.java @@ -1,8 +1,11 @@ package org.wildfly.extras.creaper.commands.patching; import org.jboss.arquillian.junit.Arquillian; +import org.junit.Assume; +import org.junit.BeforeClass; import org.junit.runner.RunWith; import org.wildfly.extras.creaper.core.ManagementClient; +import org.wildfly.extras.creaper.core.ServerVersion; import org.wildfly.extras.creaper.core.online.OnlineManagementClient; import org.wildfly.extras.creaper.core.online.OnlineOptions; import org.junit.After; @@ -22,6 +25,16 @@ public class PatchingOperationsTest { private OnlineManagementClient client; private PatchingOperations patchingOps; + @BeforeClass + public static void checkServerVersionIsSupported() throws Exception { + // check version is supported + ServerVersion serverVersion + = ManagementClient.online(OnlineOptions.standalone().localDefault().build()).version(); + // https://issues.redhat.com/browse/WFCORE-6206 + Assume.assumeFalse("Patching subsystem has been removed in WildFly 29.", + serverVersion.greaterThan(ServerVersion.VERSION_21_0_0)); + } + @Before public void connect() throws IOException { client = ManagementClient.online(OnlineOptions.standalone().localDefault().build());