Merge branch 'master' into 2019_2_1_port_52786

This commit is contained in:
Daniel Wozniak 2019-11-12 10:13:50 -07:00 committed by GitHub
commit 005513b17d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
64 changed files with 1142 additions and 226 deletions

View File

@ -2,7 +2,6 @@
// Define the maximum time, in hours, that a test run should run for
def global_timeout = 2
def salt_target_branch = 'master'
properties([
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '10')),

View File

@ -1,4 +1,4 @@
@Library('salt@master-1.2') _
@Library('salt@master-1.3') _
// Define the maximum time, in hours, that a test run should run for
def testrun_timeout = 6
@ -7,8 +7,7 @@ def distro_name = 'amazon'
def distro_version = '1'
def python_version = 'py2'
def nox_env_name = 'runtests-zeromq'
def salt_target_branch = 'master'
def golden_images_branch = '2019.2'
def golden_images_branch = 'master'
def nox_passthrough_opts = '--ssh-tests'
def concurrent_builds = 1
def use_spot_instances = true
@ -35,7 +34,6 @@ runTests(
distro_name: distro_name,
distro_version: distro_version,
python_version: python_version,
salt_target_branch: salt_target_branch,
golden_images_branch: golden_images_branch,
nox_env_name: nox_env_name,
nox_passthrough_opts: nox_passthrough_opts,

View File

@ -1,4 +1,4 @@
@Library('salt@master-1.2') _
@Library('salt@master-1.3') _
// Define the maximum time, in hours, that a test run should run for
def testrun_timeout = 6
@ -7,8 +7,7 @@ def distro_name = 'amazon'
def distro_version = '2'
def python_version = 'py2'
def nox_env_name = 'runtests-zeromq'
def salt_target_branch = 'master'
def golden_images_branch = '2019.2'
def golden_images_branch = 'master'
def nox_passthrough_opts = '--ssh-tests'
def concurrent_builds = 1
def use_spot_instances = true
@ -35,7 +34,6 @@ runTests(
distro_name: distro_name,
distro_version: distro_version,
python_version: python_version,
salt_target_branch: salt_target_branch,
golden_images_branch: golden_images_branch,
nox_env_name: nox_env_name,
nox_passthrough_opts: nox_passthrough_opts,

View File

@ -1,4 +1,4 @@
@Library('salt@master-1.2') _
@Library('salt@master-1.3') _
// Define the maximum time, in hours, that a test run should run for
def testrun_timeout = 6
@ -7,8 +7,7 @@ def distro_name = 'amazon'
def distro_version = '2'
def python_version = 'py3'
def nox_env_name = 'runtests-zeromq'
def salt_target_branch = 'master'
def golden_images_branch = '2019.2'
def golden_images_branch = 'master'
def nox_passthrough_opts = '--ssh-tests'
def concurrent_builds = 1
def use_spot_instances = true
@ -35,7 +34,6 @@ runTests(
distro_name: distro_name,
distro_version: distro_version,
python_version: python_version,
salt_target_branch: salt_target_branch,
golden_images_branch: golden_images_branch,
nox_env_name: nox_env_name,
nox_passthrough_opts: nox_passthrough_opts,

View File

@ -1,4 +1,4 @@
@Library('salt@master-1.2') _
@Library('salt@master-1.3') _
// Define the maximum time, in hours, that a test run should run for
def testrun_timeout = 6
@ -7,8 +7,7 @@ def distro_name = 'arch'
def distro_version = 'lts'
def python_version = 'py2'
def nox_env_name = 'runtests-zeromq'
def salt_target_branch = 'master'
def golden_images_branch = '2019.2'
def golden_images_branch = 'master'
def nox_passthrough_opts = '-n integration.modules.test_pkg'
def concurrent_builds = 1
def use_spot_instances = true
@ -35,7 +34,6 @@ runTests(
distro_name: distro_name,
distro_version: distro_version,
python_version: python_version,
salt_target_branch: salt_target_branch,
golden_images_branch: golden_images_branch,
nox_env_name: nox_env_name,
nox_passthrough_opts: nox_passthrough_opts,

View File

@ -1,4 +1,4 @@
@Library('salt@master-1.2') _
@Library('salt@master-1.3') _
// Define the maximum time, in hours, that a test run should run for
def testrun_timeout = 6
@ -7,8 +7,7 @@ def distro_name = 'arch'
def distro_version = 'lts'
def python_version = 'py3'
def nox_env_name = 'runtests-zeromq'
def salt_target_branch = 'master'
def golden_images_branch = '2019.2'
def golden_images_branch = 'master'
def nox_passthrough_opts = '-n integration.modules.test_pkg'
def concurrent_builds = 1
def use_spot_instances = true
@ -35,7 +34,6 @@ runTests(
distro_name: distro_name,
distro_version: distro_version,
python_version: python_version,
salt_target_branch: salt_target_branch,
golden_images_branch: golden_images_branch,
nox_env_name: nox_env_name,
nox_passthrough_opts: nox_passthrough_opts,

View File

@ -1,4 +1,4 @@
@Library('salt@master-1.2') _
@Library('salt@master-1.3') _
// Define the maximum time, in hours, that a test run should run for
def testrun_timeout = 6
@ -7,8 +7,7 @@ def distro_name = 'centos'
def distro_version = '6'
def python_version = 'py2'
def nox_env_name = 'runtests-zeromq'
def salt_target_branch = 'master'
def golden_images_branch = '2019.2'
def golden_images_branch = 'master'
def nox_passthrough_opts = '--ssh-tests'
def concurrent_builds = 1
def use_spot_instances = true
@ -35,7 +34,6 @@ runTests(
distro_name: distro_name,
distro_version: distro_version,
python_version: python_version,
salt_target_branch: salt_target_branch,
golden_images_branch: golden_images_branch,
nox_env_name: nox_env_name,
nox_passthrough_opts: nox_passthrough_opts,

View File

@ -1,4 +1,4 @@
@Library('salt@master-1.2') _
@Library('salt@master-1.3') _
// Define the maximum time, in hours, that a test run should run for
def testrun_timeout = 6
@ -7,8 +7,7 @@ def distro_name = 'centos'
def distro_version = '7'
def python_version = 'py2'
def nox_env_name = 'runtests-zeromq'
def salt_target_branch = 'master'
def golden_images_branch = '2019.2'
def golden_images_branch = 'master'
def nox_passthrough_opts = '--ssh-tests'
def concurrent_builds = 1
def use_spot_instances = true
@ -35,7 +34,6 @@ runTests(
distro_name: distro_name,
distro_version: distro_version,
python_version: python_version,
salt_target_branch: salt_target_branch,
golden_images_branch: golden_images_branch,
nox_env_name: nox_env_name,
nox_passthrough_opts: nox_passthrough_opts,

View File

@ -1,16 +1,14 @@
@Library('salt@master-1.2') _
@Library('salt@master-1.3') _
// Define the maximum time, in hours, that a test run should run for
def testrun_timeout = 6
def distro_name = 'fedora'
def distro_version = '29'
def distro_name = 'centos'
def distro_version = '7'
def python_version = 'py2'
def nox_env_name = 'runtests-zeromq'
def salt_target_branch = 'master'
def golden_images_branch = '2019.2'
def nox_passthrough_opts = '--ssh-tests'
def concurrent_builds = 1
def nox_env_name = 'runtests-cloud'
def golden_images_branch = 'master'
def nox_passthrough_opts = ''
def use_spot_instances = true
def jenkins_slave_label = 'kitchen-slave'
@ -21,21 +19,11 @@ properties([
])
])
// Be sure to cancel any previously running builds
def buildNumber = env.BUILD_NUMBER as int
if (buildNumber > concurrent_builds) {
// This will cancel the previous build which also defined a matching milestone
milestone(buildNumber - concurrent_builds)
}
// Define a milestone for this build so that, if another build starts, this one will be aborted
milestone(buildNumber)
runTests(
env: env,
distro_name: distro_name,
distro_version: distro_version,
python_version: python_version,
salt_target_branch: salt_target_branch,
golden_images_branch: golden_images_branch,
nox_env_name: nox_env_name,
nox_passthrough_opts: nox_passthrough_opts,

View File

@ -1,4 +1,4 @@
@Library('salt@master-1.2') _
@Library('salt@master-1.3') _
// Define the maximum time, in hours, that a test run should run for
def testrun_timeout = 6
@ -7,8 +7,7 @@ def distro_name = 'centos'
def distro_version = '7'
def python_version = 'py2'
def nox_env_name = 'runtests-zeromq-m2crypto'
def salt_target_branch = 'master'
def golden_images_branch = '2019.2'
def golden_images_branch = 'master'
def nox_passthrough_opts = '--ssh-tests'
def concurrent_builds = 1
def use_spot_instances = true
@ -35,7 +34,6 @@ runTests(
distro_name: distro_name,
distro_version: distro_version,
python_version: python_version,
salt_target_branch: salt_target_branch,
golden_images_branch: golden_images_branch,
nox_env_name: nox_env_name,
nox_passthrough_opts: nox_passthrough_opts,

View File

@ -1,4 +1,4 @@
@Library('salt@master-1.2') _
@Library('salt@master-1.3') _
// Define the maximum time, in hours, that a test run should run for
def testrun_timeout = 6
@ -7,8 +7,7 @@ def distro_name = 'centos'
def distro_version = '7'
def python_version = 'py2'
def nox_env_name = 'runtests-zeromq'
def salt_target_branch = 'master'
def golden_images_branch = '2019.2'
def golden_images_branch = 'master'
def nox_passthrough_opts = '--proxy'
def concurrent_builds = 1
def use_spot_instances = true
@ -35,7 +34,6 @@ runTests(
distro_name: distro_name,
distro_version: distro_version,
python_version: python_version,
salt_target_branch: salt_target_branch,
golden_images_branch: golden_images_branch,
nox_env_name: nox_env_name,
nox_passthrough_opts: nox_passthrough_opts,

View File

@ -1,4 +1,4 @@
@Library('salt@master-1.2') _
@Library('salt@master-1.3') _
// Define the maximum time, in hours, that a test run should run for
def testrun_timeout = 6
@ -7,8 +7,7 @@ def distro_name = 'centos'
def distro_version = '7'
def python_version = 'py2'
def nox_env_name = 'runtests-zeromq-pycryptodomex'
def salt_target_branch = 'master'
def golden_images_branch = '2019.2'
def golden_images_branch = 'master'
def nox_passthrough_opts = '--ssh-tests'
def concurrent_builds = 1
def use_spot_instances = true
@ -35,7 +34,6 @@ runTests(
distro_name: distro_name,
distro_version: distro_version,
python_version: python_version,
salt_target_branch: salt_target_branch,
golden_images_branch: golden_images_branch,
nox_env_name: nox_env_name,
nox_passthrough_opts: nox_passthrough_opts,

View File

@ -1,4 +1,4 @@
@Library('salt@master-1.2') _
@Library('salt@master-1.3') _
// Define the maximum time, in hours, that a test run should run for
def testrun_timeout = 6
@ -7,8 +7,7 @@ def distro_name = 'centos'
def distro_version = '7'
def python_version = 'py2'
def nox_env_name = 'runtests-tcp'
def salt_target_branch = 'master'
def golden_images_branch = '2019.2'
def golden_images_branch = 'master'
def nox_passthrough_opts = '--ssh-tests'
def concurrent_builds = 1
def use_spot_instances = true
@ -35,7 +34,6 @@ runTests(
distro_name: distro_name,
distro_version: distro_version,
python_version: python_version,
salt_target_branch: salt_target_branch,
golden_images_branch: golden_images_branch,
nox_env_name: nox_env_name,
nox_passthrough_opts: nox_passthrough_opts,

View File

@ -1,4 +1,4 @@
@Library('salt@master-1.2') _
@Library('salt@master-1.3') _
// Define the maximum time, in hours, that a test run should run for
def testrun_timeout = 6
@ -7,8 +7,7 @@ def distro_name = 'centos'
def distro_version = '7'
def python_version = 'py2'
def nox_env_name = 'runtests-tornado'
def salt_target_branch = 'master'
def golden_images_branch = '2019.2'
def golden_images_branch = 'master'
def nox_passthrough_opts = '--ssh-tests'
def concurrent_builds = 1
def use_spot_instances = true
@ -35,7 +34,6 @@ runTests(
distro_name: distro_name,
distro_version: distro_version,
python_version: python_version,
salt_target_branch: salt_target_branch,
golden_images_branch: golden_images_branch,
nox_env_name: nox_env_name,
nox_passthrough_opts: nox_passthrough_opts,

View File

@ -1,4 +1,4 @@
@Library('salt@master-1.2') _
@Library('salt@master-1.3') _
// Define the maximum time, in hours, that a test run should run for
def testrun_timeout = 6
@ -7,8 +7,7 @@ def distro_name = 'centos'
def distro_version = '7'
def python_version = 'py3'
def nox_env_name = 'runtests-zeromq'
def salt_target_branch = 'master'
def golden_images_branch = '2019.2'
def golden_images_branch = 'master'
def nox_passthrough_opts = '--ssh-tests'
def concurrent_builds = 1
def use_spot_instances = true
@ -35,7 +34,6 @@ runTests(
distro_name: distro_name,
distro_version: distro_version,
python_version: python_version,
salt_target_branch: salt_target_branch,
golden_images_branch: golden_images_branch,
nox_env_name: nox_env_name,
nox_passthrough_opts: nox_passthrough_opts,

View File

@ -1,16 +1,14 @@
@Library('salt@master-1.2') _
@Library('salt@master-1.3') _
// Define the maximum time, in hours, that a test run should run for
def testrun_timeout = 6
def distro_name = 'fedora'
def distro_version = '29'
def distro_name = 'centos'
def distro_version = '7'
def python_version = 'py3'
def nox_env_name = 'runtests-zeromq'
def salt_target_branch = 'master'
def golden_images_branch = '2019.2'
def nox_passthrough_opts = '--ssh-tests'
def concurrent_builds = 1
def nox_env_name = 'runtests-cloud'
def golden_images_branch = 'master'
def nox_passthrough_opts = ''
def use_spot_instances = true
def jenkins_slave_label = 'kitchen-slave'
@ -21,21 +19,11 @@ properties([
])
])
// Be sure to cancel any previously running builds
def buildNumber = env.BUILD_NUMBER as int
if (buildNumber > concurrent_builds) {
// This will cancel the previous build which also defined a matching milestone
milestone(buildNumber - concurrent_builds)
}
// Define a milestone for this build so that, if another build starts, this one will be aborted
milestone(buildNumber)
runTests(
env: env,
distro_name: distro_name,
distro_version: distro_version,
python_version: python_version,
salt_target_branch: salt_target_branch,
golden_images_branch: golden_images_branch,
nox_env_name: nox_env_name,
nox_passthrough_opts: nox_passthrough_opts,

View File

@ -1,4 +1,4 @@
@Library('salt@master-1.2') _
@Library('salt@master-1.3') _
// Define the maximum time, in hours, that a test run should run for
def testrun_timeout = 6
@ -7,8 +7,7 @@ def distro_name = 'centos'
def distro_version = '7'
def python_version = 'py3'
def nox_env_name = 'runtests-zeromq-m2crypto'
def salt_target_branch = 'master'
def golden_images_branch = '2019.2'
def golden_images_branch = 'master'
def nox_passthrough_opts = '--ssh-tests'
def concurrent_builds = 1
def use_spot_instances = true
@ -35,7 +34,6 @@ runTests(
distro_name: distro_name,
distro_version: distro_version,
python_version: python_version,
salt_target_branch: salt_target_branch,
golden_images_branch: golden_images_branch,
nox_env_name: nox_env_name,
nox_passthrough_opts: nox_passthrough_opts,

View File

@ -1,4 +1,4 @@
@Library('salt@master-1.2') _
@Library('salt@master-1.3') _
// Define the maximum time, in hours, that a test run should run for
def testrun_timeout = 6
@ -7,8 +7,7 @@ def distro_name = 'centos'
def distro_version = '7'
def python_version = 'py3'
def nox_env_name = 'runtests-zeromq'
def salt_target_branch = 'master'
def golden_images_branch = '2019.2'
def golden_images_branch = 'master'
def nox_passthrough_opts = '--proxy'
def concurrent_builds = 1
def use_spot_instances = true
@ -35,7 +34,6 @@ runTests(
distro_name: distro_name,
distro_version: distro_version,
python_version: python_version,
salt_target_branch: salt_target_branch,
golden_images_branch: golden_images_branch,
nox_env_name: nox_env_name,
nox_passthrough_opts: nox_passthrough_opts,

View File

@ -1,4 +1,4 @@
@Library('salt@master-1.2') _
@Library('salt@master-1.3') _
// Define the maximum time, in hours, that a test run should run for
def testrun_timeout = 6
@ -7,8 +7,7 @@ def distro_name = 'centos'
def distro_version = '7'
def python_version = 'py3'
def nox_env_name = 'runtests-zeromq-pycryptodomex'
def salt_target_branch = 'master'
def golden_images_branch = '2019.2'
def golden_images_branch = 'master'
def nox_passthrough_opts = '--ssh-tests'
def concurrent_builds = 1
def use_spot_instances = true
@ -35,7 +34,6 @@ runTests(
distro_name: distro_name,
distro_version: distro_version,
python_version: python_version,
salt_target_branch: salt_target_branch,
golden_images_branch: golden_images_branch,
nox_env_name: nox_env_name,
nox_passthrough_opts: nox_passthrough_opts,

View File

@ -1,4 +1,4 @@
@Library('salt@master-1.2') _
@Library('salt@master-1.3') _
// Define the maximum time, in hours, that a test run should run for
def testrun_timeout = 6
@ -7,8 +7,7 @@ def distro_name = 'centos'
def distro_version = '7'
def python_version = 'py3'
def nox_env_name = 'runtests-tcp'
def salt_target_branch = 'master'
def golden_images_branch = '2019.2'
def golden_images_branch = 'master'
def nox_passthrough_opts = '--ssh-tests'
def concurrent_builds = 1
def use_spot_instances = true
@ -35,7 +34,6 @@ runTests(
distro_name: distro_name,
distro_version: distro_version,
python_version: python_version,
salt_target_branch: salt_target_branch,
golden_images_branch: golden_images_branch,
nox_env_name: nox_env_name,
nox_passthrough_opts: nox_passthrough_opts,

View File

@ -1,4 +1,4 @@
@Library('salt@master-1.2') _
@Library('salt@master-1.3') _
// Define the maximum time, in hours, that a test run should run for
def testrun_timeout = 6
@ -7,7 +7,6 @@ def distro_name = 'debian'
def distro_version = '10'
def python_version = 'py3'
def nox_env_name = 'runtests-zeromq'
def salt_target_branch = 'master'
def golden_images_branch = 'master'
def nox_passthrough_opts = '--ssh-tests'
def concurrent_builds = 1
@ -35,7 +34,6 @@ runTests(
distro_name: distro_name,
distro_version: distro_version,
python_version: python_version,
salt_target_branch: salt_target_branch,
golden_images_branch: golden_images_branch,
nox_env_name: nox_env_name,
nox_passthrough_opts: nox_passthrough_opts,

View File

@ -1,4 +1,4 @@
@Library('salt@master-1.2') _
@Library('salt@master-1.3') _
// Define the maximum time, in hours, that a test run should run for
def testrun_timeout = 6
@ -7,8 +7,7 @@ def distro_name = 'debian'
def distro_version = '8'
def python_version = 'py2'
def nox_env_name = 'runtests-zeromq'
def salt_target_branch = 'master'
def golden_images_branch = '2019.2'
def golden_images_branch = 'master'
def nox_passthrough_opts = '--ssh-tests'
def concurrent_builds = 1
def use_spot_instances = true
@ -35,7 +34,6 @@ runTests(
distro_name: distro_name,
distro_version: distro_version,
python_version: python_version,
salt_target_branch: salt_target_branch,
golden_images_branch: golden_images_branch,
nox_env_name: nox_env_name,
nox_passthrough_opts: nox_passthrough_opts,

View File

@ -1,4 +1,4 @@
@Library('salt@master-1.2') _
@Library('salt@master-1.3') _
// Define the maximum time, in hours, that a test run should run for
def testrun_timeout = 6
@ -7,8 +7,7 @@ def distro_name = 'debian'
def distro_version = '9'
def python_version = 'py2'
def nox_env_name = 'runtests-zeromq'
def salt_target_branch = 'master'
def golden_images_branch = '2019.2'
def golden_images_branch = 'master'
def nox_passthrough_opts = '--ssh-tests'
def concurrent_builds = 1
def use_spot_instances = true
@ -35,7 +34,6 @@ runTests(
distro_name: distro_name,
distro_version: distro_version,
python_version: python_version,
salt_target_branch: salt_target_branch,
golden_images_branch: golden_images_branch,
nox_env_name: nox_env_name,
nox_passthrough_opts: nox_passthrough_opts,

View File

@ -1,4 +1,4 @@
@Library('salt@master-1.2') _
@Library('salt@master-1.3') _
// Define the maximum time, in hours, that a test run should run for
def testrun_timeout = 6
@ -7,8 +7,7 @@ def distro_name = 'debian'
def distro_version = '9'
def python_version = 'py3'
def nox_env_name = 'runtests-zeromq'
def salt_target_branch = 'master'
def golden_images_branch = '2019.2'
def golden_images_branch = 'master'
def nox_passthrough_opts = '--ssh-tests'
def concurrent_builds = 1
def use_spot_instances = true
@ -35,7 +34,6 @@ runTests(
distro_name: distro_name,
distro_version: distro_version,
python_version: python_version,
salt_target_branch: salt_target_branch,
golden_images_branch: golden_images_branch,
nox_env_name: nox_env_name,
nox_passthrough_opts: nox_passthrough_opts,

View File

@ -1,4 +1,4 @@
@Library('salt@master-1.2') _
@Library('salt@master-1.3') _
// Define the maximum time, in hours, that a test run should run for
def testrun_timeout = 6
@ -7,8 +7,7 @@ def distro_name = 'fedora'
def distro_version = '30'
def python_version = 'py2'
def nox_env_name = 'runtests-zeromq'
def salt_target_branch = 'master'
def golden_images_branch = '2019.2'
def golden_images_branch = 'master'
def nox_passthrough_opts = '--ssh-tests'
def concurrent_builds = 1
def use_spot_instances = true
@ -35,7 +34,6 @@ runTests(
distro_name: distro_name,
distro_version: distro_version,
python_version: python_version,
salt_target_branch: salt_target_branch,
golden_images_branch: golden_images_branch,
nox_env_name: nox_env_name,
nox_passthrough_opts: nox_passthrough_opts,

View File

@ -1,4 +1,4 @@
@Library('salt@master-1.2') _
@Library('salt@master-1.3') _
// Define the maximum time, in hours, that a test run should run for
def testrun_timeout = 6
@ -7,8 +7,7 @@ def distro_name = 'fedora'
def distro_version = '30'
def python_version = 'py3'
def nox_env_name = 'runtests-zeromq'
def salt_target_branch = 'master'
def golden_images_branch = '2019.2'
def golden_images_branch = 'master'
def nox_passthrough_opts = '--ssh-tests'
def concurrent_builds = 1
def use_spot_instances = true
@ -35,7 +34,6 @@ runTests(
distro_name: distro_name,
distro_version: distro_version,
python_version: python_version,
salt_target_branch: salt_target_branch,
golden_images_branch: golden_images_branch,
nox_env_name: nox_env_name,
nox_passthrough_opts: nox_passthrough_opts,

View File

@ -0,0 +1,146 @@
@Library('salt@master-1.3') _
// Define the maximum time, in hours, that a test run should run for
def testrun_timeout = 6
// Now define a global pipeline timeout. This is the test run timeout with one(1) additional
// hour to allow for artifacts to be downloaded, if possible.
def global_timeout = testrun_timeout + 1;
def distro_name = 'macosx'
def distro_version = 'highsierra'
def python_version = 'py2'
def nox_env_name = 'runtests-zeromq'
def golden_images_branch = 'master'
def nox_passthrough_opts = ''
def concurrent_builds = 1
def jenkins_slave_label = 'kitchen-slave-mac'
properties([
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '30')),
parameters([
booleanParam(defaultValue: true, description: 'Run full test suite', name: 'runFull')
])
])
// Be sure to cancel any previously running builds
def buildNumber = env.BUILD_NUMBER as int
if (buildNumber > concurrent_builds) {
// This will cancel the previous build which also defined a matching milestone
milestone(buildNumber - concurrent_builds)
}
// Define a milestone for this build so that, if another build starts, this one will be aborted
milestone(buildNumber)
wrappedNode(jenkins_slave_label, global_timeout, '#jenkins-prod-pr') {
withEnv([
'SALT_KITCHEN_PLATFORMS=/var/jenkins/workspace/platforms.yml',
'SALT_KITCHEN_VERIFIER=/var/jenkins/workspace/verifier.yml',
'SALT_KITCHEN_DRIVER=/var/jenkins/workspace/driver.yml',
"NOX_ENV_NAME=${nox_env_name}",
'NOX_ENABLE_FROM_FILENAMES=true',
"NOX_PASSTHROUGH_OPTS=${nox_passthrough_opts}",
"GOLDEN_IMAGES_CI_BRANCH=${golden_images_branch}",
"PATH=/Users/parallels/.rbenv/shims:/Users/parallels/.rbenv/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/salt/bin:/usr/local/sbin",
'RBENV_VERSION=2.6.3',
"TEST_SUITE=${python_version}",
"TEST_PLATFORM=${distro_name}-${distro_version}",
"FORCE_FULL=${params.runFull}",
]) {
stage('VM Cleanup') {
sh '''
for i in `prlctl list -aij|jq -r '.[]|select((.Uptime|tonumber > 86400) and (.State == "running"))|.ID'`
do
prlctl stop $i --kill
done
# don't delete vm's that haven't started yet ((.State == "stopped") and (.Uptime == "0"))
for i in `prlctl list -aij|jq -r '.[]|select((.Uptime|tonumber > 0) and (.State != "running"))|.ID'`
do
prlctl delete $i
done
'''
}
// Checkout the repo
stage('Clone') {
cleanWs notFailBuild: true
checkout scm
}
// Setup the kitchen required bundle
stage('Setup') {
sh 'bundle install --with vagrant macos --without ec2 windows opennebula docker'
}
stage('Create VM') {
sh '''
bundle exec kitchen create $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";
'''
sh """
if [ -s ".kitchen/logs/${python_version}-${distro_name}-${distro_version}.log" ]; then
mv ".kitchen/logs/${python_version}-${distro_name}-${distro_version}.log" ".kitchen/logs/${python_version}-${distro_name}-${distro_version}-create.log"
fi
if [ -s ".kitchen/logs/kitchen.log" ]; then
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-create.log"
fi
"""
}
try {
timeout(time: testrun_timeout, unit: 'HOURS') {
stage('Converge VM') {
sh '''
ssh-agent /bin/bash -c 'ssh-add ~/.vagrant.d/insecure_private_key; bundle exec kitchen converge $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?"'
'''
sh """
if [ -s ".kitchen/logs/${python_version}-${distro_name}-${distro_version}.log" ]; then
mv ".kitchen/logs/${python_version}-${distro_name}-${distro_version}.log" ".kitchen/logs/${python_version}-${distro_name}-${distro_version}-converge.log"
fi
if [ -s ".kitchen/logs/kitchen.log" ]; then
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-converge.log"
fi
"""
}
stage('Run Tests') {
sh 'bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";'
}
}
} finally {
try {
sh """
if [ -s ".kitchen/logs/${python_version}-${distro_name}-${distro_version}.log" ]; then
mv ".kitchen/logs/${python_version}-${distro_name}-${distro_version}.log" ".kitchen/logs/${python_version}-${distro_name}-${distro_version}-verify.log"
fi
if [ -s ".kitchen/logs/kitchen.log" ]; then
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-verify.log"
fi
"""
archiveArtifacts(
artifacts: "artifacts/*,artifacts/**/*,.kitchen/logs/*-create.log,.kitchen/logs/*-converge.log,.kitchen/logs/*-verify.log,.kitchen/logs/*-download.log,artifacts/xml-unittests-output/*.xml",
allowEmptyArchive: true
)
junit 'artifacts/xml-unittests-output/*.xml'
} finally {
stage('Cleanup') {
sh '''
bundle exec kitchen destroy $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";
'''
}
stage('Upload Coverage') {
def distro_strings = [
distro_name,
distro_version
]
def report_strings = (
[python_version] + nox_env_name.split('-')
).flatten()
uploadCodeCoverage(
report_path: 'artifacts/coverage/coverage.xml',
report_name: "${distro_strings.join('-')}-${report_strings.join('-')}",
report_flags: ([distro_strings.join('')] + report_strings).flatten()
)
}
}
}
}
}
// vim: ft=groovy

View File

@ -0,0 +1,146 @@
@Library('salt@master-1.3') _
// Define the maximum time, in hours, that a test run should run for
def testrun_timeout = 6
// Now define a global pipeline timeout. This is the test run timeout with one(1) additional
// hour to allow for artifacts to be downloaded, if possible.
def global_timeout = testrun_timeout + 1;
def distro_name = 'macosx'
def distro_version = 'highsierra'
def python_version = 'py3'
def nox_env_name = 'runtests-zeromq'
def golden_images_branch = 'master'
def nox_passthrough_opts = ''
def concurrent_builds = 1
def jenkins_slave_label = 'kitchen-slave-mac'
properties([
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '30')),
parameters([
booleanParam(defaultValue: true, description: 'Run full test suite', name: 'runFull')
])
])
// Be sure to cancel any previously running builds
def buildNumber = env.BUILD_NUMBER as int
if (buildNumber > concurrent_builds) {
// This will cancel the previous build which also defined a matching milestone
milestone(buildNumber - concurrent_builds)
}
// Define a milestone for this build so that, if another build starts, this one will be aborted
milestone(buildNumber)
wrappedNode(jenkins_slave_label, global_timeout, '#jenkins-prod-pr') {
withEnv([
'SALT_KITCHEN_PLATFORMS=/var/jenkins/workspace/platforms.yml',
'SALT_KITCHEN_VERIFIER=/var/jenkins/workspace/verifier.yml',
'SALT_KITCHEN_DRIVER=/var/jenkins/workspace/driver.yml',
"NOX_ENV_NAME=${nox_env_name}",
'NOX_ENABLE_FROM_FILENAMES=true',
"NOX_PASSTHROUGH_OPTS=${nox_passthrough_opts}",
"GOLDEN_IMAGES_CI_BRANCH=${golden_images_branch}",
"PATH=/Users/parallels/.rbenv/shims:/Users/parallels/.rbenv/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/salt/bin:/usr/local/sbin",
'RBENV_VERSION=2.6.3',
"TEST_SUITE=${python_version}",
"TEST_PLATFORM=${distro_name}-${distro_version}",
"FORCE_FULL=${params.runFull}",
]) {
stage('VM Cleanup') {
sh '''
for i in `prlctl list -aij|jq -r '.[]|select((.Uptime|tonumber > 86400) and (.State == "running"))|.ID'`
do
prlctl stop $i --kill
done
# don't delete vm's that haven't started yet ((.State == "stopped") and (.Uptime == "0"))
for i in `prlctl list -aij|jq -r '.[]|select((.Uptime|tonumber > 0) and (.State != "running"))|.ID'`
do
prlctl delete $i
done
'''
}
// Checkout the repo
stage('Clone') {
cleanWs notFailBuild: true
checkout scm
}
// Setup the kitchen required bundle
stage('Setup') {
sh 'bundle install --with vagrant macos --without ec2 windows opennebula docker'
}
stage('Create VM') {
sh '''
bundle exec kitchen create $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";
'''
sh """
if [ -s ".kitchen/logs/${python_version}-${distro_name}-${distro_version}.log" ]; then
mv ".kitchen/logs/${python_version}-${distro_name}-${distro_version}.log" ".kitchen/logs/${python_version}-${distro_name}-${distro_version}-create.log"
fi
if [ -s ".kitchen/logs/kitchen.log" ]; then
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-create.log"
fi
"""
}
try {
timeout(time: testrun_timeout, unit: 'HOURS') {
stage('Converge VM') {
sh '''
ssh-agent /bin/bash -c 'ssh-add ~/.vagrant.d/insecure_private_key; bundle exec kitchen converge $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?"'
'''
sh """
if [ -s ".kitchen/logs/${python_version}-${distro_name}-${distro_version}.log" ]; then
mv ".kitchen/logs/${python_version}-${distro_name}-${distro_version}.log" ".kitchen/logs/${python_version}-${distro_name}-${distro_version}-converge.log"
fi
if [ -s ".kitchen/logs/kitchen.log" ]; then
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-converge.log"
fi
"""
}
stage('Run Tests') {
sh 'bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";'
}
}
} finally {
try {
sh """
if [ -s ".kitchen/logs/${python_version}-${distro_name}-${distro_version}.log" ]; then
mv ".kitchen/logs/${python_version}-${distro_name}-${distro_version}.log" ".kitchen/logs/${python_version}-${distro_name}-${distro_version}-verify.log"
fi
if [ -s ".kitchen/logs/kitchen.log" ]; then
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-verify.log"
fi
"""
archiveArtifacts(
artifacts: "artifacts/*,artifacts/**/*,.kitchen/logs/*-create.log,.kitchen/logs/*-converge.log,.kitchen/logs/*-verify.log,.kitchen/logs/*-download.log,artifacts/xml-unittests-output/*.xml",
allowEmptyArchive: true
)
junit 'artifacts/xml-unittests-output/*.xml'
} finally {
stage('Cleanup') {
sh '''
bundle exec kitchen destroy $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";
'''
}
stage('Upload Coverage') {
def distro_strings = [
distro_name,
distro_version
]
def report_strings = (
[python_version] + nox_env_name.split('-')
).flatten()
uploadCodeCoverage(
report_path: 'artifacts/coverage/coverage.xml',
report_name: "${distro_strings.join('-')}-${report_strings.join('-')}",
report_flags: ([distro_strings.join('')] + report_strings).flatten()
)
}
}
}
}
}
// vim: ft=groovy

View File

@ -1,4 +1,4 @@
@Library('salt@master-1.2') _
@Library('salt@master-1.3') _
// Define the maximum time, in hours, that a test run should run for
def testrun_timeout = 6
@ -10,8 +10,7 @@ def distro_name = 'macosx'
def distro_version = 'mojave'
def python_version = 'py2'
def nox_env_name = 'runtests-zeromq'
def salt_target_branch = 'master'
def golden_images_branch = '2019.2'
def golden_images_branch = 'master'
def nox_passthrough_opts = ''
def concurrent_builds = 1
def jenkins_slave_label = 'kitchen-slave-mac'
@ -40,7 +39,6 @@ wrappedNode(jenkins_slave_label, global_timeout, '#jenkins-prod-pr') {
"NOX_ENV_NAME=${nox_env_name}",
'NOX_ENABLE_FROM_FILENAMES=true',
"NOX_PASSTHROUGH_OPTS=${nox_passthrough_opts}",
"SALT_TARGET_BRANCH=${salt_target_branch}",
"GOLDEN_IMAGES_CI_BRANCH=${golden_images_branch}",
"PATH=/Users/parallels/.rbenv/shims:/Users/parallels/.rbenv/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/salt/bin:/usr/local/sbin",
'RBENV_VERSION=2.6.3',
@ -65,7 +63,6 @@ wrappedNode(jenkins_slave_label, global_timeout, '#jenkins-prod-pr') {
stage('Clone') {
cleanWs notFailBuild: true
checkout scm
sh 'git fetch --no-tags https://github.com/saltstack/salt.git +refs/heads/${SALT_TARGET_BRANCH}:refs/remotes/origin/${SALT_TARGET_BRANCH}'
}
// Setup the kitchen required bundle

View File

@ -1,4 +1,4 @@
@Library('salt@master-1.2') _
@Library('salt@master-1.3') _
// Define the maximum time, in hours, that a test run should run for
def testrun_timeout = 6
@ -10,8 +10,7 @@ def distro_name = 'macosx'
def distro_version = 'mojave'
def python_version = 'py3'
def nox_env_name = 'runtests-zeromq'
def salt_target_branch = 'master'
def golden_images_branch = '2019.2'
def golden_images_branch = 'master'
def nox_passthrough_opts = ''
def concurrent_builds = 1
def jenkins_slave_label = 'kitchen-slave-mac'
@ -40,7 +39,6 @@ wrappedNode(jenkins_slave_label, global_timeout, '#jenkins-prod-pr') {
"NOX_ENV_NAME=${nox_env_name}",
'NOX_ENABLE_FROM_FILENAMES=true',
"NOX_PASSTHROUGH_OPTS=${nox_passthrough_opts}",
"SALT_TARGET_BRANCH=${salt_target_branch}",
"GOLDEN_IMAGES_CI_BRANCH=${golden_images_branch}",
"PATH=/Users/parallels/.rbenv/shims:/Users/parallels/.rbenv/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/salt/bin:/usr/local/sbin",
'RBENV_VERSION=2.6.3',
@ -65,7 +63,6 @@ wrappedNode(jenkins_slave_label, global_timeout, '#jenkins-prod-pr') {
stage('Clone') {
cleanWs notFailBuild: true
checkout scm
sh 'git fetch --no-tags https://github.com/saltstack/salt.git +refs/heads/${SALT_TARGET_BRANCH}:refs/remotes/origin/${SALT_TARGET_BRANCH}'
}
// Setup the kitchen required bundle

View File

@ -0,0 +1,146 @@
@Library('salt@master-1.3') _
// Define the maximum time, in hours, that a test run should run for
def testrun_timeout = 6
// Now define a global pipeline timeout. This is the test run timeout with one(1) additional
// hour to allow for artifacts to be downloaded, if possible.
def global_timeout = testrun_timeout + 1;
def distro_name = 'macosx'
def distro_version = 'sierra'
def python_version = 'py2'
def nox_env_name = 'runtests-zeromq'
def golden_images_branch = 'master'
def nox_passthrough_opts = ''
def concurrent_builds = 1
def jenkins_slave_label = 'kitchen-slave-mac'
properties([
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '30')),
parameters([
booleanParam(defaultValue: true, description: 'Run full test suite', name: 'runFull')
])
])
// Be sure to cancel any previously running builds
def buildNumber = env.BUILD_NUMBER as int
if (buildNumber > concurrent_builds) {
// This will cancel the previous build which also defined a matching milestone
milestone(buildNumber - concurrent_builds)
}
// Define a milestone for this build so that, if another build starts, this one will be aborted
milestone(buildNumber)
wrappedNode(jenkins_slave_label, global_timeout, '#jenkins-prod-pr') {
withEnv([
'SALT_KITCHEN_PLATFORMS=/var/jenkins/workspace/platforms.yml',
'SALT_KITCHEN_VERIFIER=/var/jenkins/workspace/verifier.yml',
'SALT_KITCHEN_DRIVER=/var/jenkins/workspace/driver.yml',
"NOX_ENV_NAME=${nox_env_name}",
'NOX_ENABLE_FROM_FILENAMES=true',
"NOX_PASSTHROUGH_OPTS=${nox_passthrough_opts}",
"GOLDEN_IMAGES_CI_BRANCH=${golden_images_branch}",
"PATH=/Users/parallels/.rbenv/shims:/Users/parallels/.rbenv/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/salt/bin:/usr/local/sbin",
'RBENV_VERSION=2.6.3',
"TEST_SUITE=${python_version}",
"TEST_PLATFORM=${distro_name}-${distro_version}",
"FORCE_FULL=${params.runFull}",
]) {
stage('VM Cleanup') {
sh '''
for i in `prlctl list -aij|jq -r '.[]|select((.Uptime|tonumber > 86400) and (.State == "running"))|.ID'`
do
prlctl stop $i --kill
done
# don't delete vm's that haven't started yet ((.State == "stopped") and (.Uptime == "0"))
for i in `prlctl list -aij|jq -r '.[]|select((.Uptime|tonumber > 0) and (.State != "running"))|.ID'`
do
prlctl delete $i
done
'''
}
// Checkout the repo
stage('Clone') {
cleanWs notFailBuild: true
checkout scm
}
// Setup the kitchen required bundle
stage('Setup') {
sh 'bundle install --with vagrant macos --without ec2 windows opennebula docker'
}
stage('Create VM') {
sh '''
bundle exec kitchen create $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";
'''
sh """
if [ -s ".kitchen/logs/${python_version}-${distro_name}-${distro_version}.log" ]; then
mv ".kitchen/logs/${python_version}-${distro_name}-${distro_version}.log" ".kitchen/logs/${python_version}-${distro_name}-${distro_version}-create.log"
fi
if [ -s ".kitchen/logs/kitchen.log" ]; then
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-create.log"
fi
"""
}
try {
timeout(time: testrun_timeout, unit: 'HOURS') {
stage('Converge VM') {
sh '''
ssh-agent /bin/bash -c 'ssh-add ~/.vagrant.d/insecure_private_key; bundle exec kitchen converge $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?"'
'''
sh """
if [ -s ".kitchen/logs/${python_version}-${distro_name}-${distro_version}.log" ]; then
mv ".kitchen/logs/${python_version}-${distro_name}-${distro_version}.log" ".kitchen/logs/${python_version}-${distro_name}-${distro_version}-converge.log"
fi
if [ -s ".kitchen/logs/kitchen.log" ]; then
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-converge.log"
fi
"""
}
stage('Run Tests') {
sh 'bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";'
}
}
} finally {
try {
sh """
if [ -s ".kitchen/logs/${python_version}-${distro_name}-${distro_version}.log" ]; then
mv ".kitchen/logs/${python_version}-${distro_name}-${distro_version}.log" ".kitchen/logs/${python_version}-${distro_name}-${distro_version}-verify.log"
fi
if [ -s ".kitchen/logs/kitchen.log" ]; then
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-verify.log"
fi
"""
archiveArtifacts(
artifacts: "artifacts/*,artifacts/**/*,.kitchen/logs/*-create.log,.kitchen/logs/*-converge.log,.kitchen/logs/*-verify.log,.kitchen/logs/*-download.log,artifacts/xml-unittests-output/*.xml",
allowEmptyArchive: true
)
junit 'artifacts/xml-unittests-output/*.xml'
} finally {
stage('Cleanup') {
sh '''
bundle exec kitchen destroy $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";
'''
}
stage('Upload Coverage') {
def distro_strings = [
distro_name,
distro_version
]
def report_strings = (
[python_version] + nox_env_name.split('-')
).flatten()
uploadCodeCoverage(
report_path: 'artifacts/coverage/coverage.xml',
report_name: "${distro_strings.join('-')}-${report_strings.join('-')}",
report_flags: ([distro_strings.join('')] + report_strings).flatten()
)
}
}
}
}
}
// vim: ft=groovy

View File

@ -0,0 +1,146 @@
@Library('salt@master-1.3') _
// Define the maximum time, in hours, that a test run should run for
def testrun_timeout = 6
// Now define a global pipeline timeout. This is the test run timeout with one(1) additional
// hour to allow for artifacts to be downloaded, if possible.
def global_timeout = testrun_timeout + 1;
def distro_name = 'macosx'
def distro_version = 'sierra'
def python_version = 'py3'
def nox_env_name = 'runtests-zeromq'
def golden_images_branch = 'master'
def nox_passthrough_opts = ''
def concurrent_builds = 1
def jenkins_slave_label = 'kitchen-slave-mac'
properties([
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '30')),
parameters([
booleanParam(defaultValue: true, description: 'Run full test suite', name: 'runFull')
])
])
// Be sure to cancel any previously running builds
def buildNumber = env.BUILD_NUMBER as int
if (buildNumber > concurrent_builds) {
// This will cancel the previous build which also defined a matching milestone
milestone(buildNumber - concurrent_builds)
}
// Define a milestone for this build so that, if another build starts, this one will be aborted
milestone(buildNumber)
wrappedNode(jenkins_slave_label, global_timeout, '#jenkins-prod-pr') {
withEnv([
'SALT_KITCHEN_PLATFORMS=/var/jenkins/workspace/platforms.yml',
'SALT_KITCHEN_VERIFIER=/var/jenkins/workspace/verifier.yml',
'SALT_KITCHEN_DRIVER=/var/jenkins/workspace/driver.yml',
"NOX_ENV_NAME=${nox_env_name}",
'NOX_ENABLE_FROM_FILENAMES=true',
"NOX_PASSTHROUGH_OPTS=${nox_passthrough_opts}",
"GOLDEN_IMAGES_CI_BRANCH=${golden_images_branch}",
"PATH=/Users/parallels/.rbenv/shims:/Users/parallels/.rbenv/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/salt/bin:/usr/local/sbin",
'RBENV_VERSION=2.6.3',
"TEST_SUITE=${python_version}",
"TEST_PLATFORM=${distro_name}-${distro_version}",
"FORCE_FULL=${params.runFull}",
]) {
stage('VM Cleanup') {
sh '''
for i in `prlctl list -aij|jq -r '.[]|select((.Uptime|tonumber > 86400) and (.State == "running"))|.ID'`
do
prlctl stop $i --kill
done
# don't delete vm's that haven't started yet ((.State == "stopped") and (.Uptime == "0"))
for i in `prlctl list -aij|jq -r '.[]|select((.Uptime|tonumber > 0) and (.State != "running"))|.ID'`
do
prlctl delete $i
done
'''
}
// Checkout the repo
stage('Clone') {
cleanWs notFailBuild: true
checkout scm
}
// Setup the kitchen required bundle
stage('Setup') {
sh 'bundle install --with vagrant macos --without ec2 windows opennebula docker'
}
stage('Create VM') {
sh '''
bundle exec kitchen create $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";
'''
sh """
if [ -s ".kitchen/logs/${python_version}-${distro_name}-${distro_version}.log" ]; then
mv ".kitchen/logs/${python_version}-${distro_name}-${distro_version}.log" ".kitchen/logs/${python_version}-${distro_name}-${distro_version}-create.log"
fi
if [ -s ".kitchen/logs/kitchen.log" ]; then
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-create.log"
fi
"""
}
try {
timeout(time: testrun_timeout, unit: 'HOURS') {
stage('Converge VM') {
sh '''
ssh-agent /bin/bash -c 'ssh-add ~/.vagrant.d/insecure_private_key; bundle exec kitchen converge $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?"'
'''
sh """
if [ -s ".kitchen/logs/${python_version}-${distro_name}-${distro_version}.log" ]; then
mv ".kitchen/logs/${python_version}-${distro_name}-${distro_version}.log" ".kitchen/logs/${python_version}-${distro_name}-${distro_version}-converge.log"
fi
if [ -s ".kitchen/logs/kitchen.log" ]; then
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-converge.log"
fi
"""
}
stage('Run Tests') {
sh 'bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";'
}
}
} finally {
try {
sh """
if [ -s ".kitchen/logs/${python_version}-${distro_name}-${distro_version}.log" ]; then
mv ".kitchen/logs/${python_version}-${distro_name}-${distro_version}.log" ".kitchen/logs/${python_version}-${distro_name}-${distro_version}-verify.log"
fi
if [ -s ".kitchen/logs/kitchen.log" ]; then
mv ".kitchen/logs/kitchen.log" ".kitchen/logs/kitchen-verify.log"
fi
"""
archiveArtifacts(
artifacts: "artifacts/*,artifacts/**/*,.kitchen/logs/*-create.log,.kitchen/logs/*-converge.log,.kitchen/logs/*-verify.log,.kitchen/logs/*-download.log,artifacts/xml-unittests-output/*.xml",
allowEmptyArchive: true
)
junit 'artifacts/xml-unittests-output/*.xml'
} finally {
stage('Cleanup') {
sh '''
bundle exec kitchen destroy $TEST_SUITE-$TEST_PLATFORM; echo "ExitCode: $?";
'''
}
stage('Upload Coverage') {
def distro_strings = [
distro_name,
distro_version
]
def report_strings = (
[python_version] + nox_env_name.split('-')
).flatten()
uploadCodeCoverage(
report_path: 'artifacts/coverage/coverage.xml',
report_name: "${distro_strings.join('-')}-${report_strings.join('-')}",
report_flags: ([distro_strings.join('')] + report_strings).flatten()
)
}
}
}
}
}
// vim: ft=groovy

View File

@ -1,4 +1,4 @@
@Library('salt@master-1.2') _
@Library('salt@master-1.3') _
// Define the maximum time, in hours, that a test run should run for
def testrun_timeout = 6
@ -7,8 +7,7 @@ def distro_name = 'opensuse'
def distro_version = '15'
def python_version = 'py2'
def nox_env_name = 'runtests-zeromq'
def salt_target_branch = 'master'
def golden_images_branch = '2019.2'
def golden_images_branch = 'master'
def nox_passthrough_opts = '--ssh-tests'
def concurrent_builds = 1
def use_spot_instances = true
@ -35,7 +34,6 @@ runTests(
distro_name: distro_name,
distro_version: distro_version,
python_version: python_version,
salt_target_branch: salt_target_branch,
golden_images_branch: golden_images_branch,
nox_env_name: nox_env_name,
nox_passthrough_opts: nox_passthrough_opts,

View File

@ -1,4 +1,4 @@
@Library('salt@master-1.2') _
@Library('salt@master-1.3') _
// Define the maximum time, in hours, that a test run should run for
def testrun_timeout = 6
@ -7,8 +7,7 @@ def distro_name = 'opensuse'
def distro_version = '15'
def python_version = 'py3'
def nox_env_name = 'runtests-zeromq'
def salt_target_branch = 'master'
def golden_images_branch = '2019.2'
def golden_images_branch = 'master'
def nox_passthrough_opts = '--ssh-tests'
def concurrent_builds = 1
def use_spot_instances = true
@ -35,7 +34,6 @@ runTests(
distro_name: distro_name,
distro_version: distro_version,
python_version: python_version,
salt_target_branch: salt_target_branch,
golden_images_branch: golden_images_branch,
nox_env_name: nox_env_name,
nox_passthrough_opts: nox_passthrough_opts,

View File

@ -1,4 +1,4 @@
@Library('salt@master-1.2') _
@Library('salt@master-1.3') _
// Define the maximum time, in hours, that a test run should run for
def testrun_timeout = 6
@ -7,8 +7,7 @@ def distro_name = 'ubuntu'
def distro_version = '1604'
def python_version = 'py2'
def nox_env_name = 'runtests-zeromq'
def salt_target_branch = 'master'
def golden_images_branch = '2019.2'
def golden_images_branch = 'master'
def nox_passthrough_opts = '--ssh-tests'
def concurrent_builds = 1
def use_spot_instances = true
@ -35,7 +34,6 @@ runTests(
distro_name: distro_name,
distro_version: distro_version,
python_version: python_version,
salt_target_branch: salt_target_branch,
golden_images_branch: golden_images_branch,
nox_env_name: nox_env_name,
nox_passthrough_opts: nox_passthrough_opts,

View File

@ -1,4 +1,4 @@
@Library('salt@master-1.2') _
@Library('salt@master-1.3') _
// Define the maximum time, in hours, that a test run should run for
def testrun_timeout = 6
@ -7,8 +7,7 @@ def distro_name = 'ubuntu'
def distro_version = '1604'
def python_version = 'py2'
def nox_env_name = 'runtests-zeromq-m2crypto'
def salt_target_branch = 'master'
def golden_images_branch = '2019.2'
def golden_images_branch = 'master'
def nox_passthrough_opts = '--ssh-tests'
def concurrent_builds = 1
def use_spot_instances = true
@ -35,7 +34,6 @@ runTests(
distro_name: distro_name,
distro_version: distro_version,
python_version: python_version,
salt_target_branch: salt_target_branch,
golden_images_branch: golden_images_branch,
nox_env_name: nox_env_name,
nox_passthrough_opts: nox_passthrough_opts,

View File

@ -1,4 +1,4 @@
@Library('salt@master-1.2') _
@Library('salt@master-1.3') _
// Define the maximum time, in hours, that a test run should run for
def testrun_timeout = 6
@ -7,8 +7,7 @@ def distro_name = 'ubuntu'
def distro_version = '1604'
def python_version = 'py2'
def nox_env_name = 'runtests-zeromq'
def salt_target_branch = 'master'
def golden_images_branch = '2019.2'
def golden_images_branch = 'master'
def nox_passthrough_opts = '--proxy'
def concurrent_builds = 1
def use_spot_instances = true
@ -35,7 +34,6 @@ runTests(
distro_name: distro_name,
distro_version: distro_version,
python_version: python_version,
salt_target_branch: salt_target_branch,
golden_images_branch: golden_images_branch,
nox_env_name: nox_env_name,
nox_passthrough_opts: nox_passthrough_opts,

View File

@ -1,4 +1,4 @@
@Library('salt@master-1.2') _
@Library('salt@master-1.3') _
// Define the maximum time, in hours, that a test run should run for
def testrun_timeout = 6
@ -7,8 +7,7 @@ def distro_name = 'ubuntu'
def distro_version = '1604'
def python_version = 'py2'
def nox_env_name = 'runtests-zeromq-pycryptodomex'
def salt_target_branch = 'master'
def golden_images_branch = '2019.2'
def golden_images_branch = 'master'
def nox_passthrough_opts = '--ssh-tests'
def concurrent_builds = 1
def use_spot_instances = true
@ -35,7 +34,6 @@ runTests(
distro_name: distro_name,
distro_version: distro_version,
python_version: python_version,
salt_target_branch: salt_target_branch,
golden_images_branch: golden_images_branch,
nox_env_name: nox_env_name,
nox_passthrough_opts: nox_passthrough_opts,

View File

@ -1,4 +1,4 @@
@Library('salt@master-1.2') _
@Library('salt@master-1.3') _
// Define the maximum time, in hours, that a test run should run for
def testrun_timeout = 6
@ -7,8 +7,7 @@ def distro_name = 'ubuntu'
def distro_version = '1604'
def python_version = 'py2'
def nox_env_name = 'runtests-tcp'
def salt_target_branch = 'master'
def golden_images_branch = '2019.2'
def golden_images_branch = 'master'
def nox_passthrough_opts = '--ssh-tests'
def concurrent_builds = 1
def use_spot_instances = true
@ -35,7 +34,6 @@ runTests(
distro_name: distro_name,
distro_version: distro_version,
python_version: python_version,
salt_target_branch: salt_target_branch,
golden_images_branch: golden_images_branch,
nox_env_name: nox_env_name,
nox_passthrough_opts: nox_passthrough_opts,

View File

@ -1,4 +1,4 @@
@Library('salt@master-1.2') _
@Library('salt@master-1.3') _
// Define the maximum time, in hours, that a test run should run for
def testrun_timeout = 6
@ -7,8 +7,7 @@ def distro_name = 'ubuntu'
def distro_version = '1604'
def python_version = 'py2'
def nox_env_name = 'runtests-tornado'
def salt_target_branch = 'master'
def golden_images_branch = '2019.2'
def golden_images_branch = 'master'
def nox_passthrough_opts = '--ssh-tests'
def concurrent_builds = 1
def use_spot_instances = true
@ -35,7 +34,6 @@ runTests(
distro_name: distro_name,
distro_version: distro_version,
python_version: python_version,
salt_target_branch: salt_target_branch,
golden_images_branch: golden_images_branch,
nox_env_name: nox_env_name,
nox_passthrough_opts: nox_passthrough_opts,

View File

@ -1,4 +1,4 @@
@Library('salt@master-1.2') _
@Library('salt@master-1.3') _
// Define the maximum time, in hours, that a test run should run for
def testrun_timeout = 6
@ -7,8 +7,7 @@ def distro_name = 'ubuntu'
def distro_version = '1604'
def python_version = 'py3'
def nox_env_name = 'runtests-zeromq'
def salt_target_branch = 'master'
def golden_images_branch = '2019.2'
def golden_images_branch = 'master'
def nox_passthrough_opts = '--ssh-tests'
def concurrent_builds = 1
def use_spot_instances = true
@ -35,7 +34,6 @@ runTests(
distro_name: distro_name,
distro_version: distro_version,
python_version: python_version,
salt_target_branch: salt_target_branch,
golden_images_branch: golden_images_branch,
nox_env_name: nox_env_name,
nox_passthrough_opts: nox_passthrough_opts,

View File

@ -1,4 +1,4 @@
@Library('salt@master-1.2') _
@Library('salt@master-1.3') _
// Define the maximum time, in hours, that a test run should run for
def testrun_timeout = 6
@ -7,8 +7,7 @@ def distro_name = 'ubuntu'
def distro_version = '1604'
def python_version = 'py3'
def nox_env_name = 'runtests-zeromq-m2crypto'
def salt_target_branch = 'master'
def golden_images_branch = '2019.2'
def golden_images_branch = 'master'
def nox_passthrough_opts = '--ssh-tests'
def concurrent_builds = 1
def use_spot_instances = true
@ -35,7 +34,6 @@ runTests(
distro_name: distro_name,
distro_version: distro_version,
python_version: python_version,
salt_target_branch: salt_target_branch,
golden_images_branch: golden_images_branch,
nox_env_name: nox_env_name,
nox_passthrough_opts: nox_passthrough_opts,

View File

@ -1,4 +1,4 @@
@Library('salt@master-1.2') _
@Library('salt@master-1.3') _
// Define the maximum time, in hours, that a test run should run for
def testrun_timeout = 6
@ -7,8 +7,7 @@ def distro_name = 'ubuntu'
def distro_version = '1604'
def python_version = 'py3'
def nox_env_name = 'runtests-zeromq'
def salt_target_branch = 'master'
def golden_images_branch = '2019.2'
def golden_images_branch = 'master'
def nox_passthrough_opts = '--proxy'
def concurrent_builds = 1
def use_spot_instances = true
@ -35,7 +34,6 @@ runTests(
distro_name: distro_name,
distro_version: distro_version,
python_version: python_version,
salt_target_branch: salt_target_branch,
golden_images_branch: golden_images_branch,
nox_env_name: nox_env_name,
nox_passthrough_opts: nox_passthrough_opts,

View File

@ -1,4 +1,4 @@
@Library('salt@master-1.2') _
@Library('salt@master-1.3') _
// Define the maximum time, in hours, that a test run should run for
def testrun_timeout = 6
@ -7,8 +7,7 @@ def distro_name = 'ubuntu'
def distro_version = '1604'
def python_version = 'py3'
def nox_env_name = 'runtests-zeromq-pycryptodomex'
def salt_target_branch = 'master'
def golden_images_branch = '2019.2'
def golden_images_branch = 'master'
def nox_passthrough_opts = '--ssh-tests'
def concurrent_builds = 1
def use_spot_instances = true
@ -35,7 +34,6 @@ runTests(
distro_name: distro_name,
distro_version: distro_version,
python_version: python_version,
salt_target_branch: salt_target_branch,
golden_images_branch: golden_images_branch,
nox_env_name: nox_env_name,
nox_passthrough_opts: nox_passthrough_opts,

View File

@ -1,4 +1,4 @@
@Library('salt@master-1.2') _
@Library('salt@master-1.3') _
// Define the maximum time, in hours, that a test run should run for
def testrun_timeout = 6
@ -7,8 +7,7 @@ def distro_name = 'ubuntu'
def distro_version = '1604'
def python_version = 'py3'
def nox_env_name = 'runtests-tcp'
def salt_target_branch = 'master'
def golden_images_branch = '2019.2'
def golden_images_branch = 'master'
def nox_passthrough_opts = '--ssh-tests'
def concurrent_builds = 1
def use_spot_instances = true
@ -35,7 +34,6 @@ runTests(
distro_name: distro_name,
distro_version: distro_version,
python_version: python_version,
salt_target_branch: salt_target_branch,
golden_images_branch: golden_images_branch,
nox_env_name: nox_env_name,
nox_passthrough_opts: nox_passthrough_opts,

View File

@ -1,4 +1,4 @@
@Library('salt@master-1.2') _
@Library('salt@master-1.3') _
// Define the maximum time, in hours, that a test run should run for
def testrun_timeout = 6
@ -7,8 +7,7 @@ def distro_name = 'ubuntu'
def distro_version = '1804'
def python_version = 'py2'
def nox_env_name = 'runtests-zeromq'
def salt_target_branch = 'master'
def golden_images_branch = '2019.2'
def golden_images_branch = 'master'
def nox_passthrough_opts = '--ssh-tests'
def concurrent_builds = 1
def use_spot_instances = true
@ -35,7 +34,6 @@ runTests(
distro_name: distro_name,
distro_version: distro_version,
python_version: python_version,
salt_target_branch: salt_target_branch,
golden_images_branch: golden_images_branch,
nox_env_name: nox_env_name,
nox_passthrough_opts: nox_passthrough_opts,

View File

@ -1,4 +1,4 @@
@Library('salt@master-1.2') _
@Library('salt@master-1.3') _
// Define the maximum time, in hours, that a test run should run for
def testrun_timeout = 6
@ -7,8 +7,7 @@ def distro_name = 'ubuntu'
def distro_version = '1804'
def python_version = 'py3'
def nox_env_name = 'runtests-zeromq'
def salt_target_branch = 'master'
def golden_images_branch = '2019.2'
def golden_images_branch = 'master'
def nox_passthrough_opts = '--ssh-tests'
def concurrent_builds = 1
def use_spot_instances = true
@ -35,7 +34,6 @@ runTests(
distro_name: distro_name,
distro_version: distro_version,
python_version: python_version,
salt_target_branch: salt_target_branch,
golden_images_branch: golden_images_branch,
nox_env_name: nox_env_name,
nox_passthrough_opts: nox_passthrough_opts,

View File

@ -1,4 +1,4 @@
@Library('salt@master-1.2') _
@Library('salt@master-1.3') _
// Define the maximum time, in hours, that a test run should run for
def testrun_timeout = 8
@ -7,8 +7,7 @@ def distro_name = 'windows'
def distro_version = '2016'
def python_version = 'py2'
def nox_env_name = 'runtests-zeromq'
def salt_target_branch = 'master'
def golden_images_branch = '2019.2'
def golden_images_branch = 'master'
def nox_passthrough_opts = '--unit'
def concurrent_builds = 1
def use_spot_instances = false
@ -35,7 +34,6 @@ runTests(
distro_name: distro_name,
distro_version: distro_version,
python_version: python_version,
salt_target_branch: salt_target_branch,
golden_images_branch: golden_images_branch,
nox_env_name: nox_env_name,
nox_passthrough_opts: nox_passthrough_opts,

View File

@ -1,4 +1,4 @@
@Library('salt@master-1.2') _
@Library('salt@master-1.3') _
// Define the maximum time, in hours, that a test run should run for
def testrun_timeout = 8
@ -7,8 +7,7 @@ def distro_name = 'windows'
def distro_version = '2016'
def python_version = 'py3'
def nox_env_name = 'runtests-zeromq'
def salt_target_branch = 'master'
def golden_images_branch = '2019.2'
def golden_images_branch = 'master'
def nox_passthrough_opts = '--unit'
def concurrent_builds = 1
def use_spot_instances = false
@ -35,7 +34,6 @@ runTests(
distro_name: distro_name,
distro_version: distro_version,
python_version: python_version,
salt_target_branch: salt_target_branch,
golden_images_branch: golden_images_branch,
nox_env_name: nox_env_name,
nox_passthrough_opts: nox_passthrough_opts,

View File

@ -1,4 +1,4 @@
@Library('salt@master-1.2') _
@Library('salt@master-1.3') _
// Define the maximum time, in hours, that a test run should run for
def testrun_timeout = 8
@ -7,8 +7,7 @@ def distro_name = 'windows'
def distro_version = '2019'
def python_version = 'py2'
def nox_env_name = 'runtests-zeromq'
def salt_target_branch = 'master'
def golden_images_branch = '2019.2'
def golden_images_branch = 'master'
def nox_passthrough_opts = '--unit'
def concurrent_builds = 1
def use_spot_instances = false
@ -35,7 +34,6 @@ runTests(
distro_name: distro_name,
distro_version: distro_version,
python_version: python_version,
salt_target_branch: salt_target_branch,
golden_images_branch: golden_images_branch,
nox_env_name: nox_env_name,
nox_passthrough_opts: nox_passthrough_opts,

View File

@ -1,4 +1,4 @@
@Library('salt@master-1.2') _
@Library('salt@master-1.3') _
// Define the maximum time, in hours, that a test run should run for
def testrun_timeout = 8
@ -7,8 +7,7 @@ def distro_name = 'windows'
def distro_version = '2019'
def python_version = 'py3'
def nox_env_name = 'runtests-zeromq'
def salt_target_branch = 'master'
def golden_images_branch = '2019.2'
def golden_images_branch = 'master'
def nox_passthrough_opts = '--unit'
def concurrent_builds = 1
def use_spot_instances = false
@ -35,7 +34,6 @@ runTests(
distro_name: distro_name,
distro_version: distro_version,
python_version: python_version,
salt_target_branch: salt_target_branch,
golden_images_branch: golden_images_branch,
nox_env_name: nox_env_name,
nox_passthrough_opts: nox_passthrough_opts,

View File

@ -30,7 +30,6 @@ wrappedNode('lint', global_timeout, '#jenkins-prod-pr') {
stage('checkout-scm') {
cleanWs notFailBuild: true
checkout scm
sh 'git fetch --no-tags https://github.com/saltstack/salt.git +refs/heads/${SALT_TARGET_BRANCH}:refs/remotes/origin/${SALT_TARGET_BRANCH}'
}
// Setup the kitchen required bundle

View File

@ -23,6 +23,8 @@ Versions are `MAJOR.PATCH`.
### Added
- [#54917](https://github.com/saltstack/salt/pull/54917) - Added get_settings, put_settings and flush_synced methods for Elasticsearch module. - [@Oloremo](https://github.com/Oloremo)
---
## [2019.2.2]
@ -51,4 +53,4 @@ Versions are `MAJOR.PATCH`.
## [2019.2.1] - 2019-09-25 [YANKED]
- See [old release notes](https://docs.saltstack.com/en/latest/topics/releases/2019.2.1.html)
- See [old release notes](https://docs.saltstack.com/en/latest/topics/releases/2019.2.1.html)

View File

@ -3,3 +3,30 @@
==================================
Salt Release Notes - Codename Neon
==================================
Slot Syntax Updates
===================
The slot syntax has been updated to support parsing dictionary responses and to append text.
.. code-block:: yaml
demo dict parsing and append:
test.configurable_test_state:
- name: slot example
- changes: False
- comment: __slot__:salt:test.arg(shell="/bin/bash").kwargs.shell ~ /appended
.. code-block:: none
local:
----------
ID: demo dict parsing and append
Function: test.configurable_test_state
Name: slot example
Result: True
Comment: /bin/bash/appended
Started: 09:59:58.623575
Duration: 1.229 ms
Changes:

View File

@ -5,6 +5,7 @@ Slots
=====
.. versionadded:: 2018.3.0
.. versionchanged:: Neon
.. note:: This functionality is under development and could be changed in the
future releases
@ -33,7 +34,14 @@ Slot syntax looks close to the simple python function call.
__slot__:salt:<module>.<function>(<args>, ..., <kwargs...>, ...)
Also there are some specifics in the syntax coming from the execution functions
For the Neon release, this syntax has been updated to support parsing functions
which return dictionaries and for appending text to the slot result.
.. code-block:: text
__slot__:salt:<module>.<function>(<args>..., <kwargs...>, ...).dictionary ~ append
There are some specifics in the syntax coming from the execution functions
nature and a desire to simplify the user experience. First one is that you
don't need to quote the strings passed to the slots functions. The second one
is that all arguments handled as strings.
@ -51,3 +59,12 @@ This will execute the :py:func:`test.echo <salt.modules.test.echo>` execution
functions right before calling the state. The functions in the example will
return `/tmp/some_file` and `/etc/hosts` strings that will be used as a target
and source arguments in the state function `file.copy`.
Here is an example of result parsing and appending:
.. code-block:: yaml
file-in-user-home:
file.copy:
- name: __slot__:salt:user.info(someuser).home ~ /subdirectory
- source: salt://somefile

View File

@ -292,7 +292,7 @@ def _install_requirements(session, transport, *extra_requirements):
requirements_files = [
os.path.join('pkg', 'osx', 'req.txt'),
os.path.join('pkg', 'osx', 'req_ext.txt'),
os.path.join('requirements', 'static', 'osx.in')
os.path.join('requirements', 'static', 'darwin.in')
]
while True:

View File

@ -264,6 +264,59 @@ def cluster_stats(nodes=None, hosts=None, profile=None):
raise CommandExecutionError("Cannot retrieve cluster stats, server returned code {0} with message {1}".format(e.status_code, e.error))
def cluster_get_settings(flat_settings=False, include_defaults=False, hosts=None, profile=None):
'''
.. versionadded:: Neon
Return Elasticsearch cluster settings.
flat_settings
Return settings in flat format.
include_defaults
Whether to return all default clusters setting.
CLI example::
salt myminion elasticsearch.cluster_get_settings
'''
es = _get_instance(hosts, profile)
try:
return es.cluster.get_settings(flat_settings=flat_settings, include_defaults=include_defaults)
except elasticsearch.TransportError as e:
raise CommandExecutionError("Cannot retrieve cluster settings, server returned code {0} with message {1}".format(e.status_code, e.error))
def cluster_put_settings(body=None, flat_settings=False, hosts=None, profile=None):
'''
.. versionadded:: Neon
Set Elasticsearch cluster settings.
body
The settings to be updated. Can be either 'transient' or 'persistent' (survives cluster restart)
http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-update-settings.html
flat_settings
Return settings in flat format.
CLI example::
salt myminion elasticsearch.cluster_put_settings '{"persistent": {"indices.recovery.max_bytes_per_sec": "50mb"}}'
salt myminion elasticsearch.cluster_put_settings '{"transient": {"indices.recovery.max_bytes_per_sec": "50mb"}}'
'''
if not body:
message = 'You must provide a body with settings'
raise SaltInvocationError(message)
es = _get_instance(hosts, profile)
try:
return es.cluster.put_settings(body=body, flat_settings=flat_settings)
except elasticsearch.TransportError as e:
raise CommandExecutionError("Cannot update cluster settings, server returned code {0} with message {1}".format(e.status_code, e.error))
def alias_create(indices, alias, hosts=None, body=None, profile=None, source=None):
'''
Create an alias for a specific index/indices
@ -1214,3 +1267,44 @@ def snapshot_delete(repository, snapshot, hosts=None, profile=None):
return True
except elasticsearch.TransportError as e:
raise CommandExecutionError("Cannot delete snapshot {0} from repository {1}, server returned code {2} with message {3}".format(snapshot, repository, e.status_code, e.error))
def flush_synced(hosts=None, profile=None, **kwargs):
'''
.. versionadded:: Neon
Perform a normal flush, then add a generated unique marker (sync_id) to all shards.
http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-synced-flush.html
index
(Optional, string) A comma-separated list of index names; use _all or empty string for all indices. Defaults to '_all'.
ignore_unavailable
(Optional, boolean) If true, missing or closed indices are not included in the response. Defaults to false.
allow_no_indices
(Optional, boolean) If true, the request does not return an error if a wildcard expression or _all value retrieves only missing or closed indices.
This parameter also applies to index aliases that point to a missing or closed index.
expand_wildcards
(Optional, string) Controls what kind of indices that wildcard expressions can expand to.
Valid values are::
all - Expand to open and closed indices.
open - Expand only to open indices.
closed - Expand only to closed indices.
none - Wildcard expressions are not accepted.
The defaults settings for the above parameters depend on the API being used.
CLI example::
salt myminion elasticsearch.flush_synced index='index1,index2' ignore_unavailable=True allow_no_indices=True expand_wildcards='all'
'''
es = _get_instance(hosts, profile)
try:
return es.indices.flush_synced(kwargs)
except elasticsearch.TransportError as e:
raise CommandExecutionError("Cannot flush synced, server returned code {} with message {}".format(e.status_code, e.error))

View File

@ -44,7 +44,7 @@ Installation Prerequisites
:maintainer: Simon Dodsley (simon@purestorage.com)
:maturity: new
:requires: purestorage
:requires: purity_fb
:platform: all
.. versionadded:: 2019.2.0

View File

@ -159,7 +159,7 @@ def target(key, full=True):
key = os.path.realpath(key)
if not os.path.exists(key):
log.debug('Unkown SysFS key %s', key)
log.debug('Unknown SysFS key %s', key)
return False
elif full:
return key

View File

@ -2054,24 +2054,96 @@ class State(object):
'test.arg(\'arg\', kw=\'kwarg\')')
return slot
log.debug('Calling slot: %s(%s, %s)', fun, args, kwargs)
return self.functions[fun](*args, **kwargs)
slot_return = self.functions[fun](*args, **kwargs)
# Given input __slot__:salt:test.arg(somekey="value").not.exist ~ /appended
# slot_text should be __slot...).not.exist
# append_data should be ~ /appended
slot_text = fmt[2].split('~')[0]
append_data = fmt[2].split('~', 1)[1:]
log.debug('slot_text: %s', slot_text)
log.debug('append_data: %s', append_data)
# Support parsing slot dict response
# return_get should result in a kwargs.nested.dict path by getting
# everything after first closing paren: )
return_get = None
try:
return_get = slot_text[slot_text.rindex(')')+1:]
except ValueError:
pass
if return_get:
#remove first period
return_get = return_get.split('.', 1)[1].strip()
log.debug('Searching slot result %s for %s', slot_return, return_get)
slot_return = salt.utils.data.traverse_dict_and_list(slot_return,
return_get,
default=None,
delimiter='.'
)
if append_data:
if isinstance(slot_return, six.string_types):
# Append text to slot string result
append_data = ' '.join(append_data).strip()
log.debug('appending to slot result: %s', append_data)
slot_return += append_data
else:
log.error('Ignoring slot append, slot result is not a string')
return slot_return
def format_slots(self, cdata):
'''
Read in the arguments from the low level slot syntax to make a last
minute runtime call to gather relevant data for the specific routine
Will parse strings, first level of dictionary values, and strings and
first level dict values inside of lists
'''
# __slot__:salt.cmd.run(foo, bar, baz=qux)
SLOT_TEXT = '__slot__:'
ctx = (('args', enumerate(cdata['args'])),
('kwargs', cdata['kwargs'].items()))
for atype, avalues in ctx:
for ind, arg in avalues:
arg = salt.utils.data.decode(arg, keep=True)
if not isinstance(arg, six.text_type) \
or not arg.startswith('__slot__:'):
if isinstance(arg, dict):
# Search dictionary values for __slot__:
for key, value in arg.items():
try:
if value.startswith(SLOT_TEXT):
log.trace("Slot processsing dict value %s", value)
cdata[atype][ind][key] = self.__eval_slot(value)
except AttributeError:
# Not a string/slot
continue
elif isinstance(arg, list):
for idx, listvalue in enumerate(arg):
log.trace("Slot processing list value: %s", listvalue)
if isinstance(listvalue, dict):
# Search dict values in list for __slot__:
for key, value in listvalue.items():
try:
if value.startswith(SLOT_TEXT):
log.trace("Slot processsing nested dict value %s", value)
cdata[atype][ind][idx][key] = self.__eval_slot(value)
except AttributeError:
# Not a string/slot
continue
if isinstance(listvalue, six.text_type):
# Search strings in a list for __slot__:
if listvalue.startswith(SLOT_TEXT):
log.trace("Slot processsing nested string %s", listvalue)
cdata[atype][ind][idx] = self.__eval_slot(listvalue)
elif isinstance(arg, six.text_type) \
and arg.startswith(SLOT_TEXT):
# Search strings for __slot__:
log.trace("Slot processsing %s", arg)
cdata[atype][ind] = self.__eval_slot(arg)
else:
# Not a slot, skip it
continue
cdata[atype][ind] = self.__eval_slot(arg)
def verify_retry_data(self, retry_data):
'''

View File

@ -31,6 +31,42 @@ Management of the Salt beacons
- 0.1
- 1.0
.. versionadded:: Neon
Beginning in the Neon release, multiple copies of a beacon can be configured
using the ``beacon_module`` parameter.
inotify_infs:
beacon.present:
- save: True
- enable: True
- files:
/etc/infs.conf:
mask:
- create
- delete
- modify
recurse: True
auto_add: True
- interval: 10
- beacon_module: inotify
- disable_during_state_run: True
inotify_ntp:
beacon.present:
- save: True
- enable: True
- files:
/etc/ntp.conf:
mask:
- create
- delete
- modify
recurse: True
auto_add: True
- interval: 10
- beacon_module: inotify
- disable_during_state_run: True
'''
from __future__ import absolute_import, print_function, unicode_literals

View File

@ -505,7 +505,7 @@ class CPModuleTest(ModuleCase):
file_contents = 'Hello world!'
for dirname in (nginx_root_dir, nginx_conf_dir):
os.mkdir(dirname)
os.makedirs(dirname)
# Write the temp file
with salt.utils.files.fopen(os.path.join(nginx_root_dir, 'actual_file'), 'w') as fp_:

View File

@ -17,7 +17,7 @@ from tests.support.mock import (
# Import Salt Libs
from salt.modules import elasticsearch
from salt.exceptions import CommandExecutionError
from salt.exceptions import CommandExecutionError, SaltInvocationError
# Import elasticsearch exceptions
NO_ELASTIC = False
@ -2264,3 +2264,111 @@ class ElasticsearchTestCase(TestCase):
with patch.object(elasticsearch, '_get_instance',
MagicMock(return_value=MockElastic())):
self.assertRaises(CommandExecutionError, elasticsearch.search_template_delete, "foo")
# Cluster settings tests below.
# We're assuming that _get_instance is properly tested
# These tests are very simple in nature, mostly checking default arguments.
def test_cluster_get_settings_succeess(self):
'''
Test if cluster get_settings fetch succeeds
'''
expected_settings = {"transient": {}, "persistent": {}}
fake_es = MagicMock()
fake_es.cluster = MagicMock()
fake_es.cluster.get_settings = MagicMock(return_value=expected_settings)
fake_instance = MagicMock(return_value=fake_es)
with patch.object(elasticsearch, '_get_instance', fake_instance):
actual_settings = elasticsearch.cluster_get_settings()
fake_es.cluster.get_settings.assert_called_with(flat_settings=False, include_defaults=False)
assert actual_settings == expected_settings
def test_cluster_get_settings_failure(self):
'''
Test if cluster get_settings fetch fails with CommandExecutionError
'''
fake_es = MagicMock()
fake_es.cluster = MagicMock()
fake_es.cluster.get_settings = MagicMock()
fake_es.cluster.get_settings.side_effect = TransportError("custom error", 123)
fake_instance = MagicMock(return_value=fake_es)
with patch.object(elasticsearch, '_get_instance', fake_instance):
self.assertRaises(CommandExecutionError, elasticsearch.cluster_get_settings)
def test_cluster_put_settings_succeess(self):
'''
Test if cluster put_settings succeeds
'''
expected_settings = {"acknowledged": True,
"transient": {},
"persistent": {"indices": {"recovery": {"max_bytes_per_sec": "50mb"}}}
}
body = {"transient": {}, "persistent": {"indices.recovery.max_bytes_per_sec": "50mb"}}
fake_es = MagicMock()
fake_es.cluster = MagicMock()
fake_es.cluster.put_settings = MagicMock(return_value=expected_settings)
fake_instance = MagicMock(return_value=fake_es)
with patch.object(elasticsearch, '_get_instance', fake_instance):
actual_settings = elasticsearch.cluster_put_settings(body=body)
fake_es.cluster.put_settings.assert_called_with(body=body, flat_settings=False)
assert actual_settings == expected_settings
def test_cluster_put_settings_failure(self):
'''
Test if cluster put_settings fails with CommandExecutionError
'''
body = {"transient": {}, "persistent": {"indices.recovery.max_bytes_per_sec": "50mb"}}
fake_es = MagicMock()
fake_es.cluster = MagicMock()
fake_es.cluster.put_settings = MagicMock()
fake_es.cluster.put_settings.side_effect = TransportError("custom error", 123)
fake_instance = MagicMock(return_value=fake_es)
with patch.object(elasticsearch, '_get_instance', fake_instance):
self.assertRaises(CommandExecutionError, elasticsearch.cluster_put_settings, body=body)
def test_cluster_put_settings_nobody(self):
'''
Test if cluster put_settings fails with SaltInvocationError
'''
self.assertRaises(SaltInvocationError, elasticsearch.cluster_put_settings)
# flush_synced tests below.
# We're assuming that _get_instance is properly tested
# These tests are very simple in nature, mostly checking default arguments.
def test_flush_synced_succeess(self):
'''
Test if flush_synced succeeds
'''
expected_return = {'_shards': {'failed': 0, 'successful': 0, 'total': 0}}
fake_es = MagicMock()
fake_es.indices = MagicMock()
fake_es.indices.flush_synced = MagicMock(return_value=expected_return)
fake_instance = MagicMock(return_value=fake_es)
with patch.object(elasticsearch, '_get_instance', fake_instance):
output = elasticsearch.flush_synced(index='_all', ignore_unavailable=True, allow_no_indices=True, expand_wildcards='all')
fake_es.indices.flush_synced.assert_called_with({'index': '_all', 'ignore_unavailable': True, 'allow_no_indices': True, 'expand_wildcards': 'all'})
assert output == expected_return
def test_flush_synced_failure(self):
'''
Test if flush_synced fails with CommandExecutionError
'''
fake_es = MagicMock()
fake_es.indices = MagicMock()
fake_es.indices.flush_synced = MagicMock()
fake_es.indices.flush_synced.side_effect = TransportError("custom error", 123)
fake_instance = MagicMock(return_value=fake_es)
with patch.object(elasticsearch, '_get_instance', fake_instance):
self.assertRaises(CommandExecutionError, elasticsearch.flush_synced)

View File

@ -281,6 +281,60 @@ class StateFormatSlotsTestCase(TestCase, AdaptedConfigurationTestCaseMixin):
mock.assert_called_once_with('fun_arg', fun_key='fun_val')
self.assertEqual(cdata, {'args': ['fun_return'], 'kwargs': {'key': 'val'}})
def test_format_slots_dict_arg(self):
'''
Test the format slots is calling a slot specified in dict arg.
'''
cdata = {
'args': [
{'subarg': '__slot__:salt:mod.fun(fun_arg, fun_key=fun_val)'},
],
'kwargs': {
'key': 'val',
}
}
mock = MagicMock(return_value='fun_return')
with patch.dict(self.state_obj.functions, {'mod.fun': mock}):
self.state_obj.format_slots(cdata)
mock.assert_called_once_with('fun_arg', fun_key='fun_val')
self.assertEqual(cdata, {'args': [{'subarg': 'fun_return'}], 'kwargs': {'key': 'val'}})
def test_format_slots_listdict_arg(self):
'''
Test the format slots is calling a slot specified in list containing a dict.
'''
cdata = {
'args': [[
{'subarg': '__slot__:salt:mod.fun(fun_arg, fun_key=fun_val)'},
]],
'kwargs': {
'key': 'val',
}
}
mock = MagicMock(return_value='fun_return')
with patch.dict(self.state_obj.functions, {'mod.fun': mock}):
self.state_obj.format_slots(cdata)
mock.assert_called_once_with('fun_arg', fun_key='fun_val')
self.assertEqual(cdata, {'args': [[{'subarg': 'fun_return'}]], 'kwargs': {'key': 'val'}})
def test_format_slots_liststr_arg(self):
'''
Test the format slots is calling a slot specified in list containing a dict.
'''
cdata = {
'args': [[
'__slot__:salt:mod.fun(fun_arg, fun_key=fun_val)',
]],
'kwargs': {
'key': 'val',
}
}
mock = MagicMock(return_value='fun_return')
with patch.dict(self.state_obj.functions, {'mod.fun': mock}):
self.state_obj.format_slots(cdata)
mock.assert_called_once_with('fun_arg', fun_key='fun_val')
self.assertEqual(cdata, {'args': [['fun_return']], 'kwargs': {'key': 'val'}})
def test_format_slots_kwarg(self):
'''
Test the format slots is calling a slot specified in kwargs with corresponding arguments.
@ -360,3 +414,41 @@ class StateFormatSlotsTestCase(TestCase, AdaptedConfigurationTestCaseMixin):
self.state_obj.format_slots(cdata)
mock.assert_not_called()
self.assertEqual(cdata, sls_data)
def test_slot_traverse_dict(self):
'''
Test the slot parsing of dict response.
'''
cdata = {
'args': [
'arg',
],
'kwargs': {
'key': '__slot__:salt:mod.fun(fun_arg, fun_key=fun_val).key1',
}
}
return_data = {'key1': 'value1'}
mock = MagicMock(return_value=return_data)
with patch.dict(self.state_obj.functions, {'mod.fun': mock}):
self.state_obj.format_slots(cdata)
mock.assert_called_once_with('fun_arg', fun_key='fun_val')
self.assertEqual(cdata, {'args': ['arg'], 'kwargs': {'key': 'value1'}})
def test_slot_append(self):
'''
Test the slot parsing of dict response.
'''
cdata = {
'args': [
'arg',
],
'kwargs': {
'key': '__slot__:salt:mod.fun(fun_arg, fun_key=fun_val).key1 ~ thing~',
}
}
return_data = {'key1': 'value1'}
mock = MagicMock(return_value=return_data)
with patch.dict(self.state_obj.functions, {'mod.fun': mock}):
self.state_obj.format_slots(cdata)
mock.assert_called_once_with('fun_arg', fun_key='fun_val')
self.assertEqual(cdata, {'args': ['arg'], 'kwargs': {'key': 'value1thing~'}})