Skip to content

Commit ce664dd

Browse files
authored
Merge pull request #285 from parrobe/redistdownload
Fixes for builds
2 parents 194b04a + f8e057a commit ce664dd

File tree

8 files changed

+71
-15
lines changed

8 files changed

+71
-15
lines changed

Makefile-RHEL

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ MQ_ARCHIVE ?= IBM_MQ_$(MQ_VERSION_VRM)_LINUX_$(MQ_ARCHIVE_ARCH).tar.gz
2828
# for Developers can be installed
2929
MQ_ARCHIVE_DEV ?= $(MQ_ARCHIVE_DEV_$(MQ_VERSION))
3030
# MQ_SDK_ARCHIVE specifies the archive to use for the MQ redistributable client, which is used for building the golang programs.
31-
MQ_SDK_ARCHIVE ?= $(MQ_VERSION)-IBM-MQC-Redist-LinuxX64.tar.gz
31+
MQ_SDK_ARCHIVE ?= 9.1.1.0-IBM-MQC-Redist-LinuxX64.tar.gz
3232
# Options to `go test` for the Docker tests
3333
TEST_OPTS_DOCKER ?=
3434
# MQ_IMAGE_ADVANCEDSERVER is the name and tag of the built MQ Advanced image

Makefile-UBUNTU

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ docker-version:
231231

232232
.PHONY: build-advancedserver
233233
build-advancedserver: MQ_SDK_ARCHIVE=$(MQ_ARCHIVE)
234-
build-advancedserver: downloads/$(MQ_ARCHIVE) docker-version build-golang-sdk
234+
build-advancedserver: downloads/$(MQ_ARCHIVE) docker-version build-golang-sdk-ex
235235
$(info $(SPACER)$(shell printf $(TITLE)"Build $(MQ_IMAGE_ADVANCEDSERVER)"$(END)))
236236
$(call docker-build-mq,$(MQ_IMAGE_ADVANCEDSERVER),Dockerfile-server,$(MQ_ARCHIVE),"4486e8c4cc9146fd9b3ce1f14a2dfc5b","IBM MQ Advanced",$(MQ_VERSION))
237237

@@ -243,7 +243,7 @@ else
243243
build-devserver: MQ_PACKAGES=MQSeriesRuntime-*.rpm MQSeriesServer-*.rpm MQSeriesJava*.rpm MQSeriesJRE*.rpm MQSeriesGSKit*.rpm MQSeriesMsg*.rpm MQSeriesSamples*.rpm MQSeriesAMS-*.rpm MQSeriesWeb-*.rpm
244244
endif
245245
build-devserver: MQ_SDK_ARCHIVE=$(MQ_ARCHIVE_DEV)
246-
build-devserver: downloads/$(MQ_ARCHIVE_DEV) docker-version build-golang-sdk
246+
build-devserver: downloads/$(MQ_ARCHIVE_DEV) docker-version build-golang-sdk-ex
247247
$(info $(shell printf $(TITLE)"Build $(MQ_IMAGE_DEVSERVER_BASE)"$(END)))
248248
$(call docker-build-mq,$(MQ_IMAGE_DEVSERVER_BASE),Dockerfile-server,$(MQ_ARCHIVE_DEV),"98102d16795c4263ad9ca075190a2d4d","IBM MQ Advanced for Developers (Non-Warranted)",$(MQ_VERSION))
249249
$(DOCKER) build --tag $(MQ_IMAGE_DEVSERVER) --build-arg IMAGE_SOURCE="$(IMAGE_SOURCE)" --build-arg IMAGE_REVISION="$(IMAGE_REVISION)" --build-arg IMAGE_TAG="$(MQ_IMAGE_DEVSERVER)" --build-arg BASE_IMAGE=$(MQ_IMAGE_DEVSERVER_BASE) --build-arg BUILDER_IMAGE=$(MQ_IMAGE_GOLANG_SDK) --build-arg MQM_UID=$(MQM_UID) --file incubating/mqadvanced-server-dev/Dockerfile .
@@ -253,6 +253,11 @@ build-advancedserver-cover: docker-version
253253
$(DOCKER) build --build-arg BASE_IMAGE=$(MQ_IMAGE_ADVANCEDSERVER) -t $(MQ_IMAGE_ADVANCEDSERVER)-cover -f Dockerfile-server.cover .
254254

