diff --git a/CHANGELOG.md b/CHANGELOG.md index 042c004..bcd410f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,11 +1,16 @@ # Change log +## vNext + +* [New IGNSTATE parameter for runmqsc START and STOP commands](https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_9.1.0/com.ibm.mq.pro.doc/q132310_.htm#q132310___ignstateparm) - From MQ version 9.1.1.0, any MQSC scripts included in the image should make use of the `IGNSTATE(YES)` parameter on any `START` and `STOP` commands. This allows for consistency when executing scripts multiple times (e.g. when a container is restarted) + + ## 9.1.1.0 (2018-11-30) * Updated to MQ version 9.1.1.0 * Created seperate RedHat Makefile for building images on RedHat machines with buildah * Enabled REST messaging capability for app user. -* Added support for container suplimentary groups +* Added support for container supplementary groups * Removed IBM MQ version 9.0.5 details. * Added additional Diagnostics ([#203](https://github.com/ibm-messaging/mq-container/pull/203)) * Implementted GOSec to perform code scans for security vulnerabilities. (([#227](https://github.com/ibm-messaging/mq-container/pull/227))) diff --git a/LICENSE b/LICENSE index f2249fd..94482e6 100644 --- a/LICENSE +++ b/LICENSE @@ -176,7 +176,7 @@ END OF TERMS AND CONDITIONS - © Copyright IBM Corporation. 2015, 2018 + © Copyright IBM Corporation. 2015, 2019 Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/cmd/runmqserver/qmgr.go b/cmd/runmqserver/qmgr.go index ffabdc9..8d6e76c 100644 --- a/cmd/runmqserver/qmgr.go +++ b/cmd/runmqserver/qmgr.go @@ -1,5 +1,5 @@ /* -© Copyright IBM Corporation 2017, 2018 +© Copyright IBM Corporation 2017, 2019 Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -119,7 +119,8 @@ func configureQueueManager() error { // Run the command and wait for completion out, err := cmd.CombinedOutput() if err != nil { - log.Println(err) + log.Errorf("Error running MQSC file %v: %v", file.Name(), err) + return err } // Print the runmqsc output, adding tab characters to make it more readable as part of the log log.Printf("Output for \"runmqsc\" with %v:\n\t%v", abs, strings.Replace(string(out), "\n", "\n\t", -1)) diff --git a/incubating/mqadvanced-server-dev/10-dev.mqsc.tpl b/incubating/mqadvanced-server-dev/10-dev.mqsc.tpl index dd46bea..987e8e3 100644 --- a/incubating/mqadvanced-server-dev/10-dev.mqsc.tpl +++ b/incubating/mqadvanced-server-dev/10-dev.mqsc.tpl @@ -1,4 +1,4 @@ -* © Copyright IBM Corporation 2017, 2018 +* © Copyright IBM Corporation 2017, 2019 * * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. -STOP LISTENER('SYSTEM.LISTENER.TCP.1') +STOP LISTENER('SYSTEM.LISTENER.TCP.1') IGNSTATE(YES) * Developer queues DEFINE QLOCAL('DEV.QUEUE.1') REPLACE @@ -50,4 +50,4 @@ SET AUTHREC PROFILE('DEV.**') GROUP('mqclient') OBJTYPE(TOPIC) AUTHADD(PUB,SUB) * Developer listener DEFINE LISTENER('DEV.LISTENER.TCP') TRPTYPE(TCP) PORT(1414) CONTROL(QMGR) REPLACE -START LISTENER('DEV.LISTENER.TCP') +START LISTENER('DEV.LISTENER.TCP') IGNSTATE(YES) diff --git a/test/docker/docker_api_test.go b/test/docker/docker_api_test.go index aaa26e2..7c76aea 100644 --- a/test/docker/docker_api_test.go +++ b/test/docker/docker_api_test.go @@ -1,5 +1,5 @@ /* -© Copyright IBM Corporation 2017, 2018 +© Copyright IBM Corporation 2017, 2019 Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -411,6 +411,36 @@ func TestMQSC(t *testing.T) { } } +// TestInvalidMQSC creates a new image with an MQSC file containing invalid MQSC, +// tries to start a container based on that image, and checks that container terminates +func TestInvalidMQSC(t *testing.T) { + t.Parallel() + cli, err := client.NewEnvClient() + if err != nil { + t.Fatal(err) + } + var files = []struct { + Name, Body string + }{ + {"Dockerfile", fmt.Sprintf("FROM %v\nRUN rm -f /etc/mqm/*.mqsc\nADD mqscTest.mqsc /etc/mqm/", imageName())}, + {"mqscTest.mqsc", "DEFINE INVALIDLISTENER('TEST.LISTENER.TCP') TRPTYPE(TCP) PORT(1414) CONTROL(QMGR) REPLACE"}, + } + tag := createImage(t, cli, files) + defer deleteImage(t, cli, tag) + + containerConfig := container.Config{ + Env: []string{"LICENSE=accept", "MQ_QMGR_NAME=qm1"}, + Image: tag, + } + id := runContainer(t, cli, &containerConfig) + defer cleanContainer(t, cli, id) + rc := waitForContainer(t, cli, id, 5) + if rc != 1 { + t.Errorf("Expected rc=1, got rc=%v", rc) + } + expectTerminationMessage(t) +} + // TestReadiness creates a new image with large amounts of MQSC in, to // ensure that the readiness check doesn't pass until configuration has finished. // WARNING: This test is sensitive to the speed of the machine it's running on.