Formulas testing revision 2019/10

Related: PROD-32744
Related: PROD-33634
Related: PROD-33698

Change-Id: I2834de08df4e95f65effc68349f99ea2d76270f5
diff --git a/.kitchen.yml b/.kitchen.yml
index bb3c6e9..d32f93e 100644
--- a/.kitchen.yml
+++ b/.kitchen.yml
@@ -28,25 +28,16 @@
   name: inspec
   sudo: true
 
+docker_images:
+  - &xenial-20177 <%=ENV['IMAGE_XENIAL_20177'] || 'docker-dev-local.docker.mirantis.net/mirantis/drivetrain/salt-formulas-ci/salt-formulas-ci-xenial-2017.7:latest'%>
 
 platforms:
-  - name: <%=ENV['PLATFORM'] ||  'saltstack-ubuntu-xenial-salt-stable' %>
+  - name: xenial-2017.7
     driver_config:
-      image: <%=ENV['PLATFORM'] || 'docker-dev-local.docker.mirantis.net/epcim/salt/saltstack-ubuntu-xenial-salt-stable/salt:2018_11_19'%>
+      image: *xenial-20177
       platform: ubuntu
 
 suites:
-
-  - name: openjdk-7
-    provisioner:
-      pillars-from-files:
-        java.sls: tests/pillar/openjdk-7.sls
-
-  - name: openjdk-8
-    provisioner:
-      pillars-from-files:
-        java.sls: tests/pillar/openjdk-8.sls
-
   - name: openjdk-9
     provisioner:
       pillars-from-files:
@@ -57,18 +48,8 @@
       pillars-from-files:
         java.sls: tests/pillar/openjdk-10.sls
 
-  - name: oracle-jdk-8
+  - name: oracle-jdk-13
     provisioner:
       pillars-from-files:
-        java.sls: tests/pillar/oracle-jdk-8.sls
-
-  - name: oracle-jdk-9
-    provisioner:
-      pillars-from-files:
-        java.sls: tests/pillar/oracle-jdk-9.sls
-
-  - name: oracle-jdk-10
-    provisioner:
-      pillars-from-files:
-        java.sls: tests/pillar/oracle-jdk-10.sls
+        java.sls: tests/pillar/oracle-jdk-13.sls
 # vim: ft=yaml sw=2 ts=2 sts=2 tw=125