255255
.PHONY: build-explorer
256+
ifeq "$(findstring ubuntu,$(BASE_IMAGE))" "ubuntu"
257+
build-explorer: MQ_PACKAGES=ibmmq-explorer
258+
else
259+
build-explorer: MQ_PACKAGES=MQSeriesRuntime*.rpm MQSeriesJRE*.rpm MQSeriesExplorer*.rpm
260+
endif
256261
build-explorer: downloads/$(MQ_ARCHIVE_DEV) docker-pull
257262
$(call docker-build-mq,mq-explorer:latest-$(ARCH),incubating/mq-explorer/Dockerfile,$(MQ_ARCHIVE_DEV),"98102d16795c4263ad9ca075190a2d4d","IBM MQ Advanced for Developers (Non-Warranted)",$(MQ_VERSION))
258263

incubating/mq-explorer/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ FROM ubuntu:16.04
1818
ARG MQ_URL=https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/messaging/mqadv/mqadv_dev911_ubuntu_x86-64.tar.gz
1919

2020
# The MQ packages to install
21-
ARG MQ_PACKAGES="ibmmq-explorer"
21+
ARG MQ_PACKAGES
2222

2323
ARG MQM_UID=999
2424

@@ -29,7 +29,7 @@ RUN export DEBIAN_FRONTEND=noninteractive \
2929
libxtst6
3030

3131
ADD install-mq.sh /usr/local/bin/
32-
RUN chmod u+x /usr/local/bin/install-mq.sh $MQM_UID \
32+
RUN chmod u+x /usr/local/bin/install-mq.sh \
3333
&& install-mq.sh
3434

3535
ENV LANG=en_US.UTF-8

incubating/mqadvanced-server-dev/Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,12 @@ COPY --from=builder /go/src/github.com/ibm-messaging/mq-container/runmqserver /u
7171
COPY --from=builder /go/src/github.com/ibm-messaging/mq-container/runmqdevserver /usr/local/bin/
7272

