Revert MQSC error check (#283)

* Revert MQSC error check
This commit is contained in:
LPowlett
2019-03-08 09:13:26 +00:00
committed by GitHub
parent 0d3e177147
commit 194b04ac13
3 changed files with 33 additions and 34 deletions

View File

@@ -3,7 +3,7 @@
## vNext ## vNext
* Now runs using the "mqm" user instead of root. See new [security doc](https://github.com/ibm-messaging/mq-container/blob/master/docs/security.md) * Now runs using the "mqm" user instead of root. See new [security doc](https://github.com/ibm-messaging/mq-container/blob/master/docs/security.md)
* [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) * New [IGNSTATE](https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_9.1.0/com.ibm.mq.pro.doc/q132310_.htm#q132310___ignstateparm) parameter used in default developer config
* Termination log moved from `/dev/termination-log` to `/run/termination-log`, to make permissions easier to handle * Termination log moved from `/dev/termination-log` to `/run/termination-log`, to make permissions easier to handle
* Fixes for the following issues: * Fixes for the following issues:
* Brackets no longer appear in termination log * Brackets no longer appear in termination log

View File

@@ -120,7 +120,6 @@ func configureQueueManager() error {
out, err := cmd.CombinedOutput() out, err := cmd.CombinedOutput()
if err != nil { if err != nil {
log.Errorf("Error running MQSC file %v (%v):\n\t%v", file.Name(), err, strings.Replace(string(out), "\n", "\n\t", -1)) log.Errorf("Error running MQSC file %v (%v):\n\t%v", file.Name(), err, strings.Replace(string(out), "\n", "\n\t", -1))
return err
} }
// Print the runmqsc output, adding tab characters to make it more readable as part of the log // 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)) log.Printf("Output for \"runmqsc\" with %v:\n\t%v", abs, strings.Replace(string(out), "\n", "\n\t", -1))

View File

@@ -536,39 +536,39 @@ func TestMQSC(t *testing.T) {
// TestInvalidMQSC creates a new image with an MQSC file containing invalid MQSC, // 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 // tries to start a container based on that image, and checks that container terminates
func TestInvalidMQSC(t *testing.T) { // func TestInvalidMQSC(t *testing.T) {
t.Parallel() // t.Parallel()
cli, err := client.NewEnvClient() // cli, err := client.NewEnvClient()
if err != nil { // if err != nil {
t.Fatal(err) // t.Fatal(err)
} // }
var files = []struct { // var files = []struct {
Name, Body string // Name, Body string
}{ // }{
{"Dockerfile", fmt.Sprintf(` // {"Dockerfile", fmt.Sprintf(`
FROM %v // FROM %v
USER root // USER root
RUN rm -f /etc/mqm/*.mqsc // RUN rm -f /etc/mqm/*.mqsc
ADD mqscTest.mqsc /etc/mqm/ // ADD mqscTest.mqsc /etc/mqm/
RUN chmod 0660 /etc/mqm/mqscTest.mqsc // RUN chmod 0660 /etc/mqm/mqscTest.mqsc
USER mqm`, imageName())}, // USER mqm`, imageName())},
{"mqscTest.mqsc", "DEFINE INVALIDLISTENER('TEST.LISTENER.TCP') TRPTYPE(TCP) PORT(1414) CONTROL(QMGR) REPLACE"}, // {"mqscTest.mqsc", "DEFINE INVALIDLISTENER('TEST.LISTENER.TCP') TRPTYPE(TCP) PORT(1414) CONTROL(QMGR) REPLACE"},
} // }
tag := createImage(t, cli, files) // tag := createImage(t, cli, files)
defer deleteImage(t, cli, tag) // defer deleteImage(t, cli, tag)
containerConfig := container.Config{ // containerConfig := container.Config{
Env: []string{"LICENSE=accept", "MQ_QMGR_NAME=qm1"}, // Env: []string{"LICENSE=accept", "MQ_QMGR_NAME=qm1"},
Image: tag, // Image: tag,
} // }
id := runContainer(t, cli, &containerConfig) // id := runContainer(t, cli, &containerConfig)
defer cleanContainer(t, cli, id) // defer cleanContainer(t, cli, id)
rc := waitForContainer(t, cli, id, 60*time.Second) // rc := waitForContainer(t, cli, id, 60*time.Second)
if rc != 1 { // if rc != 1 {
t.Errorf("Expected rc=1, got rc=%v", rc) // t.Errorf("Expected rc=1, got rc=%v", rc)
} // }
expectTerminationMessage(t, cli, id) // expectTerminationMessage(t, cli, id)
} // }
// TestReadiness creates a new image with large amounts of MQSC in, to // TestReadiness creates a new image with large amounts of MQSC in, to
// ensure that the readiness check doesn't pass until configuration has finished. // ensure that the readiness check doesn't pass until configuration has finished.