corretto / corretto-8-docker

Dockerfiles for Amazon Corretto 8
MIT No Attribution
195 stars 40 forks source link

Setup test framework with container-structure-test. #23

Closed EricEdens closed 5 years ago

EricEdens commented 5 years ago

Adds GoogleContainerTools/container-structure-test as a test framework and wires them into the jenkins build hook.

Local execution:

➜  corretto-8-docker git:(master) ./test-image.sh 
--2019-02-18 15:43:55--  https://storage.googleapis.com/container-structure-test/latest/container-structure-test-linux-amd64
Resolving storage.googleapis.com (storage.googleapis.com)... 172.217.6.80, 2607:f8b0:4005:80a::2010
Connecting to storage.googleapis.com (storage.googleapis.com)|172.217.6.80|:443... connected.
HTTP request sent, awaiting response... 304 Not Modified
File ‘build/tool/container-structure-test-linux-amd64’ not modified on server. Omitting download.

Sending build context to Docker daemon   17.2MB
Step 1/2 : FROM amazonlinux:2
 ---> df7d0b6ddeee
Step 2/2 : RUN yum -y update  && amazon-linux-extras enable corretto8  && yum -y install java-1.8.0-amazon-corretto-devel  && yum clean all
 ---> Using cache
 ---> 4c472b2af6ab
Successfully built 4c472b2af6ab
Successfully tagged corretto-8:latest

========================================
====== Test file: test-image.yaml ======
========================================

INFO: stderr: openjdk version "1.8.0_202"
OpenJDK Runtime Environment Corretto-8.202.08.2 (build 1.8.0_202-b08)
OpenJDK 64-Bit Server VM Corretto-8.202.08.2 (build 25.202-b08, mixed mode)

=== RUN: Command Test: java command is registered using alternatives.
--- PASS
stderr: openjdk version "1.8.0_202"
OpenJDK Runtime Environment Corretto-8.202.08.2 (build 1.8.0_202-b08)
OpenJDK 64-Bit Server VM Corretto-8.202.08.2 (build 25.202-b08, mixed mode)
INFO: stderr: javac 1.8.0_202

=== RUN: Command Test: javac command is registered using alternatives.
--- PASS
stderr: javac 1.8.0_202

=========================================
================ RESULTS ================
=========================================
Passes:      2
Failures:    0
Total tests: 2

PASS