7373
# Copy template files
74-
COPY --chown=mqm:mqm incubating/mqadvanced-server-dev/*.tpl /etc/mqm/
74+
COPY incubating/mqadvanced-server-dev/*.tpl /etc/mqm/
7575
# Copy web XML files for default developer configuration
76-
COPY --chown=mqm:mqm incubating/mqadvanced-server-dev/web /etc/mqm/web
76+
COPY incubating/mqadvanced-server-dev/web /etc/mqm/web
7777

78-
RUN chmod +x /usr/local/bin/runmq* \
78+
RUN chown -R mqm:mqm /etc/mqm/* \
79+
&& chmod +x /usr/local/bin/runmq* \
7980
&& install --directory --mode 0775 --owner mqm --group root /run/runmqdevserver
8081

8182
EXPOSE 9443

test/docker/devconfig_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ import (
3333
// Note: This test requires a separate container image to be available for the JMS tests.
3434
func TestDevGoldenPath(t *testing.T) {
3535
t.Parallel()
36+
3637
cli, err := client.NewEnvClient()
3738
if err != nil {
3839
t.Fatal(err)
@@ -66,6 +67,7 @@ func TestDevGoldenPath(t *testing.T) {
6667
// Note: This test requires a separate container image to be available for the JMS tests
6768
func TestDevSecure(t *testing.T) {
6869
t.Parallel()
70+
6971
cli, err := client.NewEnvClient()
7072
if err != nil {
7173
t.Fatal(err)
@@ -127,6 +129,7 @@ func TestDevSecure(t *testing.T) {
127129

128130
func TestDevWebDisabled(t *testing.T) {
129131
t.Parallel()
132+
130133
cli, err := client.NewEnvClient()
131134
if err != nil {
132135
t.Fatal(err)
@@ -157,6 +160,7 @@ func TestDevWebDisabled(t *testing.T) {
157160

158161
func TestDevConfigDisabled(t *testing.T) {
159162
t.Parallel()
163+
160164
cli, err := client.NewEnvClient()
161165
if err != nil {
162166
t.Fatal(err)

test/docker/docker_api_test.go

Lines changed: 42 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ import (
4040

4141
func TestLicenseNotSet(t *testing.T) {
4242
t.Parallel()
43+
4344
cli, err := client.NewEnvClient()
4445
if err != nil {
4546
t.Fatal(err)
@@ -56,6 +57,7 @@ func TestLicenseNotSet(t *testing.T) {
5657

5758
func TestLicenseView(t *testing.T) {
5859
t.Parallel()
60+
5961
cli, err := client.NewEnvClient()
6062
if err != nil {
6163
t.Fatal(err)
@@ -79,12 +81,14 @@ func TestLicenseView(t *testing.T) {
7981
// TestGoldenPath starts a queue manager successfully when metrics are enabled
8082
func TestGoldenPathWithMetrics(t *testing.T) {
8183
t.Parallel()
84+
8285
goldenPath(t, true)
8386
}
8487

8588
// TestGoldenPath starts a queue manager successfully when metrics are disabled
8689
func TestGoldenPathNoMetrics(t *testing.T) {
8790
t.Parallel()
91+
8892
goldenPath(t, false)
8993
}
9094

@@ -112,6 +116,7 @@ func goldenPath(t *testing.T, metric bool) {
112116
// by Ubuntu
113117
func TestSecurityVulnerabilitiesUbuntu(t *testing.T) {
114118
t.Parallel()
119+
115120
cli, err := client.NewEnvClient()
116121
if err != nil {
117122
t.Fatal(err)
@@ -141,6 +146,7 @@ func TestSecurityVulnerabilitiesUbuntu(t *testing.T) {
141146
// by Red Hat
142147
func TestSecurityVulnerabilitiesRedHat(t *testing.T) {
143148
t.Parallel()
149+
144150
cli, err := client.NewEnvClient()
145151
if err != nil {
146152
t.Fatal(err)
@@ -153,22 +159,25 @@ func TestSecurityVulnerabilitiesRedHat(t *testing.T) {
153159
if rc != 0 {
154160
t.Skip("Skipping test because container is not RedHat-based")
155161
}
156-
id, _, err := command.Run("buildah", "from", imageName())
162+
id, _, err := command.Run("sudo", "buildah", "from", imageName())
157163
if err != nil {
164+
t.Log(id)
158165
t.Fatal(err)
159166
}
160167
id = strings.TrimSpace(id)
161168
defer command.Run("buildah", "rm", id)
162-
mnt, _, err := command.Run("buildah", "mount", id)
169+
mnt, _, err := command.Run("sudo", "buildah", "mount", id)
163170
if err != nil {
171+
t.Log(mnt)
164172
t.Fatal(err)
165173
}
166174
mnt = strings.TrimSpace(mnt)
167-
_, _, err = command.Run("bash", "-c", "cp /etc/yum.repos.d/* "+filepath.Join(mnt, "/etc/yum.repos.d/"))
175+
out, _, err := command.Run("bash", "-c", "sudo cp /etc/yum.repos.d/* "+filepath.Join(mnt, "/etc/yum.repos.d/"))
168176
if err != nil {
177+
t.Log(out)
169178
t.Fatal(err)
170179
}
171-
out, ret, _ := command.Run("bash", "-c", "yum --installroot="+mnt+" updateinfo list sec | grep /Sec")
180+
out, ret, _ = command.Run("bash", "-c", "yum --installroot="+mnt+" updateinfo list sec | grep /Sec")
172181
if ret != 1 {
173182
t.Errorf("Expected no vulnerabilities, found the following:\n%v", out)
174183
}
@@ -194,25 +203,29 @@ func utilTestNoQueueManagerName(t *testing.T, hostName string, expectedName stri
194203
}
195204
func TestNoQueueManagerName(t *testing.T) {
196205
t.Parallel()
206+
197207
utilTestNoQueueManagerName(t, "test", "test")
198208
}
199209

200210
func TestNoQueueManagerNameInvalidHostname(t *testing.T) {
201211
t.Parallel()
212+
202213
utilTestNoQueueManagerName(t, "test-1", "test1")
203214
}
204215

205216
// TestWithVolume runs a container with a Docker volume, then removes that
206217
// container and starts a new one with same volume. With metrics enabled
207218
func TestWithVolumeAndMetrics(t *testing.T) {
208219
t.Parallel()
220+
209221
withVolume(t, true)
210222
}
211223

212224
// TestWithVolume runs a container with a Docker volume, then removes that
213225
// container and starts a new one with same volume. With metrics disabled
214226
func TestWithVolumeNoMetrics(t *testing.T) {
215227
t.Parallel()
228+
216229
withVolume(t, false)
217230
}
218231

@@ -264,6 +277,7 @@ func withVolume(t *testing.T, metric bool) {
264277
// and restarted cleanly
265278
func TestNoVolumeWithRestart(t *testing.T) {
266279
t.Parallel()
280+
267281
cli, err := client.NewEnvClient()
268282
if err != nil {
269283
t.Fatal(err)
@@ -284,6 +298,7 @@ func TestNoVolumeWithRestart(t *testing.T) {
284298
// where `runmqserver -i` is run to initialize the storage. Then the
285299
// container can be run as normal.
286300
func TestVolumeRequiresRoot(t *testing.T) {
301+
287302
cli, err := client.NewEnvClient()
288303
if err != nil {
289304
t.Fatal(err)
@@ -346,6 +361,7 @@ func TestVolumeRequiresRoot(t *testing.T) {
346361
// TestCreateQueueManagerFail causes a failure of `crtmqm`
347362
func TestCreateQueueManagerFail(t *testing.T) {
348363
t.Parallel()
364+
349365
cli, err := client.NewEnvClient()
350366
if err != nil {
351367
t.Fatal(err)
@@ -380,6 +396,7 @@ func TestCreateQueueManagerFail(t *testing.T) {
380396
// TestStartQueueManagerFail causes a failure of `strmqm`
381397
func TestStartQueueManagerFail(t *testing.T) {
382398
t.Parallel()
399+
383400
cli, err := client.NewEnvClient()
384401
if err != nil {
385402
t.Fatal(err)
@@ -417,6 +434,7 @@ func TestStartQueueManagerFail(t *testing.T) {
417434
// attached storage gets unmounted.
418435
func TestVolumeUnmount(t *testing.T) {
419436
t.Parallel()
437+
420438
cli, err := client.NewEnvClient()
421439
if err != nil {
422440
t.Fatal(err)
@@ -465,6 +483,7 @@ func TestVolumeUnmount(t *testing.T) {
465483
// created, then checks that no zombies exist (runmqserver should reap them)
466484
func TestZombies(t *testing.T) {
467485
t.Parallel()
486+
468487
cli, err := client.NewEnvClient()
469488
if err != nil {
470489
t.Fatal(err)
@@ -501,6 +520,7 @@ func TestZombies(t *testing.T) {
501520
// on that image, and checks that the MQSC has been applied correctly.
502521
func TestMQSC(t *testing.T) {
503522
t.Parallel()
523+
504524
cli, err := client.NewEnvClient()
505525
if err != nil {
506526
t.Fatal(err)
@@ -575,6 +595,7 @@ func TestMQSC(t *testing.T) {
575595
// WARNING: This test is sensitive to the speed of the machine it's running on.
576596
func TestReadiness(t *testing.T) {
577597
t.Parallel()
598+
578599
cli, err := client.NewEnvClient()
579600
if err != nil {
580601
t.Fatal(err)
@@ -629,29 +650,42 @@ func TestReadiness(t *testing.T) {
629650

630651
func TestErrorLogRotation(t *testing.T) {
631652
t.Parallel()
653+
632654
cli, err := client.NewEnvClient()
633655
if err != nil {
634656
t.Fatal(err)
635657
}
658+
659+
logsize := 65536
660+
661+
rc, _ := runContainerOneShot(t, cli, "bash", "-c", "test -d /etc/apt")
662+
if rc != 0 {
663+
// RHEL
664+
logsize = 32768
665+
}
666+
636667
qmName := "qm1"
637668
containerConfig := container.Config{
638669
Env: []string{
639670
"LICENSE=accept",
640671
"MQ_QMGR_NAME=" + qmName,
641-
"MQMAXERRORLOGSIZE=65536",
672+
fmt.Sprintf("MQMAXERRORLOGSIZE=%d", logsize),
642673
"LOG_FORMAT=json",
674+
fmt.Sprintf("AMQ_EXTRA_QM_STANZAS=QMErrorLog:ErrorLogSize=%d", logsize),
643675
},
644676
ExposedPorts: nat.PortSet{
645677
"1414/tcp": struct{}{},
646678
},
647679
}
680+
648681
id := runContainer(t, cli, &containerConfig)
649682
defer cleanContainer(t, cli, id)
650683
waitForReady(t, cli, id)
651684
dir := "/var/mqm/qmgrs/" + qmName + "/errors"
652685
// Generate some content for the error logs, by trying to put messages under an unauthorized user
653686
// execContainer(t, cli, id, "fred", []string{"bash", "-c", "for i in {1..30} ; do /opt/mqm/samp/bin/amqsput FAKE; done"})
654687
execContainer(t, cli, id, "root", []string{"useradd", "fred"})
688+
655689
for {
656690
execContainer(t, cli, id, "fred", []string{"bash", "-c", "/opt/mqm/samp/bin/amqsput FAKE"})
657691

@@ -694,12 +728,14 @@ func TestErrorLogRotation(t *testing.T) {
694728
// Tests the log comes out in JSON format when JSON format is enabled. With metrics enabled
695729
func TestJSONLogFormatWithMetrics(t *testing.T) {
696730
t.Parallel()
731+
697732
jsonLogFormat(t, true)
698733
}
699734

700735
// Tests the log comes out in JSON format when JSON format is enabled. With metrics disabled
701736
func TestJSONLogFormatNoMetrics(t *testing.T) {
702737
t.Parallel()
738+
703739
jsonLogFormat(t, false)
704740
}
705741

@@ -740,6 +776,7 @@ func jsonLogFormat(t *testing.T, metric bool) {
740776

741777
func TestBadLogFormat(t *testing.T) {
742778
t.Parallel()
779+
743780
cli, err := client.NewEnvClient()
744781
if err != nil {
745782
t.Fatal(err)

test/docker/docker_api_test_util.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ func runContainerOneShot(t *testing.T, cli *client.Client, command ...string) (i
343343
t.Fatal(err)
344344
}
345345
defer cleanContainerQuiet(t, cli, ctr.ID)
346-
rc := waitForContainer(t, cli, ctr.ID, 10*time.Second)
346+
rc := waitForContainer(t, cli, ctr.ID, 20*time.Second)
347347
out := inspectLogs(t, cli, ctr.ID)
348348
t.Logf("One shot container finished with rc=%v, output=%v", rc, out)
349349
return rc, out
@@ -374,7 +374,7 @@ func runContainerOneShotWithVolume(t *testing.T, cli *client.Client, bind string
374374
t.Fatal(err)
375375
}
376376
defer cleanContainerQuiet(t, cli, ctr.ID)
377-
rc := waitForContainer(t, cli, ctr.ID, 10*time.Second)
377+
rc := waitForContainer(t, cli, ctr.ID, 20*time.Second)
378378
out := inspectLogs(t, cli, ctr.ID)
379379
t.Logf("One shot container finished with rc=%v, output=%v", rc, out)
380380
return rc, out

0 commit comments

Comments
 (0)