Browse Source

Add official image for open liberty

Fix clone repo and maintainers

Attempt to write a test based on the tomcat one

Guessing that the new line was causing a build problem.

Remove references to tomcat that make it obvious the test was copied from there

Update the misleading comment identified by @tianon in review

Update to pull in most recent git comment of open-liberty Dockerfiles.

Update for @yosifkit's comment on #3774 from Jan 12th 2018.

Move the commit hash forward to one that:

1. Uses sh over bash for docker-server
2. Quotes $@
3. Uses single bracket tests, and = over ==
4. adds set -3
5. Puts docker-server script on the path

Also as a bonus reduces two cache layers by using fewer ENV statements where relevant.

Add "open-liberty-hello-world" to the set of "open-liberty" tests in "config.sh"
Alasdair Nottingham 8 năm trước cách đây
mục cha
commit
2f5d3fc201
3 tập tin đã thay đổi với 46 bổ sung0 xóa
  1. 10 0
      library/open-liberty
  2. 3 0
      test/config.sh
  3. 33 0
      test/tests/open-liberty-hello-world/run.sh

+ 10 - 0
library/open-liberty

@@ -0,0 +1,10 @@
+Maintainers: Alasdair Nottingham <[email protected]> (@NottyCode)
+GitRepo: https://github.com/OpenLiberty/ci.docker.git
+GitCommit: a9576a73b3a554c6b27345c2dcd4ca77c394e953
+Architectures: amd64, i386, ppc64le, s390x
+
+Tags: kernel, kernel-java8-ibm
+Directory: release/kernel/java8/ibmjava
+
+Tags: kernel-java8-ibmsfj
+Directory: release/kernel/java8/ibmsfj

+ 3 - 0
test/config.sh

@@ -132,6 +132,9 @@ imageTests+=(
 		java-hello-world
 		java-uimanager-font
 	'
+	[open-liberty]='
+		open-liberty-hello-world
+	'
 	[percona]='
 	'
 	[perl]='

+ 33 - 0
test/tests/open-liberty-hello-world/run.sh

@@ -0,0 +1,33 @@
+#!/bin/bash
+set -eo pipefail
+
+dir="$(dirname "$(readlink -f "$BASH_SOURCE")")"
+
+image="$1"
+
+# since we have curl in the liberty image, we'll use that
+clientImage="$1"
+
+serverImage="$1"
+
+# Create an instance of the container-under-test
+cid="$(docker run -d "$serverImage")"
+trap "docker rm -vf $cid > /dev/null" EXIT
+
+_request() {
+	local url="${1#/}"
+	shift
+
+	docker run --rm --link "$cid":open-liberty "$clientImage" \
+		wget -q -O - "$@" "http://open-liberty:9080/$url"
+}
+
+# Make sure that Open Liberty is listening
+. "$dir/../../retry.sh" '_request / &> /dev/null'
+
+# Check that we can request /
+[ -n "$(_request '/')" ]
+
+# Check that the version.js file can be retrieved.
+helloWorld="$(_request '/version.js')"
+[[ "$helloWorld" == *'var current'* ]]