diff --git a/Makefile b/Makefile index e82a7ec8..cbe55365 100644 --- a/Makefile +++ b/Makefile @@ -222,7 +222,6 @@ build-advancedserver: downloads/$(MQ_ARCHIVE) docker-version # Target-specific variable to add web server into devserver image build-devserver: MQ_PACKAGES=ibmmq-server ibmmq-java ibmmq-jre ibmmq-gskit ibmmq-msg-.* ibmmq-samples ibmmq-ams ibmmq-web build-devserver: downloads/$(MQ_ARCHIVE_DEV) docker-version - @test "$(shell uname -m)" = "x86_64" || (echo "Error: MQ Advanced for Developers is only available for x86_64 architecture" && exit 1) $(info $(shell printf $(TITLE)"Build $(MQ_IMAGE_DEVSERVER_BASE)"$(END))) $(call docker-build-mq,$(MQ_IMAGE_DEVSERVER_BASE),Dockerfile-server,$(MQ_ARCHIVE_DEV),"98102d16795c4263ad9ca075190a2d4d","IBM MQ Advanced for Developers (Non-Warranted)",$(MQ_VERSION)) docker build --tag $(MQ_IMAGE_DEVSERVER) --file incubating/mqadvanced-server-dev/Dockerfile . diff --git a/cmd/runmqserver/mqconfig_linux.go b/cmd/runmqserver/mqconfig_linux.go index d0ec357d..93434116 100644 --- a/cmd/runmqserver/mqconfig_linux.go +++ b/cmd/runmqserver/mqconfig_linux.go @@ -41,7 +41,8 @@ func checkFS(path string) error { log.Println(err) return nil } - t := fsTypes[statfs.Type] + // Use a type conversion to make type an int64. On s390x it's a uint32. + t := fsTypes[int64(statfs.Type)] switch t { case "aufs", "overlayfs", "tmpfs": return fmt.Errorf("%v uses unsupported filesystem type: %v", path, t) diff --git a/incubating/Dockerfile-sfbridge b/incubating/Dockerfile-sfbridge index 134cc4fa..3f7360f6 100644 --- a/incubating/Dockerfile-sfbridge +++ b/incubating/Dockerfile-sfbridge @@ -15,7 +15,7 @@ FROM ubuntu:16.04 # The URL to download the MQ installer from in tar.gz format -ARG MQ_URL=https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/messaging/mqadv/mqadv_dev903_ubuntu_x86-64.tar.gz +ARG MQ_URL=https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/messaging/mqadv/mqadv_dev905_ubuntu_x86-64.tar.gz # The MQ packages to install ARG MQ_PACKAGES="ibmmq-sfbridge" diff --git a/incubating/mq-explorer/Dockerfile b/incubating/mq-explorer/Dockerfile index 0deffcb2..32575d17 100644 --- a/incubating/mq-explorer/Dockerfile +++ b/incubating/mq-explorer/Dockerfile @@ -15,7 +15,7 @@ FROM ubuntu:16.04 # The URL to download the MQ installer from in tar.gz format -ARG MQ_URL=https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/messaging/mqadv/mqadv_dev903_ubuntu_x86-64.tar.gz +ARG MQ_URL=https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/messaging/mqadv/mqadv_dev905_ubuntu_x86-64.tar.gz # The MQ packages to install ARG MQ_PACKAGES="ibmmq-explorer" @@ -35,4 +35,4 @@ ENV LANG=en_US.UTF-8 # Run as mqm (999) USER 999 -ENTRYPOINT ["MQExplorer"] \ No newline at end of file +ENTRYPOINT ["MQExplorer"] diff --git a/install-mq.sh b/install-mq.sh index d8283492..f6179b74 100644 --- a/install-mq.sh +++ b/install-mq.sh @@ -29,12 +29,19 @@ fi if ($UBUNTU); then export DEBIAN_FRONTEND=noninteractive + source /etc/os-release + # Figure out the correct apt URL based on the CPU architecture + CPU_ARCH=$(uname -p) + if [ ${CPU_ARCH} == "x86_64" ]; then + APT_URL="http://archive.ubuntu.com/ubuntu/" + else + APT_URL="http://ports.ubuntu.com/ubuntu-ports/" + fi # Use a reduced set of apt repositories. # This ensures no unsupported code gets installed, and makes the build faster - source /etc/os-release - echo "deb http://archive.ubuntu.com/ubuntu/ ${UBUNTU_CODENAME} main restricted" > /etc/apt/sources.list - echo "deb http://archive.ubuntu.com/ubuntu/ ${UBUNTU_CODENAME}-updates main restricted" >> /etc/apt/sources.list - echo "deb http://archive.ubuntu.com/ubuntu/ ${UBUNTU_CODENAME}-security main restricted" >> /etc/apt/sources.list + echo "deb ${APT_URL} ${UBUNTU_CODENAME} main restricted" > /etc/apt/sources.list + echo "deb ${APT_URL} ${UBUNTU_CODENAME}-updates main restricted" >> /etc/apt/sources.list + echo "deb ${APT_URL} ${UBUNTU_CODENAME}-security main restricted" >> /etc/apt/sources.list # Install additional packages required by MQ, this install process and the runtime scripts apt-get update apt-get install -y --no-install-recommends \ diff --git a/test/docker/docker_api_test.go b/test/docker/docker_api_test.go index f06fc7da..3fda0b4d 100644 --- a/test/docker/docker_api_test.go +++ b/test/docker/docker_api_test.go @@ -25,6 +25,7 @@ import ( "io" "path/filepath" "regexp" + "runtime" "strconv" "strings" "testing" @@ -104,7 +105,13 @@ func TestSecurityVulnerabilities(t *testing.T) { t.Skip("Skipping test because container is not Ubuntu-based") } // Override the entrypoint to make "apt" only receive security updates, then check for updates - rc, log := runContainerOneShot(t, cli, "bash", "-c", "source /etc/os-release && echo \"deb http://security.ubuntu.com/ubuntu/ ${VERSION_CODENAME}-security main restricted\" > /etc/apt/sources.list && apt-get update 2>&1 >/dev/null && apt-get --simulate -qq upgrade") + var url string + if runtime.GOARCH == "amd64" { + url = "http://security.ubuntu.com/ubuntu/" + } else { + url = "http://ports.ubuntu.com/ubuntu-ports/" + } + rc, log := runContainerOneShot(t, cli, "bash", "-c", "source /etc/os-release && echo \"deb "+url+" ${VERSION_CODENAME}-security main restricted\" > /etc/apt/sources.list && apt-get update 2>&1 >/dev/null && apt-get --simulate -qq upgrade") if rc != 0 { t.Fatalf("Expected success, got %v", rc) } @@ -476,9 +483,11 @@ func TestErrorLogRotation(t *testing.T) { for { execContainer(t, cli, id, "fred", []string{"bash", "-c", "/opt/mqm/samp/bin/amqsput FAKE"}) - _, derpaderp := execContainer(t, cli, id, "mqm", []string{"bash", "-c", "wc -c < " + filepath.Join(dir, "AMQERR02.json")}) - amqerr02size, _ := strconv.Atoi(derpaderp) - + _, atoiStr := execContainer(t, cli, id, "mqm", []string{"bash", "-c", "wc -c < " + filepath.Join(dir, "AMQERR02.json")}) + amqerr02size, err := strconv.Atoi(atoiStr) + if err != nil { + t.Fatal(err) + } if amqerr02size > 0 { // We've done enough to cause log rotation break diff --git a/test/docker/docker_api_test_util.go b/test/docker/docker_api_test_util.go index 264fb9d5..6993c219 100644 --- a/test/docker/docker_api_test_util.go +++ b/test/docker/docker_api_test_util.go @@ -325,9 +325,6 @@ rerun: Detach: false, Tty: false, }) - if err != nil { - t.Fatal(err) - } // Wait for the command to finish var exitcode int for {