Skip to content

Commit

Permalink
fix: fix the no-auth MQ integration tests
Browse files Browse the repository at this point in the history
We use the latest tag MQ image in our integration tests. In
December, MQ's container image removed the no-auth svrconn channel
so this breaks the connector tests that try to make connections
to MQ without credentials.

This commit adds a custom MQSC script to configure the queue
manager to restore the previous behaviour.

The MQSourceTaskAuthIT tests still test the ability to connect to
a queue manager with auth credentials, so this commit means we
still test connecting with and without credentials.

Signed-off-by: Dale Lane <[email protected]>
  • Loading branch information
dalelane committed Feb 7, 2024
1 parent 2ee5ca4 commit 39abe1a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -301,5 +301,12 @@
</executions>
</plugin>
</plugins>

<!-- some integration tests use the custom mqsc file in the resources directory -->
<testResources>
<testResource>
<directory>src/integration/resources</directory>
</testResource>
</testResources>
</build>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import org.junit.ClassRule;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.output.WaitingConsumer;
import org.testcontainers.utility.MountableFile;

import com.ibm.mq.jms.MQConnectionFactory;
import com.ibm.msg.client.jms.JmsConnectionFactory;
Expand All @@ -53,6 +54,7 @@ public class AbstractJMSContextIT {
.withEnv("LICENSE", "accept")
.withEnv("MQ_QMGR_NAME", QMGR_NAME)
.withEnv("MQ_ENABLE_EMBEDDED_WEB_SERVER", "false")
.withCopyFileToContainer(MountableFile.forClasspathResource("no-auth-qmgr.mqsc"), "/etc/mqm/99-no-auth-qmgr.mqsc")
.withExposedPorts(1414);

private JMSContext jmsContext;
Expand Down
3 changes: 3 additions & 0 deletions src/integration/resources/no-auth-qmgr.mqsc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ALTER QMGR CHLAUTH(DISABLED)
ALTER QMGR CONNAUTH(' ')
REFRESH SECURITY TYPE(CONNAUTH)

0 comments on commit 39abe1a

Please sign in to comment.