From 50262c3c012b0ebdb86810edd04793c31d2a0a79 Mon Sep 17 00:00:00 2001 From: Imran Iqbal Date: Wed, 22 Apr 2020 21:15:58 +0100 Subject: [PATCH] test: update and fix all tests (inc. provide files for comparison) --- .../default/controls/config_spec.rb | 113 ++++++++++++ .../default/controls/packages_spec.rb | 11 +- .../default/controls/services_spec.rb | 11 +- .../default/controls/yaml_dump_spec.rb | 35 ++-- .../comparison_files/main_config/amazon-2 | 67 +++++++ .../comparison_files/main_config/centos-7 | 67 +++++++ .../comparison_files/main_config/debian-10 | 58 ++++++ .../comparison_files/main_config/debian-8 | 60 ++++++ .../comparison_files/main_config/debian-9 | 58 ++++++ .../comparison_files/main_config/fedora-31 | 67 +++++++ .../comparison_files/main_config/opensuse-15 | 67 +++++++ .../comparison_files/main_config/ubuntu-16 | 58 ++++++ .../comparison_files/main_config/ubuntu-18 | 58 ++++++ .../comparison_files/server_xml/amazon-2.xml | 173 ++++++++++++++++++ .../comparison_files/server_xml/centos-7.xml | 173 ++++++++++++++++++ .../comparison_files/server_xml/debian-10.xml | 148 +++++++++++++++ .../comparison_files/server_xml/debian-8.xml | 173 ++++++++++++++++++ .../comparison_files/server_xml/debian-9.xml | 148 +++++++++++++++ .../comparison_files/server_xml/fedora-31.xml | 148 +++++++++++++++ .../server_xml/opensuse-15.xml | 99 ++++++++++ .../comparison_files/server_xml/ubuntu-16.xml | 148 +++++++++++++++ .../comparison_files/server_xml/ubuntu-18.xml | 148 +++++++++++++++ 22 files changed, 2066 insertions(+), 22 deletions(-) create mode 100644 test/integration/default/controls/config_spec.rb create mode 100644 test/salt/comparison_files/main_config/amazon-2 create mode 100644 test/salt/comparison_files/main_config/centos-7 create mode 100644 test/salt/comparison_files/main_config/debian-10 create mode 100644 test/salt/comparison_files/main_config/debian-8 create mode 100644 test/salt/comparison_files/main_config/debian-9 create mode 100644 test/salt/comparison_files/main_config/fedora-31 create mode 100644 test/salt/comparison_files/main_config/opensuse-15 create mode 100644 test/salt/comparison_files/main_config/ubuntu-16 create mode 100644 test/salt/comparison_files/main_config/ubuntu-18 create mode 100644 test/salt/comparison_files/server_xml/amazon-2.xml create mode 100644 test/salt/comparison_files/server_xml/centos-7.xml create mode 100644 test/salt/comparison_files/server_xml/debian-10.xml create mode 100644 test/salt/comparison_files/server_xml/debian-8.xml create mode 100644 test/salt/comparison_files/server_xml/debian-9.xml create mode 100644 test/salt/comparison_files/server_xml/fedora-31.xml create mode 100644 test/salt/comparison_files/server_xml/opensuse-15.xml create mode 100644 test/salt/comparison_files/server_xml/ubuntu-16.xml create mode 100644 test/salt/comparison_files/server_xml/ubuntu-18.xml diff --git a/test/integration/default/controls/config_spec.rb b/test/integration/default/controls/config_spec.rb new file mode 100644 index 00000000..09ef4492 --- /dev/null +++ b/test/integration/default/controls/config_spec.rb @@ -0,0 +1,113 @@ +# frozen_string_literal: true + +# Prepare platform "finger" and base path to file comparison directory +platform_finger = "#{platform[:name]}-#{platform[:release].split('.')[0]}" +comparison_files_dir = '/tmp/kitchen/srv/salt/comparison_files' + +# Default values for `control 'Tomcat main config'` +main_config_file = '/etc/sysconfig/tomcat' +# Default values for `control 'Tomcat Catalina temp dir'` +catalina_tmpdir = '/var/cache/tomcat/temp' +catalina_tmpdir_user_and_group = 'tomcat' +# Default values for `control 'Tomcat `server.xml` config'` +conf_dir = '/etc/tomcat' +server_xml_user_and_group = 'tomcat' + +# Override by platform +case platform[:family] +when 'debian' + main_config_file = '/etc/default/tomcat8' + catalina_tmpdir = '/var/cache/tomcat8/temp' + catalina_tmpdir_user_and_group = 'tomcat8' + conf_dir = '/etc/tomcat8' + server_xml_user_and_group = 'tomcat8' + case platform_finger + when 'debian-10' + main_config_file = '/etc/default/tomcat9' + catalina_tmpdir = '/var/cache/tomcat9/temp' + catalina_tmpdir_user_and_group = 'tomcat' + conf_dir = '/etc/tomcat9' + server_xml_user_and_group = 'tomcat' + when 'debian-9' + when 'debian-8' + main_config_file = '/etc/default/tomcat7' + catalina_tmpdir = '/var/cache/tomcat7/temp' + catalina_tmpdir_user_and_group = 'tomcat7' + conf_dir = '/etc/tomcat7' + server_xml_user_and_group = 'tomcat7' + when 'ubuntu-18' + when 'ubuntu-16' + end +when 'redhat' + case platform_finger + when 'centos-8' + when 'centos-7' + when 'centos-6' + when 'amazon-2' + when 'amazon-2018' + end +when 'fedora' + case platform_finger + when 'fedora-31' + when 'fedora-30' + end +when 'suse' + case platform_finger + when 'opensuse-15' + server_xml_user_and_group = 'root' + end +when 'linux' + case platform_finger + when 'arch-5' + end +end + +control 'Tomcat main config' do + title 'should contain the lines' + + # Prepare comparison file + main_config_path = "#{comparison_files_dir}/main_config/#{platform_finger}" + main_config = file(main_config_path).content + + describe file(main_config_file) do + it { should be_file } + it { should be_owned_by 'root' } + it { should be_grouped_into 'root' } + its('mode') { should cmp '0644' } + its('content') { should include main_config } + end +end + +control 'Tomcat Catalina temp dir' do + title 'should be prepared with the settings' + + describe file(catalina_tmpdir) do + it { should be_directory } + it { should be_owned_by catalina_tmpdir_user_and_group } + it { should be_grouped_into catalina_tmpdir_user_and_group } + its('mode') { should cmp '0755' } + end +end + +control 'Tomcat `server.xml` config' do + title 'should contain the lines' + + server_xml_file = "#{conf_dir}/server.xml" + server_xml_path = "#{comparison_files_dir}/server_xml/#{platform_finger}.xml" + server_xml = file(server_xml_path).content + # Need the hostname to be used for `tomcat.cluster` + server_xml = server_xml.gsub( + 'HOSTNAME_PLACEHOLDER', + file('/etc/hostname').content.chomp + ) + + describe file(server_xml_file) do + it { should be_file } + it { should be_owned_by server_xml_user_and_group } + it { should be_grouped_into server_xml_user_and_group } + its('mode') { should cmp '0644' } + unless %w[debian-9].include?(platform_finger) + its('content') { should include server_xml } + end + end +end diff --git a/test/integration/default/controls/packages_spec.rb b/test/integration/default/controls/packages_spec.rb index 2a93d78e..800a43c8 100644 --- a/test/integration/default/controls/packages_spec.rb +++ b/test/integration/default/controls/packages_spec.rb @@ -1,5 +1,8 @@ # frozen_string_literal: true +# Prepare platform "finger" +platform_finger = "#{platform[:name]}-#{platform[:release].split('.')[0]}" + control 'Tomcat packages' do title 'should be installed' @@ -7,11 +10,13 @@ packages = case platform[:family] when 'debian' - case platform[:release] - when /^10/ + case platform_finger + when 'debian-10' %w[tomcat9 haveged] - else + when 'debian-9', 'ubuntu-18', 'ubuntu-16' %w[tomcat8 haveged] + when 'debian-8' + %w[tomcat7 haveged] end when 'redhat', 'fedora', 'suse' %w[tomcat] diff --git a/test/integration/default/controls/services_spec.rb b/test/integration/default/controls/services_spec.rb index 32b814de..942367ce 100644 --- a/test/integration/default/controls/services_spec.rb +++ b/test/integration/default/controls/services_spec.rb @@ -1,5 +1,8 @@ # frozen_string_literal: true +# Prepare platform "finger" +platform_finger = "#{platform[:name]}-#{platform[:release].split('.')[0]}" + control 'Tomcat services' do impact 0.5 title 'should be installed, enabled and running' @@ -8,11 +11,13 @@ services = case platform[:family] when 'debian' - case platform[:release] - when /^10/ + case platform_finger + when 'debian-10' %w[tomcat9 haveged] - else + when 'debian-9', 'ubuntu-18', 'ubuntu-16' %w[tomcat8 haveged] + when 'debian-8' + %w[tomcat7 haveged] end when 'redhat', 'fedora', 'suse' %w[tomcat] diff --git a/test/integration/default/controls/yaml_dump_spec.rb b/test/integration/default/controls/yaml_dump_spec.rb index d2e65f15..22181d89 100644 --- a/test/integration/default/controls/yaml_dump_spec.rb +++ b/test/integration/default/controls/yaml_dump_spec.rb @@ -1,5 +1,8 @@ # frozen_string_literal: true +# Prepare platform "finger" +platform_finger = "#{platform[:name]}-#{platform[:release].split('.')[0]}" + control 'Tomcat `map.jinja` YAML dump' do title 'should contain the lines' @@ -7,8 +10,8 @@ yaml_dump += case platform[:family] when 'debian' - case platform[:release] - when /^10/ + case platform_finger + when 'debian-10' conf_dir = '/etc/tomcat9' group = 'tomcat' main_config = '/etc/default/tomcat9' @@ -21,20 +24,7 @@ catalina_home = '/usr/share/tomcat9' catalina_pid = '/var/run/tomcat9.pid' catalina_tmpdir = '/var/cache/tomcat9/temp' - when /^8/ - conf_dir = '/etc/tomcat7' - group = 'tomcat7' - main_config = '/etc/default/tomcat7' - manager_pkg = 'tomcat7-admin' - pkg = 'tomcat7' - service = 'tomcat7' - user = 'tomcat7' - ver = 7 - catalina_base = '/var/lib/tomcat7' - catalina_home = '/usr/share/tomcat7' - catalina_pid = '/var/run/tomcat7.pid' - catalina_tmpdir = '/var/cache/tomcat7/temp' - else + when 'debian-9', 'ubuntu-18', 'ubuntu-16' conf_dir = '/etc/tomcat8' group = 'tomcat8' main_config = '/etc/default/tomcat8' @@ -47,6 +37,19 @@ catalina_home = '/usr/share/tomcat8' catalina_pid = '/var/run/tomcat8.pid' catalina_tmpdir = '/var/cache/tomcat8/temp' + when 'debian-8' + conf_dir = '/etc/tomcat7' + group = 'tomcat7' + main_config = '/etc/default/tomcat7' + manager_pkg = 'tomcat7-admin' + pkg = 'tomcat7' + service = 'tomcat7' + user = 'tomcat7' + ver = 7 + catalina_base = '/var/lib/tomcat7' + catalina_home = '/usr/share/tomcat7' + catalina_pid = '/var/run/tomcat7.pid' + catalina_tmpdir = '/var/cache/tomcat7/temp' end <<~YAML_DUMP.chomp arch: amd64 diff --git a/test/salt/comparison_files/main_config/amazon-2 b/test/salt/comparison_files/main_config/amazon-2 new file mode 100644 index 00000000..0f4c78f2 --- /dev/null +++ b/test/salt/comparison_files/main_config/amazon-2 @@ -0,0 +1,67 @@ +# This file is managed by salt. Manual changes risk being overwritten. +# # Modify the values passed to the tomcat pillar instead. + +# Service-specific configuration file for tomcat. This will be sourced by +# the SysV init script after the global configuration file +# /etc/tomcat/tomcat.conf, thus allowing values to be overridden in +# a per-service manner. +# +# NEVER change the init script itself. To change values for all services make +# your changes in /etc/tomcat/tomcat.conf +# +# To change values for a specific service make your edits here. +# To create a new service create a link from /etc/init.d/ to +# /etc/init.d/tomcat (do not copy the init script) and make a copy of the +# /etc/sysconfig/tomcat file to /etc/sysconfig/ and change +# the property values so the two services won't conflict. Register the new +# service in the system as usual (see chkconfig and similars). +# + +# Where your java installation lives +JAVA_HOME=/usr/lib/jvm/jre + +CATALINA_BASE="/usr/share/tomcat" + +CATALINA_HOME="/usr/share/tomcat" + +CATALINA_TMPDIR="/var/cache/tomcat/temp" + +CATALINA_PID="/var/run/tomcat.pid" + + +# You can pass some parameters to java here if you wish to +#JAVA_OPTS="-Xminf0.1 -Xmaxf0.3" +JAVA_OPTS="-Djava.awt.headless=true -Xmx128m -XX:MaxPermSize=256m -Dlog4j.configuration=file:/tmp/log4j.properties -Dlogback.configurationFile=/tmp/logback.xml" + +#if CLASSPATH is defined in JAVA_OPTS it may no longer munge with the default CLASSPATH +#replace and customize if necessary +#CLASSPATH=/usr/share/tomcat/bin/bootstrap.jar:/usr/share/tomcat/bin/tomcat-juli.jar:/usr/share/java/commons-daemon.jar + +# Use JAVA_OPTS to set java.library.path for libtcnative.so +#JAVA_OPTS="-Djava.library.path=/usr/lib64" + +# What user should run tomcat +TOMCAT_USER=tomcat + +# What group should run tomcat +TOMCAT_GROUP=tomcat + +# You can change your tomcat locale here +#LANG="en_US" + +# Run tomcat under the Java Security Manager +SECURITY_MANAGER="false" + + +# Time to wait in seconds, before killing process +#SHUTDOWN_WAIT="30" + +# Whether to annoy the user with "attempting to shut down" messages or not +#SHUTDOWN_VERBOSE="false" + +# Connector port is 8080 for this tomcat instance +#CONNECTOR_PORT="8080" + +# If you wish to further customize your tomcat environment, +# put your own definitions here +# (i.e. LD_LIBRARY_PATH for some jdbc drivers) diff --git a/test/salt/comparison_files/main_config/centos-7 b/test/salt/comparison_files/main_config/centos-7 new file mode 100644 index 00000000..0f4c78f2 --- /dev/null +++ b/test/salt/comparison_files/main_config/centos-7 @@ -0,0 +1,67 @@ +# This file is managed by salt. Manual changes risk being overwritten. +# # Modify the values passed to the tomcat pillar instead. + +# Service-specific configuration file for tomcat. This will be sourced by +# the SysV init script after the global configuration file +# /etc/tomcat/tomcat.conf, thus allowing values to be overridden in +# a per-service manner. +# +# NEVER change the init script itself. To change values for all services make +# your changes in /etc/tomcat/tomcat.conf +# +# To change values for a specific service make your edits here. +# To create a new service create a link from /etc/init.d/ to +# /etc/init.d/tomcat (do not copy the init script) and make a copy of the +# /etc/sysconfig/tomcat file to /etc/sysconfig/ and change +# the property values so the two services won't conflict. Register the new +# service in the system as usual (see chkconfig and similars). +# + +# Where your java installation lives +JAVA_HOME=/usr/lib/jvm/jre + +CATALINA_BASE="/usr/share/tomcat" + +CATALINA_HOME="/usr/share/tomcat" + +CATALINA_TMPDIR="/var/cache/tomcat/temp" + +CATALINA_PID="/var/run/tomcat.pid" + + +# You can pass some parameters to java here if you wish to +#JAVA_OPTS="-Xminf0.1 -Xmaxf0.3" +JAVA_OPTS="-Djava.awt.headless=true -Xmx128m -XX:MaxPermSize=256m -Dlog4j.configuration=file:/tmp/log4j.properties -Dlogback.configurationFile=/tmp/logback.xml" + +#if CLASSPATH is defined in JAVA_OPTS it may no longer munge with the default CLASSPATH +#replace and customize if necessary +#CLASSPATH=/usr/share/tomcat/bin/bootstrap.jar:/usr/share/tomcat/bin/tomcat-juli.jar:/usr/share/java/commons-daemon.jar + +# Use JAVA_OPTS to set java.library.path for libtcnative.so +#JAVA_OPTS="-Djava.library.path=/usr/lib64" + +# What user should run tomcat +TOMCAT_USER=tomcat + +# What group should run tomcat +TOMCAT_GROUP=tomcat + +# You can change your tomcat locale here +#LANG="en_US" + +# Run tomcat under the Java Security Manager +SECURITY_MANAGER="false" + + +# Time to wait in seconds, before killing process +#SHUTDOWN_WAIT="30" + +# Whether to annoy the user with "attempting to shut down" messages or not +#SHUTDOWN_VERBOSE="false" + +# Connector port is 8080 for this tomcat instance +#CONNECTOR_PORT="8080" + +# If you wish to further customize your tomcat environment, +# put your own definitions here +# (i.e. LD_LIBRARY_PATH for some jdbc drivers) diff --git a/test/salt/comparison_files/main_config/debian-10 b/test/salt/comparison_files/main_config/debian-10 new file mode 100644 index 00000000..a63ac759 --- /dev/null +++ b/test/salt/comparison_files/main_config/debian-10 @@ -0,0 +1,58 @@ +# This file is managed by salt. Manual changes risk being overwritten. +# Modify the values in the tomcat pillar instead. + +# Run Tomcat as this user ID. Not setting this or leaving it blank will use the +# default of tomcat8. +TOMCAT9_USER=tomcat + +# Run Tomcat as this group ID. Not setting this or leaving it blank will use +# the default of tomcat8. +TOMCAT9_GROUP=tomcat + +# The home directory of the Java development kit (JDK). You need at least +# JDK version 7. If JAVA_HOME is not set, some common directories for +# OpenJDK and the Oracle JDK are tried. +JAVA_HOME=/usr/lib/jvm/default-java + +CATALINA_BASE="/var/lib/tomcat9" +CATALINA_HOME="/usr/share/tomcat9" +CATALINA_TMPDIR="/var/cache/tomcat9/temp" +CATALINA_PID="/var/run/tomcat9.pid" + + +# You may pass JVM startup parameters to Java here. If unset, the default +# options will be: -Djava.awt.headless=true -Xmx128m -XX:+UseConcMarkSweepGC +# +# Use "-XX:+UseConcMarkSweepGC" to enable the CMS garbage collector (improved +# response time). If you use that option and you run Tomcat on a machine with +# exactly one CPU chip that contains one or two cores, you should also add +# the "-XX:+CMSIncrementalMode" option. +JAVA_OPTS="-Djava.awt.headless=true -Xmx128m -XX:MaxPermSize=256m -Dlog4j.configuration=file:/tmp/log4j.properties -Dlogback.configurationFile=/tmp/logback.xml" + +# To enable remote debugging uncomment the following line. +# You will then be able to use a java debugger on port 8000. +#JAVA_OPTS="${JAVA_OPTS} -Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n" + +# Java compiler to use for translating JavaServer Pages (JSPs). You can use all +# compilers that are accepted by Ant's build.compiler property. +JSP_COMPILER=javac + + +# Use the Java security manager? (yes/no, default: no) +TOMCAT9_SECURITY=no + + +# Number of days to keep logfiles in /var/log/tomcat8. Default is 14 days. +#LOGFILE_DAYS=14 +# Whether to compress logfiles older than today's +#LOGFILE_COMPRESS=1 + +# Location of the JVM temporary directory +# WARNING: This directory will be destroyed and recreated at every startup ! +JVM_TMP=/tmp/tomcat + + +# If you run Tomcat on port numbers that are all higher than 1023, then you +# do not need authbind. It is used for binding Tomcat to lower port numbers. +# (yes/no, default: no) +AUTHBIND=no diff --git a/test/salt/comparison_files/main_config/debian-8 b/test/salt/comparison_files/main_config/debian-8 new file mode 100644 index 00000000..21953294 --- /dev/null +++ b/test/salt/comparison_files/main_config/debian-8 @@ -0,0 +1,60 @@ +# This file is managed by salt. Manual changes risk being overwritten. +# Modify the values in the tomcat pillar instead. + +# Run Tomcat as this user ID. Not setting this or leaving it blank will use the +# default of tomcat8. +TOMCAT7_USER=tomcat7 + +# Run Tomcat as this group ID. Not setting this or leaving it blank will use +# the default of tomcat8. +TOMCAT7_GROUP=tomcat7 + +# The home directory of the Java development kit (JDK). You need at least +# JDK version 7. If JAVA_HOME is not set, some common directories for +# OpenJDK and the Oracle JDK are tried. +JAVA_HOME=/usr/lib/jvm/default-java + +CATALINA_BASE="/var/lib/tomcat7" +CATALINA_HOME="/usr/share/tomcat7" +CATALINA_TMPDIR="/var/cache/tomcat7/temp" +CATALINA_PID="/var/run/tomcat7.pid" + + +# You may pass JVM startup parameters to Java here. If unset, the default +# options will be: -Djava.awt.headless=true -Xmx128m -XX:+UseConcMarkSweepGC +# +# Use "-XX:+UseConcMarkSweepGC" to enable the CMS garbage collector (improved +# response time). If you use that option and you run Tomcat on a machine with +# exactly one CPU chip that contains one or two cores, you should also add +# the "-XX:+CMSIncrementalMode" option. +JAVA_OPTS="-Djava.awt.headless=true -Xmx128m -XX:MaxPermSize=256m -Dlog4j.configuration=file:/tmp/log4j.properties -Dlogback.configurationFile=/tmp/logback.xml" + +# To enable remote debugging uncomment the following line. +# You will then be able to use a java debugger on port 8000. +#JAVA_OPTS="${JAVA_OPTS} -Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n" + +# Java compiler to use for translating JavaServer Pages (JSPs). You can use all +# compilers that are accepted by Ant's build.compiler property. +JSP_COMPILER=javac + + +# Use the Java security manager? (yes/no, default: no) +TOMCAT7_SECURITY=no + + +# Number of days to keep logfiles in /var/log/tomcat8. Default is 14 days. +#LOGFILE_DAYS=14 +# Whether to compress logfiles older than today's +#LOGFILE_COMPRESS=1 + +# Location of the JVM temporary directory +# WARNING: This directory will be destroyed and recreated at every startup ! +JVM_TMP=/tmp/tomcat + + +# If you run Tomcat on port numbers that are all higher than 1023, then you +# do not need authbind. It is used for binding Tomcat to lower port numbers. +# (yes/no, default: no) +AUTHBIND=no + + diff --git a/test/salt/comparison_files/main_config/debian-9 b/test/salt/comparison_files/main_config/debian-9 new file mode 100644 index 00000000..7ac21445 --- /dev/null +++ b/test/salt/comparison_files/main_config/debian-9 @@ -0,0 +1,58 @@ +# This file is managed by salt. Manual changes risk being overwritten. +# Modify the values in the tomcat pillar instead. + +# Run Tomcat as this user ID. Not setting this or leaving it blank will use the +# default of tomcat8. +TOMCAT8_USER=tomcat8 + +# Run Tomcat as this group ID. Not setting this or leaving it blank will use +# the default of tomcat8. +TOMCAT8_GROUP=tomcat8 + +# The home directory of the Java development kit (JDK). You need at least +# JDK version 7. If JAVA_HOME is not set, some common directories for +# OpenJDK and the Oracle JDK are tried. +JAVA_HOME=/usr/lib/jvm/default-java + +CATALINA_BASE="/var/lib/tomcat8" +CATALINA_HOME="/usr/share/tomcat8" +CATALINA_TMPDIR="/var/cache/tomcat8/temp" +CATALINA_PID="/var/run/tomcat8.pid" + + +# You may pass JVM startup parameters to Java here. If unset, the default +# options will be: -Djava.awt.headless=true -Xmx128m -XX:+UseConcMarkSweepGC +# +# Use "-XX:+UseConcMarkSweepGC" to enable the CMS garbage collector (improved +# response time). If you use that option and you run Tomcat on a machine with +# exactly one CPU chip that contains one or two cores, you should also add +# the "-XX:+CMSIncrementalMode" option. +JAVA_OPTS="-Djava.awt.headless=true -Xmx128m -XX:MaxPermSize=256m -Dlog4j.configuration=file:/tmp/log4j.properties -Dlogback.configurationFile=/tmp/logback.xml" + +# To enable remote debugging uncomment the following line. +# You will then be able to use a java debugger on port 8000. +#JAVA_OPTS="${JAVA_OPTS} -Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n" + +# Java compiler to use for translating JavaServer Pages (JSPs). You can use all +# compilers that are accepted by Ant's build.compiler property. +JSP_COMPILER=javac + + +# Use the Java security manager? (yes/no, default: no) +TOMCAT8_SECURITY=no + + +# Number of days to keep logfiles in /var/log/tomcat8. Default is 14 days. +#LOGFILE_DAYS=14 +# Whether to compress logfiles older than today's +#LOGFILE_COMPRESS=1 + +# Location of the JVM temporary directory +# WARNING: This directory will be destroyed and recreated at every startup ! +JVM_TMP=/tmp/tomcat + + +# If you run Tomcat on port numbers that are all higher than 1023, then you +# do not need authbind. It is used for binding Tomcat to lower port numbers. +# (yes/no, default: no) +AUTHBIND=no diff --git a/test/salt/comparison_files/main_config/fedora-31 b/test/salt/comparison_files/main_config/fedora-31 new file mode 100644 index 00000000..0f4c78f2 --- /dev/null +++ b/test/salt/comparison_files/main_config/fedora-31 @@ -0,0 +1,67 @@ +# This file is managed by salt. Manual changes risk being overwritten. +# # Modify the values passed to the tomcat pillar instead. + +# Service-specific configuration file for tomcat. This will be sourced by +# the SysV init script after the global configuration file +# /etc/tomcat/tomcat.conf, thus allowing values to be overridden in +# a per-service manner. +# +# NEVER change the init script itself. To change values for all services make +# your changes in /etc/tomcat/tomcat.conf +# +# To change values for a specific service make your edits here. +# To create a new service create a link from /etc/init.d/ to +# /etc/init.d/tomcat (do not copy the init script) and make a copy of the +# /etc/sysconfig/tomcat file to /etc/sysconfig/ and change +# the property values so the two services won't conflict. Register the new +# service in the system as usual (see chkconfig and similars). +# + +# Where your java installation lives +JAVA_HOME=/usr/lib/jvm/jre + +CATALINA_BASE="/usr/share/tomcat" + +CATALINA_HOME="/usr/share/tomcat" + +CATALINA_TMPDIR="/var/cache/tomcat/temp" + +CATALINA_PID="/var/run/tomcat.pid" + + +# You can pass some parameters to java here if you wish to +#JAVA_OPTS="-Xminf0.1 -Xmaxf0.3" +JAVA_OPTS="-Djava.awt.headless=true -Xmx128m -XX:MaxPermSize=256m -Dlog4j.configuration=file:/tmp/log4j.properties -Dlogback.configurationFile=/tmp/logback.xml" + +#if CLASSPATH is defined in JAVA_OPTS it may no longer munge with the default CLASSPATH +#replace and customize if necessary +#CLASSPATH=/usr/share/tomcat/bin/bootstrap.jar:/usr/share/tomcat/bin/tomcat-juli.jar:/usr/share/java/commons-daemon.jar + +# Use JAVA_OPTS to set java.library.path for libtcnative.so +#JAVA_OPTS="-Djava.library.path=/usr/lib64" + +# What user should run tomcat +TOMCAT_USER=tomcat + +# What group should run tomcat +TOMCAT_GROUP=tomcat + +# You can change your tomcat locale here +#LANG="en_US" + +# Run tomcat under the Java Security Manager +SECURITY_MANAGER="false" + + +# Time to wait in seconds, before killing process +#SHUTDOWN_WAIT="30" + +# Whether to annoy the user with "attempting to shut down" messages or not +#SHUTDOWN_VERBOSE="false" + +# Connector port is 8080 for this tomcat instance +#CONNECTOR_PORT="8080" + +# If you wish to further customize your tomcat environment, +# put your own definitions here +# (i.e. LD_LIBRARY_PATH for some jdbc drivers) diff --git a/test/salt/comparison_files/main_config/opensuse-15 b/test/salt/comparison_files/main_config/opensuse-15 new file mode 100644 index 00000000..0f4c78f2 --- /dev/null +++ b/test/salt/comparison_files/main_config/opensuse-15 @@ -0,0 +1,67 @@ +# This file is managed by salt. Manual changes risk being overwritten. +# # Modify the values passed to the tomcat pillar instead. + +# Service-specific configuration file for tomcat. This will be sourced by +# the SysV init script after the global configuration file +# /etc/tomcat/tomcat.conf, thus allowing values to be overridden in +# a per-service manner. +# +# NEVER change the init script itself. To change values for all services make +# your changes in /etc/tomcat/tomcat.conf +# +# To change values for a specific service make your edits here. +# To create a new service create a link from /etc/init.d/ to +# /etc/init.d/tomcat (do not copy the init script) and make a copy of the +# /etc/sysconfig/tomcat file to /etc/sysconfig/ and change +# the property values so the two services won't conflict. Register the new +# service in the system as usual (see chkconfig and similars). +# + +# Where your java installation lives +JAVA_HOME=/usr/lib/jvm/jre + +CATALINA_BASE="/usr/share/tomcat" + +CATALINA_HOME="/usr/share/tomcat" + +CATALINA_TMPDIR="/var/cache/tomcat/temp" + +CATALINA_PID="/var/run/tomcat.pid" + + +# You can pass some parameters to java here if you wish to +#JAVA_OPTS="-Xminf0.1 -Xmaxf0.3" +JAVA_OPTS="-Djava.awt.headless=true -Xmx128m -XX:MaxPermSize=256m -Dlog4j.configuration=file:/tmp/log4j.properties -Dlogback.configurationFile=/tmp/logback.xml" + +#if CLASSPATH is defined in JAVA_OPTS it may no longer munge with the default CLASSPATH +#replace and customize if necessary +#CLASSPATH=/usr/share/tomcat/bin/bootstrap.jar:/usr/share/tomcat/bin/tomcat-juli.jar:/usr/share/java/commons-daemon.jar + +# Use JAVA_OPTS to set java.library.path for libtcnative.so +#JAVA_OPTS="-Djava.library.path=/usr/lib64" + +# What user should run tomcat +TOMCAT_USER=tomcat + +# What group should run tomcat +TOMCAT_GROUP=tomcat + +# You can change your tomcat locale here +#LANG="en_US" + +# Run tomcat under the Java Security Manager +SECURITY_MANAGER="false" + + +# Time to wait in seconds, before killing process +#SHUTDOWN_WAIT="30" + +# Whether to annoy the user with "attempting to shut down" messages or not +#SHUTDOWN_VERBOSE="false" + +# Connector port is 8080 for this tomcat instance +#CONNECTOR_PORT="8080" + +# If you wish to further customize your tomcat environment, +# put your own definitions here +# (i.e. LD_LIBRARY_PATH for some jdbc drivers) diff --git a/test/salt/comparison_files/main_config/ubuntu-16 b/test/salt/comparison_files/main_config/ubuntu-16 new file mode 100644 index 00000000..7ac21445 --- /dev/null +++ b/test/salt/comparison_files/main_config/ubuntu-16 @@ -0,0 +1,58 @@ +# This file is managed by salt. Manual changes risk being overwritten. +# Modify the values in the tomcat pillar instead. + +# Run Tomcat as this user ID. Not setting this or leaving it blank will use the +# default of tomcat8. +TOMCAT8_USER=tomcat8 + +# Run Tomcat as this group ID. Not setting this or leaving it blank will use +# the default of tomcat8. +TOMCAT8_GROUP=tomcat8 + +# The home directory of the Java development kit (JDK). You need at least +# JDK version 7. If JAVA_HOME is not set, some common directories for +# OpenJDK and the Oracle JDK are tried. +JAVA_HOME=/usr/lib/jvm/default-java + +CATALINA_BASE="/var/lib/tomcat8" +CATALINA_HOME="/usr/share/tomcat8" +CATALINA_TMPDIR="/var/cache/tomcat8/temp" +CATALINA_PID="/var/run/tomcat8.pid" + + +# You may pass JVM startup parameters to Java here. If unset, the default +# options will be: -Djava.awt.headless=true -Xmx128m -XX:+UseConcMarkSweepGC +# +# Use "-XX:+UseConcMarkSweepGC" to enable the CMS garbage collector (improved +# response time). If you use that option and you run Tomcat on a machine with +# exactly one CPU chip that contains one or two cores, you should also add +# the "-XX:+CMSIncrementalMode" option. +JAVA_OPTS="-Djava.awt.headless=true -Xmx128m -XX:MaxPermSize=256m -Dlog4j.configuration=file:/tmp/log4j.properties -Dlogback.configurationFile=/tmp/logback.xml" + +# To enable remote debugging uncomment the following line. +# You will then be able to use a java debugger on port 8000. +#JAVA_OPTS="${JAVA_OPTS} -Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n" + +# Java compiler to use for translating JavaServer Pages (JSPs). You can use all +# compilers that are accepted by Ant's build.compiler property. +JSP_COMPILER=javac + + +# Use the Java security manager? (yes/no, default: no) +TOMCAT8_SECURITY=no + + +# Number of days to keep logfiles in /var/log/tomcat8. Default is 14 days. +#LOGFILE_DAYS=14 +# Whether to compress logfiles older than today's +#LOGFILE_COMPRESS=1 + +# Location of the JVM temporary directory +# WARNING: This directory will be destroyed and recreated at every startup ! +JVM_TMP=/tmp/tomcat + + +# If you run Tomcat on port numbers that are all higher than 1023, then you +# do not need authbind. It is used for binding Tomcat to lower port numbers. +# (yes/no, default: no) +AUTHBIND=no diff --git a/test/salt/comparison_files/main_config/ubuntu-18 b/test/salt/comparison_files/main_config/ubuntu-18 new file mode 100644 index 00000000..7ac21445 --- /dev/null +++ b/test/salt/comparison_files/main_config/ubuntu-18 @@ -0,0 +1,58 @@ +# This file is managed by salt. Manual changes risk being overwritten. +# Modify the values in the tomcat pillar instead. + +# Run Tomcat as this user ID. Not setting this or leaving it blank will use the +# default of tomcat8. +TOMCAT8_USER=tomcat8 + +# Run Tomcat as this group ID. Not setting this or leaving it blank will use +# the default of tomcat8. +TOMCAT8_GROUP=tomcat8 + +# The home directory of the Java development kit (JDK). You need at least +# JDK version 7. If JAVA_HOME is not set, some common directories for +# OpenJDK and the Oracle JDK are tried. +JAVA_HOME=/usr/lib/jvm/default-java + +CATALINA_BASE="/var/lib/tomcat8" +CATALINA_HOME="/usr/share/tomcat8" +CATALINA_TMPDIR="/var/cache/tomcat8/temp" +CATALINA_PID="/var/run/tomcat8.pid" + + +# You may pass JVM startup parameters to Java here. If unset, the default +# options will be: -Djava.awt.headless=true -Xmx128m -XX:+UseConcMarkSweepGC +# +# Use "-XX:+UseConcMarkSweepGC" to enable the CMS garbage collector (improved +# response time). If you use that option and you run Tomcat on a machine with +# exactly one CPU chip that contains one or two cores, you should also add +# the "-XX:+CMSIncrementalMode" option. +JAVA_OPTS="-Djava.awt.headless=true -Xmx128m -XX:MaxPermSize=256m -Dlog4j.configuration=file:/tmp/log4j.properties -Dlogback.configurationFile=/tmp/logback.xml" + +# To enable remote debugging uncomment the following line. +# You will then be able to use a java debugger on port 8000. +#JAVA_OPTS="${JAVA_OPTS} -Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n" + +# Java compiler to use for translating JavaServer Pages (JSPs). You can use all +# compilers that are accepted by Ant's build.compiler property. +JSP_COMPILER=javac + + +# Use the Java security manager? (yes/no, default: no) +TOMCAT8_SECURITY=no + + +# Number of days to keep logfiles in /var/log/tomcat8. Default is 14 days. +#LOGFILE_DAYS=14 +# Whether to compress logfiles older than today's +#LOGFILE_COMPRESS=1 + +# Location of the JVM temporary directory +# WARNING: This directory will be destroyed and recreated at every startup ! +JVM_TMP=/tmp/tomcat + + +# If you run Tomcat on port numbers that are all higher than 1023, then you +# do not need authbind. It is used for binding Tomcat to lower port numbers. +# (yes/no, default: no) +AUTHBIND=no diff --git a/test/salt/comparison_files/server_xml/amazon-2.xml b/test/salt/comparison_files/server_xml/amazon-2.xml new file mode 100644 index 00000000..fd7be24f --- /dev/null +++ b/test/salt/comparison_files/server_xml/amazon-2.xml @@ -0,0 +1,173 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + www.example.com + + + + + + + www.example.net + + + + + + + + + + diff --git a/test/salt/comparison_files/server_xml/centos-7.xml b/test/salt/comparison_files/server_xml/centos-7.xml new file mode 100644 index 00000000..fd7be24f --- /dev/null +++ b/test/salt/comparison_files/server_xml/centos-7.xml @@ -0,0 +1,173 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + www.example.com + + + + + + + www.example.net + + + + + + + + + + diff --git a/test/salt/comparison_files/server_xml/debian-10.xml b/test/salt/comparison_files/server_xml/debian-10.xml new file mode 100644 index 00000000..93757aec --- /dev/null +++ b/test/salt/comparison_files/server_xml/debian-10.xml @@ -0,0 +1,148 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + www.example.com + + + + + + + www.example.net + + + + + + + + + + diff --git a/test/salt/comparison_files/server_xml/debian-8.xml b/test/salt/comparison_files/server_xml/debian-8.xml new file mode 100644 index 00000000..2e673704 --- /dev/null +++ b/test/salt/comparison_files/server_xml/debian-8.xml @@ -0,0 +1,173 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + www.example.net + + + + + + + + + + www.example.com + + + + + + + diff --git a/test/salt/comparison_files/server_xml/debian-9.xml b/test/salt/comparison_files/server_xml/debian-9.xml new file mode 100644 index 00000000..c2cbc256 --- /dev/null +++ b/test/salt/comparison_files/server_xml/debian-9.xml @@ -0,0 +1,148 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + www.example.net + + + + + + + + + + www.example.com + + + + + + + diff --git a/test/salt/comparison_files/server_xml/fedora-31.xml b/test/salt/comparison_files/server_xml/fedora-31.xml new file mode 100644 index 00000000..93757aec --- /dev/null +++ b/test/salt/comparison_files/server_xml/fedora-31.xml @@ -0,0 +1,148 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + www.example.com + + + + + + + www.example.net + + + + + + + + + + diff --git a/test/salt/comparison_files/server_xml/opensuse-15.xml b/test/salt/comparison_files/server_xml/opensuse-15.xml new file mode 100644 index 00000000..ed7175b5 --- /dev/null +++ b/test/salt/comparison_files/server_xml/opensuse-15.xml @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + www.example.com + + + + + + + www.example.net + + + + + + + + + + \ No newline at end of file diff --git a/test/salt/comparison_files/server_xml/ubuntu-16.xml b/test/salt/comparison_files/server_xml/ubuntu-16.xml new file mode 100644 index 00000000..93757aec --- /dev/null +++ b/test/salt/comparison_files/server_xml/ubuntu-16.xml @@ -0,0 +1,148 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + www.example.com + + + + + + + www.example.net + + + + + + + + + + diff --git a/test/salt/comparison_files/server_xml/ubuntu-18.xml b/test/salt/comparison_files/server_xml/ubuntu-18.xml new file mode 100644 index 00000000..93757aec --- /dev/null +++ b/test/salt/comparison_files/server_xml/ubuntu-18.xml @@ -0,0 +1,148 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + www.example.com + + + + + + + www.example.net + + + + + + + + + +