\ No newline at end of file
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index ae37d12..0000000
--- a/.travis.yml
+++ /dev/null
@@ -1,46 +0,0 @@
-language: python
-python:
-- "2.7.13"
-sudo: required
-services:
-  - docker
-
-install:
-  - pip install PyYAML
-  - pip install virtualenv
-  - |
-    if [ ! -e Gemfile ]; then
-       curl -s -o ./Gemfile 'https://gerrit.mcp.mirantis.com/gitweb?p=salt-formulas/salt-formulas-scripts.git;a=blob_plain;f=Gemfile;hb=refs/heads/master'
-    fi
-  - bundle install
-
-env:
-    - PLATFORM=docker-dev-local.docker.mirantis.net/epcim/salt/saltstack-ubuntu-xenial-salt-2017.7/salt:2018_11_19 SUITE=openjdk-8
-    - PLATFORM=docker-dev-local.docker.mirantis.net/epcim/salt/saltstack-ubuntu-xenial-salt-2017.7/salt:2018_11_19 SUITE=openjdk-9
-    - PLATFORM=docker-dev-local.docker.mirantis.net/epcim/salt/saltstack-ubuntu-xenial-salt-2017.7/salt:2018_11_19 SUITE=openjdk-10
-    - PLATFORM=docker-dev-local.docker.mirantis.net/epcim/salt/saltstack-ubuntu-xenial-salt-2017.7/salt:2018_11_19 SUITE=oracle-jdk-8
-    - PLATFORM=docker-dev-local.docker.mirantis.net/epcim/salt/saltstack-ubuntu-xenial-salt-2017.7/salt:2018_11_19 SUITE=oracle-jdk-10
-    - PLATFORM=docker-dev-local.docker.mirantis.net/epcim/salt/saltstack-ubuntu-xenial-salt-stable/salt:2018_11_19 SUITE=openjdk-8
-    - PLATFORM=docker-dev-local.docker.mirantis.net/epcim/salt/saltstack-ubuntu-xenial-salt-stable/salt:2018_11_19 SUITE=openjdk-9
-    - PLATFORM=docker-dev-local.docker.mirantis.net/epcim/salt/saltstack-ubuntu-xenial-salt-stable/salt:2018_11_19 SUITE=openjdk-10
-    - PLATFORM=docker-dev-local.docker.mirantis.net/epcim/salt/saltstack-ubuntu-xenial-salt-stable/salt:2018_11_19 SUITE=oracle-jdk-8
-    - PLATFORM=docker-dev-local.docker.mirantis.net/epcim/salt/saltstack-ubuntu-xenial-salt-stable/salt:2018_11_19 SUITE=oracle-jdk-10
-
-before_script:
-  - set -o pipefail
-  - make test | tail
-
-script:
-  - test ! -e .kitchen.yml || bundle exec kitchen converge ${SUITE} || true
-  - test ! -e .kitchen.yml || bundle exec kitchen verify ${SUITE} -t tests/integration
-
-notifications:
-  webhooks:
-    urls:
-      - https://webhooks.gitter.im/e/6123573504759330786b
-    on_success: change  # options: [always|never|change] default: always
-    on_failure: never  # options: [always|never|change] default: always
-    on_start: never     # options: [always|never|change] default: always
-    on_cancel: never    # options: [always|never|change] default: always
-    on_error: never    # options: [always|never|change] default: always
-  email: false
\ No newline at end of file
diff --git a/java/map.jinja b/java/map.jinja
index 2cb9cda..6d56c2f 100644
--- a/java/map.jinja
+++ b/java/map.jinja
@@ -1,11 +1,11 @@
 {% set java_version = pillar.java.environment.get('version', '7') %}
 
 {% if java_version == '7' %}
-{% set java_release = '76' %}
-{% set java_build = '13' %}
+    {% set java_release = '76' %}
+    {% set java_build = '13' %}
 {% elif java_version == '8' %}
-{% set java_release = '60' %}
-{% set java_build = '27' %}
+    {% set java_release = '60' %}
+    {% set java_build = '27' %}
 {% endif %}
 
 {%- if pillar.java.environment.get('headless', False) %}
@@ -33,23 +33,19 @@
 }, merge=salt['pillar.get']('java:environment')) %}
 
 {%- if environment.platform == 'oracle-java' %}
-{%- set java_home = environment.home_dir %}
-{%- set prefix = '/usr/share/java' %}
-{%- set oracle_cookie = 'Cookie: oraclelicense=accept-securebackup-cookie' %}
-{%- set dl_opts = '-LOH' %}
-{%- if java_version == '8' %}
-{%- set source_url = salt['cmd.run']('curl -s https://lv.binarybabel.org/catalog-api/java/jdk8.txt?p=downloads.tgz') %}
-{%- set version_name = salt['cmd.run']('curl -s https://lv.binarybabel.org/catalog-api/java/jdk8.txt?p=version') %}
-{%- set oracle_file_name = 'jdk-' + salt['cmd.run']('curl -s https://lv.binarybabel.org/catalog-api/java/jdk8.txt?p=version_parsed.major') + 'u' + salt['cmd.run']('curl -s https://lv.binarybabel.org/catalog-api/java/jdk8.txt?p=version_parsed.minor') + '-linux-x64.tar.gz' %}
-{%- elif (java_version == '9' or java_version == '10') %}
-{%- set java_build = environment.build %}
-{%- set java_release = environment.release %}
-{%- set version_name = java_version + '.' + java_release + '+' + java_build %}
-{%- set oracle_file_name = 'jdk-' + java_version + '.' + java_release + '_linux-x64_bin.tar.gz' %}
-{%- set oracle_hash = environment.oracle_hash %}
-{%- set source_url = 'http://download.oracle.com/otn-pub/java/jdk/' + version_name + '/' + oracle_hash + '/' + oracle_file_name %}
-{%- endif %}
-{%- set java_real_home = prefix + '/' + version_name %}
+    {%- set java_home = environment.home_dir %}
+    {%- set prefix = '/usr/share/java' %}
+    {%- set oracle_cookie = 'Cookie: oraclelicense=accept-securebackup-cookie' %}
+    {%- set dl_opts = '-LOH' %}
+    {%- if (java_version|int > 9) %}
+        {%- set java_build = environment.build %}
+        {%- set java_release = environment.release %}
+        {%- set version_name = java_version + '.' + java_release + '+' + java_build %}
+        {%- set oracle_file_name = 'jdk-' + java_version + '.' + java_release + '_linux-x64_bin.tar.gz' %}
+        {%- set oracle_hash = environment.oracle_hash %}
+        {%- set source_url = 'http://download.oracle.com/otn-pub/java/jdk/' + version_name + '/' + oracle_hash + '/' + oracle_file_name %}
+    {%- endif %}
+    {%- set java_real_home = prefix + '/' + version_name %}
 {%- endif %}
 
 {%- do environment.update( { 'version_name' : version_name,
diff --git a/tests/pillar/openjdk-7.sls b/tests/pillar/openjdk-7.sls
deleted file mode 100644
index 2889e95..0000000
--- a/tests/pillar/openjdk-7.sls
+++ /dev/null
@@ -1,6 +0,0 @@
-java:
-  environment:
-    enabled: true
-    version: '7'
-    platform: openjdk
-    development: true
diff --git a/tests/pillar/openjdk-8.sls b/tests/pillar/openjdk-8.sls
deleted file mode 100644
index 05fe179..0000000
--- a/tests/pillar/openjdk-8.sls
+++ /dev/null
@@ -1,6 +0,0 @@
-java:
-  environment:
-    enabled: true
-    version: '8'
-    platform: openjdk
-    development: true
diff --git a/tests/pillar/oracle-jdk-10.sls b/tests/pillar/oracle-jdk-10.sls
deleted file mode 100644
index f7d469b..0000000
--- a/tests/pillar/oracle-jdk-10.sls
+++ /dev/null
@@ -1,9 +0,0 @@
-java:
-  environment:
-    enabled: true
-    version: '10'
-    release: '0.1'
-    build: '10'
-    oracle_hash: 'fb4372174a714e6b8c52526dc134031e'
-    platform: oracle-java
-    development: true
diff --git a/tests/pillar/oracle-jdk-13.sls b/tests/pillar/oracle-jdk-13.sls
new file mode 100644
index 0000000..a0b1319
--- /dev/null
+++ b/tests/pillar/oracle-jdk-13.sls
@@ -0,0 +1,9 @@
+java:
+  environment:
+    enabled: true
+    version: '13'
+    release: '0.1'
+    build: '9'
+    oracle_hash: 'cec27d702aa74d5a8630c65ae61e4305'
+    platform: oracle-java
+    development: true
diff --git a/tests/pillar/oracle-jdk-8.sls b/tests/pillar/oracle-jdk-8.sls
deleted file mode 100644
index 8e2cc8d..0000000
--- a/tests/pillar/oracle-jdk-8.sls
+++ /dev/null
@@ -1,6 +0,0 @@
-java:
-  environment:
-    enabled: true
-    version: '8'
-    platform: oracle-java
-    development: true
diff --git a/tests/pillar/oracle-jdk-9.sls b/tests/pillar/oracle-jdk-9.sls
deleted file mode 100644
index a60cc0a..0000000
--- a/tests/pillar/oracle-jdk-9.sls
+++ /dev/null
@@ -1,9 +0,0 @@
-java:
-  environment:
-    enabled: true
-    version: '9'
-    release: '0.4'
-    build: '11'
-    oracle_hash: 'c2514751926b4512b076cc82f959763f'
-    platform: oracle-java
-    development: true