Merge remote-tracking branch 'upstream/develop' into stable

This commit is contained in:
Pedro Algarvio 2021-06-29 19:19:55 +01:00
commit 14287fbbe1
No known key found for this signature in database
GPG key ID: BB36BF6584A298FF
13 changed files with 1398 additions and 290 deletions

87
.github/workflows/kitchen.vagrant.yml vendored Normal file
View file

@ -0,0 +1,87 @@
---
name: 'Kitchen Vagrant (FreeBSD & OpenBSD)'
'on': ['push', 'pull_request']
env:
KITCHEN_LOCAL_YAML: 'kitchen.vagrant.yml'
jobs:
generate-actions-workflow:
name: 'Generate The Actions Workflow'
runs-on: 'ubuntu-latest'
steps:
- uses: 'actions/checkout@v1'
- name: 'Set up Python 3.7'
uses: 'actions/setup-python@v1'
with:
python-version: 3.7
- name: 'Install Pre-Commit'
run: |
pip install -U pip
pip install pre-commit
pre-commit install
- name: 'Generate Workflow Actions'
run: |
pre-commit run -av generate-actions-workflow
lint:
name: 'Lint'
runs-on: 'ubuntu-latest'
needs: 'generate-actions-workflow'
container: 'koalaman/shellcheck-alpine:v0.6.0'
steps:
- uses: 'actions/checkout@v1'
- name: 'ShellCheck'
run: |
shellcheck -s sh -f tty bootstrap-salt.sh
test:
runs-on: 'macos-10.15'
timeout-minutes: 20
needs: 'lint'
strategy:
fail-fast: false
matrix:
instance:
- py3-git-3000-freebsd-130
- py3-git-3000-freebsd-122
- py3-git-3000-freebsd-114
# - py3-git-3000-openbsd-6
- py3-git-3001-freebsd-130
- py3-git-3001-freebsd-122
- py3-git-3001-freebsd-114
# - py3-git-3001-openbsd-6
- py3-git-3002-freebsd-130
- py3-git-3002-freebsd-122
- py3-git-3002-freebsd-114
# - py3-git-3002-openbsd-6
- py3-git-master-freebsd-130
- py3-git-master-freebsd-122
- py3-git-master-freebsd-114
# - py3-git-master-openbsd-6
- latest-freebsd-130
- latest-freebsd-122
- latest-freebsd-114
- latest-openbsd-6
steps:
- name: 'Check out code'
uses: 'actions/checkout@v2'
- name: 'Set up Bundler cache'
uses: 'actions/cache@v1'
with:
path: 'vendor/bundle'
key: "${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}"
restore-keys: "${{ runner.os }}-gems-"
- name: 'Run Bundler'
run: |
ruby --version
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
- name: 'Set up Python 3.7'
uses: 'actions/setup-python@v1'
with:
python-version: '3.7'
- name: 'Install Python Dependencies'
run: |
pip install -U pip
pip install -r tests/requirements.txt
- name: 'Run Test Kitchen'
run: 'bundle exec kitchen test ${{ matrix.instance }}'

150
.github/workflows/kitchen.windows.yml vendored Normal file
View file

@ -0,0 +1,150 @@
---
name: 'Kitchen (Windows)'
'on': ['push', 'pull_request']
env:
machine_user: kitchen
machine_pass: Password1
machine_port: 5985
KITCHEN_LOCAL_YAML: 'kitchen.windows.yml'
jobs:
generate-actions-workflow:
name: 'Generate The Actions Workflow'
runs-on: 'ubuntu-latest'
steps:
- uses: 'actions/checkout@v1'
- name: 'Set up Python 3.7'
uses: 'actions/setup-python@v1'
with:
python-version: 3.7
- name: 'Install Pre-Commit'
run: |
pip install -U pip
pip install pre-commit
pre-commit install
- name: 'Generate Workflow Actions'
run: |
pre-commit run -av generate-actions-workflow
lint:
name: 'Lint'
runs-on: 'ubuntu-latest'
needs: 'generate-actions-workflow'
container: 'koalaman/shellcheck-alpine:v0.6.0'
steps:
- uses: 'actions/checkout@v1'
- name: 'ShellCheck'
run: |
shellcheck -s sh -f tty bootstrap-salt.sh
test-2019:
runs-on: 'windows-2019'
timeout-minutes: 20
needs: 'lint'
strategy:
fail-fast: false
matrix:
instance:
- py3-stable-3001-windows-2019
- py3-stable-3002-windows-2019
- latest-windows-2019
steps:
- name: 'Check out code'
uses: 'actions/checkout@v2'
- name: 'Install Chef'
uses: 'actionshub/chef-install@1.1.0'
with:
project: 'chef'
version: '16.10.8'
- name: 'Add Chef bindir to PATH'
uses: 'myci-actions/export-env-var-powershell@1'
with:
name: 'PATH'
value: "C:\\opscode\\chef\\bin;\
C:\\opscode\\chef\\embedded\\bin;$env:PATH"
- name: 'Set up Bundler cache'
uses: 'actions/cache@v1'
with:
path: 'vendor/bundle'
key: "${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}"
restore-keys: "${{ runner.os }}-gems-"
- name: 'Set up test user'
run: |
$password = ConvertTo-SecureString $env:machine_pass -AsPlainText -Force
New-LocalUser $env:machine_user -Password $password
Add-LocalGroupMember -Group "Administrators" -Member $env:machine_user
- name: 'Set up WinRM'
run: >
Set-WSManQuickConfig -Force;
Set-WSManInstance -ResourceURI winrm/config/service
-ValueSet @{AllowUnencrypted="true"}
- name: 'Run Bundler'
run: |
ruby --version
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
- name: 'Set up Python 3.7'
uses: 'actions/setup-python@v1'
with:
python-version: '3.7'
- name: 'Install Python Dependencies'
run: |
pip install -U pip
pip install -r tests/requirements.txt
- name: 'Run Test Kitchen'
run: 'bundle exec kitchen test ${{ matrix.instance }}'
test-2016:
runs-on: 'windows-2016'
timeout-minutes: 20
needs: 'lint'
strategy:
fail-fast: false
matrix:
instance:
- py3-stable-3001-windows-2016
- py3-stable-3002-windows-2016
- latest-windows-2016
steps:
- name: 'Check out code'
uses: 'actions/checkout@v2'
- name: 'Install Chef'
uses: 'actionshub/chef-install@1.1.0'
with:
project: 'chef'
version: '16.10.8'
- name: 'Add Chef bindir to PATH'
uses: 'myci-actions/export-env-var-powershell@1'
with:
name: 'PATH'
value: "C:\\opscode\\chef\\bin;\
C:\\opscode\\chef\\embedded\\bin;$env:PATH"
- name: 'Set up Bundler cache'
uses: 'actions/cache@v1'
with:
path: 'vendor/bundle'
key: "${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}"
restore-keys: "${{ runner.os }}-gems-"
- name: 'Set up test user'
run: |
$password = ConvertTo-SecureString $env:machine_pass -AsPlainText -Force
New-LocalUser $env:machine_user -Password $password
Add-LocalGroupMember -Group "Administrators" -Member $env:machine_user
- name: 'Set up WinRM'
run: >
Set-WSManQuickConfig -Force;
Set-WSManInstance -ResourceURI winrm/config/service
-ValueSet @{AllowUnencrypted="true"}
- name: 'Run Bundler'
run: |
ruby --version
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
- name: 'Set up Python 3.7'
uses: 'actions/setup-python@v1'
with:
python-version: '3.7'
- name: 'Install Python Dependencies'
run: |
pip install -U pip
pip install -r tests/requirements.txt
- name: 'Run Test Kitchen'
run: 'bundle exec kitchen test ${{ matrix.instance }}'

File diff suppressed because it is too large Load diff

View file

@ -6,6 +6,7 @@ import datetime
os.chdir(os.path.abspath(os.path.dirname(__file__)))
LINUX_DISTROS = [
"almalinux-8",
"amazon-2",
"arch",
"centos-7",
@ -13,16 +14,19 @@ LINUX_DISTROS = [
"debian-10",
"debian-11",
"debian-9",
"fedora-32",
"fedora-33",
"fedora-34",
"fedora-35",
"gentoo",
"gentoo-systemd",
"opensuse-15",
"opensuse-tumbleweed",
"oraclelinux-7",
"ubuntu-1604",
"oraclelinux-8",
"rockylinux-8",
"ubuntu-1804",
"ubuntu-2004",
"ubuntu-2104",
]
OSX = WINDOWS = []
@ -33,50 +37,71 @@ STABLE_DISTROS = [
"debian-10",
"debian-11",
"debian-9",
"fedora-32",
"fedora-33",
"fedora-34",
"fedora-35",
"gentoo",
"gentoo-systemd",
"oraclelinux-7",
"ubuntu-1604",
"oraclelinux-8",
"ubuntu-1804",
"ubuntu-2004",
"ubuntu-2104",
]
PY2_BLACKLIST = [
"almalinux-8",
"centos-8",
"debian-10",
"debian-11",
"fedora-32",
"fedora-33",
"fedora-34",
"fedora-35",
"gentoo",
"gentoo-systemd",
"opensuse-15",
"opensuse-tumbleweed",
"oraclelinux-8",
"rockylinux-8",
"ubuntu-2004",
"ubuntu-2104",
]
BLACKLIST_3000 = [
"almalinux-8",
"debian-11",
"fedora-33",
"fedora-34",
"fedora-35",
"opensuse-tumbleweed",
"rockylinux-8",
"ubuntu-2004",
"ubuntu-2104",
]
BLACKLIST_3001 = [
"almalinux-8",
"debian-11",
"rockylinux-8",
"ubuntu-2104",
]
BLACKLIST_3001_0 = [
"almalinux-8",
"debian-11",
"gentoo",
"gentoo-systemd",
"rockylinux-8",
"ubuntu-2104",
]
BLACKLIST_3002_0 = [
"almalinux-8",
"debian-11",
"gentoo",
"gentoo-systemd",
"rockylinux-8",
"ubuntu-2104",
]
SALT_BRANCHES = [
@ -101,11 +126,10 @@ BRANCH_DISPLAY_NAMES = {
STABLE_BRANCH_BLACKLIST = []
LATEST_PKG_BLACKLIST = [
"arch", # No packages are built
]
LATEST_PKG_BLACKLIST = []
DISTRO_DISPLAY_NAMES = {
"almalinux-8": "AlmaLinux 8",
"amazon-2": "Amazon 2",
"arch": "Arch",
"centos-7": "CentOS 7",
@ -113,16 +137,19 @@ DISTRO_DISPLAY_NAMES = {
"debian-10": "Debian 10",
"debian-11": "Debian 11",
"debian-9": "Debian 9",
"fedora-32": "Fedora 32",
"fedora-33": "Fedora 33",
"fedora-34": "Fedora 34",
"fedora-35": "Fedora 35",
"gentoo": "Gentoo",
"gentoo-systemd": "Gentoo (systemd)",
"opensuse-15": "Opensuse 15",
"opensuse-tumbleweed": "Opensuse Tumbleweed",
"oraclelinux-7": "Oracle Linux 7",
"ubuntu-1604": "Ubuntu 16.04",
"oraclelinux-8": "Oracle Linux 8",
"rockylinux-8": "Rocky Linux 8",
"ubuntu-1804": "Ubuntu 18.04",
"ubuntu-2004": "Ubuntu 20.04",
"ubuntu-2104": "Ubuntu 21.04",
}
TIMEOUT_DEFAULT = 20
@ -218,7 +245,7 @@ def generate_test_jobs():
continue
if python_version == "py3":
if distro in ("arch", "fedora-32"):
if distro in ("arch"):
allowed_branches = ["master"]
try:
int_branch = int(branch)

View file

@ -1,5 +1,11 @@
Version TBD (In Progress on the Develop Branch):
Version 2021.06.23:
* Use salt.list instead of saltstack.list (bryceml) #1563
* Use fetch_url function for curl (xeacott) #1562
* Add Ubuntu 21.04 support (krionbsd) #1559
* Remove python2-futures package for ArchLinux (myii) #1546
Version 2020.03.02:
* Debian 11 (bullseye/testing) support using Debian 10 packages (jpacura, bryceml) #1514
* Fix bootstrap on Gentoo (ijansky) #1516 #1518

View file

@ -3,3 +3,7 @@ source "https://rubygems.org"
gem 'test-kitchen', '>= 2.0.1'
gem 'kitchen-salt', '>= 0.5'
gem 'kitchen-docker', git: 'https://github.com/test-kitchen/kitchen-docker.git'
group :vagrant do
gem 'kitchen-vagrant'
end

View file

@ -32,6 +32,7 @@ sum** of the downloaded ``bootstrap-salt.sh`` file.
The SHA256 sum of the ``bootstrap-salt.sh`` file, per release, is:
- 2021.03.02: ``91baa0073308f1be20c7be65238ef67e5733c75285314b302a5b2456e73a0758``
- 2020.10.20: ``b47bfc8d63cccf22eb4cd94491d30cc1d571e184be25a5be7f775e7f2daaf6e2``
- 2020.10.19: ``f6c3e2c52f98d115809044b09062219369957caf30228b594033f0543e202c52``
- 2020.06.23: ``1d07db867c195c864d0ae70664524f2099cc9a46872953293c67c3f239d4f4f5``
@ -520,7 +521,7 @@ UNIX systems
**BSD**:
- OpenBSD (``pip`` installation)
- FreeBSD 11/12
- FreeBSD 11/12/13/14-CURRENT
**SunOS**:

View file

@ -23,7 +23,7 @@
#======================================================================================================================
set -o nounset # Treat unset variables as an error
__ScriptVersion="2021.03.02"
__ScriptVersion="2021.06.23"
__ScriptName="bootstrap-salt.sh"
__ScriptFullName="$0"
@ -1457,6 +1457,9 @@ __ubuntu_codename_translation() {
"20")
DISTRO_CODENAME="focal"
;;
"21")
DISTRO_CODENAME="hirsute"
;;
*)
DISTRO_CODENAME="trusty"
;;
@ -1580,15 +1583,11 @@ __check_end_of_life_versions() {
ubuntu)
# Ubuntu versions not supported
#
# < 16.04
# = 16.10
# = 17.04, 17.10
# < 18.04
# = 18.10
# = 19.04, 19.10
if [ "$DISTRO_MAJOR_VERSION" -lt 16 ] || \
[ "$DISTRO_MAJOR_VERSION" -eq 17 ] || \
if [ "$DISTRO_MAJOR_VERSION" -lt 18 ] || \
[ "$DISTRO_MAJOR_VERSION" -eq 19 ] || \
{ [ "$DISTRO_MAJOR_VERSION" -eq 16 ] && [ "$DISTRO_MINOR_VERSION" -eq 10 ]; } || \
{ [ "$DISTRO_MAJOR_VERSION" -eq 18 ] && [ "$DISTRO_MINOR_VERSION" -eq 10 ]; }; then
echoerror "End of life distributions are not supported."
echoerror "Please consider upgrading to the next stable. See:"
@ -1633,8 +1632,8 @@ __check_end_of_life_versions() {
;;
fedora)
# Fedora lower than 27 are no longer supported
if [ "$DISTRO_MAJOR_VERSION" -lt 30 ]; then
# Fedora lower than 33 are no longer supported
if [ "$DISTRO_MAJOR_VERSION" -lt 33 ]; then
echoerror "End of life distributions are not supported."
echoerror "Please consider upgrading to the next stable. See:"
echoerror " https://fedoraproject.org/wiki/Releases"
@ -2739,9 +2738,14 @@ EOM
echodebug "Installed pip version: $(${_pip_cmd} --version)"
fi
# We also lock setuptools to <45 which is the latest release to support both py2 and py3
echodebug "Running '${_pip_cmd} install wheel setuptools>=${_MINIMUM_SETUPTOOLS_VERSION},<45'"
${_pip_cmd} install ${_POST_NEON_PIP_INSTALL_ARGS} wheel "setuptools>=${_MINIMUM_SETUPTOOLS_VERSION},<45"
_setuptools_dep="setuptools>=${_MINIMUM_SETUPTOOLS_VERSION}"
if [ "$_PY_MAJOR_VERSION" -eq 2 ]; then
# We also lock setuptools to <45 which is the latest release to support both py2 and py3
_setuptools_dep="${_setuptools_dep},<45"
fi
echodebug "Running '${_pip_cmd} install wheel ${_setuptools_dep}'"
${_pip_cmd} install ${_POST_NEON_PIP_INSTALL_ARGS} wheel "${_setuptools_dep}"
echoinfo "Installing salt using ${_py_exe}"
cd "${_SALT_GIT_CHECKOUT_DIR}" || return 1
@ -2906,8 +2910,9 @@ __enable_universe_repository() {
}
__install_saltstack_ubuntu_repository() {
# Workaround for latest non-LTS ubuntu
if { [ "$DISTRO_MAJOR_VERSION" -eq 20 ] && [ "$DISTRO_MINOR_VERSION" -eq 10 ]; }; then
# Workaround for latest non-LTS Ubuntu
if { [ "$DISTRO_MAJOR_VERSION" -eq 20 ] && [ "$DISTRO_MINOR_VERSION" -eq 10 ]; } || \
{ [ "$DISTRO_MAJOR_VERSION" -eq 21 ] && [ "$DISTRO_MINOR_VERSION" -eq 04 ]; }; then
echowarn "Non-LTS Ubuntu detected, but stable packages requested. Trying packages for previous LTS release. You may experience problems."
UBUNTU_VERSION=20.04
UBUNTU_CODENAME="focal"
@ -2939,7 +2944,7 @@ __install_saltstack_ubuntu_repository() {
# SaltStack's stable Ubuntu repository:
SALTSTACK_UBUNTU_URL="${HTTP_VAL}://${_REPO_URL}/${__PY_VERSION_REPO}/ubuntu/${UBUNTU_VERSION}/${__REPO_ARCH}/${STABLE_REV}"
echo "$__REPO_ARCH_DEB $SALTSTACK_UBUNTU_URL $UBUNTU_CODENAME main" > /etc/apt/sources.list.d/saltstack.list
echo "$__REPO_ARCH_DEB $SALTSTACK_UBUNTU_URL $UBUNTU_CODENAME main" > /etc/apt/sources.list.d/salt.list
__apt_key_fetch "$SALTSTACK_UBUNTU_URL/salt-archive-keyring.gpg" || return 1
@ -3030,7 +3035,7 @@ install_ubuntu_stable_deps() {
if [ "${_UPGRADE_SYS}" -eq $BS_TRUE ]; then
if [ "${_INSECURE_DL}" -eq $BS_TRUE ]; then
if [ "$DISTRO_MAJOR_VERSION" -ge 20 ]; then
if [ "$DISTRO_MAJOR_VERSION" -ge 20 ] || [ "$DISTRO_MAJOR_VERSION" -ge 21 ]; then
__apt_get_install_noinput --allow-unauthenticated debian-archive-keyring && apt-get update || return 1
else
__apt_get_install_noinput --allow-unauthenticated debian-archive-keyring &&
@ -3382,7 +3387,7 @@ __install_saltstack_debian_repository() {
# amd64 is just a part of repository URI, 32-bit pkgs are hosted under the same location
SALTSTACK_DEBIAN_URL="${HTTP_VAL}://${_REPO_URL}/${__PY_VERSION_REPO}/debian/${DEBIAN_RELEASE}/${__REPO_ARCH}/${STABLE_REV}"
echo "$__REPO_ARCH_DEB $SALTSTACK_DEBIAN_URL $DEBIAN_CODENAME main" > "/etc/apt/sources.list.d/saltstack.list"
echo "$__REPO_ARCH_DEB $SALTSTACK_DEBIAN_URL $DEBIAN_CODENAME main" > "/etc/apt/sources.list.d/salt.list"
__apt_key_fetch "$SALTSTACK_DEBIAN_URL/salt-archive-keyring.gpg" || return 1
@ -4128,7 +4133,7 @@ __install_saltstack_rhel_repository() {
# Instead, this should work correctly on all RHEL variants.
base_url="${HTTP_VAL}://${_REPO_URL}/${__PY_VERSION_REPO}/redhat/${DISTRO_MAJOR_VERSION}/\$basearch/${repo_rev}/"
gpg_key="SALTSTACK-GPG-KEY.pub"
repo_file="/etc/yum.repos.d/saltstack.repo"
repo_file="/etc/yum.repos.d/salt.repo"
if [ ! -s "$repo_file" ] || [ "$_FORCE_OVERWRITE" -eq $BS_TRUE ]; then
cat <<_eof > "$repo_file"
@ -4146,7 +4151,7 @@ _eof
__rpm_import_gpg "${fetch_url}${gpg_key}" || return 1
yum clean metadata || return 1
elif [ "$repo_rev" != "latest" ]; then
echowarn "saltstack.repo already exists, ignoring salt version argument."
echowarn "salt.repo already exists, ignoring salt version argument."
echowarn "Use -F (forced overwrite) to install $repo_rev."
fi
@ -5203,7 +5208,7 @@ install_amazon_linux_ami_deps() {
fi
if [ $_DISABLE_REPOS -eq $BS_FALSE ] || [ "$_CUSTOM_REPO_URL" != "null" ]; then
__REPO_FILENAME="saltstack-repo.repo"
__REPO_FILENAME="salt.repo"
# Set a few vars to make life easier.
if [ $_USEAWS -eq $BS_TRUE ]; then
@ -5438,13 +5443,13 @@ install_amazon_linux_ami_2_deps() {
fi
if [ $_DISABLE_REPOS -eq $BS_FALSE ] || [ "$_CUSTOM_REPO_URL" != "null" ]; then
__REPO_FILENAME="saltstack-repo.repo"
__REPO_FILENAME="salt.repo"
__PY_VERSION_REPO="yum"
PY_PKG_VER=""
repo_label="saltstack-repo"
repo_name="SaltStack repo for Amazon Linux 2"
if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 3 ]; then
__REPO_FILENAME="saltstack-py3-repo.repo"
__REPO_FILENAME="salt.repo"
__PY_VERSION_REPO="py3"
PY_PKG_VER=3
repo_label="saltstack-py3-repo"
@ -5633,7 +5638,7 @@ install_arch_linux_git_deps() {
if [ "${_POST_NEON_INSTALL}" -eq $BS_FALSE ]; then
pacman -R --noconfirm python2-distribute
pacman -Su --noconfirm --needed python2-crypto python2-setuptools python2-jinja \
python2-m2crypto python2-futures python2-markupsafe python2-msgpack python2-psutil \
python2-m2crypto python2-markupsafe python2-msgpack python2-psutil \
python2-pyzmq zeromq python2-requests python2-systemd || return 1
if [ -f "${_SALT_GIT_CHECKOUT_DIR}/requirements/base.txt" ]; then
@ -5675,7 +5680,7 @@ install_arch_linux_stable() {
pacman -S --noconfirm --needed bash || return 1
pacman -Su --noconfirm || return 1
# We can now resume regular salt update
pacman -Syu --noconfirm salt python2-futures || return 1
pacman -Syu --noconfirm salt || return 1
return 0
}
@ -7516,7 +7521,7 @@ install_macosx_git_deps() {
install_macosx_stable() {
install_macosx_stable_deps || return 1
/usr/bin/curl "${SALTPKGCONFURL}" > "/tmp/${PKG}" || return 1
__fetch_url "/tmp/${PKG}" "${SALTPKGCONFURL}" || return 1
/usr/sbin/installer -pkg "/tmp/${PKG}" -target / || return 1

47
kitchen.vagrant.yml Normal file
View file

@ -0,0 +1,47 @@
---
driver:
name: vagrant
vm_hostname: salt
username: vagrant
cache_directory: false
customize:
usbxhci: 'off'
gui: false
linked_clone: true
ssh:
shell: /bin/sh
provisioner:
init_environment: |
echo 'auto_accept: true' > /tmp/auto-accept-keys.conf
sudo mkdir -p /usr/local/etc/salt/master.d
sudo mv /tmp/auto-accept-keys.conf /usr/local/etc/salt/master.d/auto-accept-keys.conf
sudo pkg install -y shuf
sh -c 't=$(shuf -i 1-15 -n 1); echo Sleeping $t seconds; sleep $t'
sudo: true
platforms:
- name: freebsd-130
driver:
box: bento/freebsd-13.0
- name: freebsd-122
driver:
box: bento/freebsd-12.2
- name: freebsd-114
driver:
box: bento/freebsd-11.4
- name: openbsd-6
driver:
box: generic/openbsd6
ssh:
shell: /bin/ksh
provisioner:
init_environment: |
echo 'auto_accept: true' > /tmp/auto-accept-keys.conf
sudo mkdir -p /etc/salt/master.d
sudo mv /tmp/auto-accept-keys.conf /etc/salt/master.d/auto-accept-keys.conf
sudo pkg_add coreutils
sh -c 't=$(gshuf -i 1-15 -n 1); echo Sleeping $t seconds; sleep $t'
verifier:
command: pytest --cache-clear -v -s -ra --log-cli-level=debug -k "not test_ping" tests/integration/

31
kitchen.windows.yml Normal file
View file

@ -0,0 +1,31 @@
---
driver:
name: proxy
host: localhost
reset_command: "exit 0"
port: 5985
username: kitchen
password: Password1
provisioner:
salt_bootstrap_url: D:/a/salt-bootstrap/salt-bootstrap/bootstrap-salt.ps1
salt_bootstrap_options: -pythonVersion 3 -version %s
init_environment: ''
platforms:
- name: windows-2019
- name: windows-2016
suites:
- name: py3-stable-3001
provisioner:
salt_version: 3001.7
- name: py3-stable-3002
provisioner:
salt_version: 3002
- name: latest
provisioner:
salt_version: latest
verifier:
command: pytest --cache-clear -v -s -ra --log-cli-level=debug -k "not test_ping" tests/integration/

View file

@ -28,6 +28,9 @@ provisioner:
sh -c 't=$(shuf -i 1-15 -n 1); echo Sleeping $t seconds; sleep $t'
platforms:
- name: almalinux-8
driver_config:
run_command: /usr/lib/systemd/systemd
- name: amazon-2
driver_config:
image: amazonlinux:2
@ -37,7 +40,7 @@ platforms:
- yum -y install procps-ng
- name: arch
driver_config:
image: archlinux/base
image: archlinux/archlinux
run_command: /usr/lib/systemd/systemd
provision_command:
- pacman -Syu --noconfirm --needed systemd grep awk procps which
@ -60,12 +63,6 @@ platforms:
driver_config:
image: debian:bullseye
run_command: /lib/systemd/systemd
- name: fedora-32
driver_config:
image: fedora:32
run_command: /usr/lib/systemd/systemd
provision_command:
- dnf -y install procps-ng
- name: fedora-33
driver_config:
image: fedora:33
@ -73,6 +70,20 @@ platforms:
provision_command:
- dnf -y install procps-ng
- sed -i 's/^PubkeyAcceptedKeyTypes.*$/&,ssh-rsa/' /etc/crypto-policies/back-ends/opensshserver.config
- name: fedora-34
driver_config:
image: fedora:34
run_command: /usr/lib/systemd/systemd
provision_command:
- dnf -y install procps-ng
- sed -i 's/^PubkeyAcceptedKeyTypes.*$/&,ssh-rsa/' /etc/crypto-policies/back-ends/opensshserver.config
- name: fedora-35
driver_config:
image: fedora:35
run_command: /usr/lib/systemd/systemd
provision_command:
- dnf -y install procps-ng
- sed -i 's/^PubkeyAcceptedKeyTypes.*$/&,ssh-rsa/' /etc/crypto-policies/back-ends/opensshserver.config
- name: gentoo
driver_config:
image: ksmanis/stage3:latest
@ -105,18 +116,25 @@ platforms:
- systemctl enable sshd.service
provisioner:
salt_bootstrap_options: -MPfq -y -x python3 git %s
- name: oraclelinux-8
driver_config:
run_command: /usr/lib/systemd/systemd
- name: oraclelinux-7
driver_config:
run_command: /usr/lib/systemd/systemd
- name: rockylinux-8
driver_config:
image: rockylinux/rockylinux
run_command: /usr/lib/systemd/systemd
- name: ubuntu-21.04
driver_config:
run_command: /lib/systemd/systemd
- name: ubuntu-20.04
driver_config:
run_command: /lib/systemd/systemd
- name: ubuntu-18.04
driver_config:
run_command: /lib/systemd/systemd
- name: ubuntu-16.04
driver_config:
run_command: /lib/systemd/systemd
suites:
- name: py2-git-3000
@ -127,6 +145,10 @@ suites:
- debian-11
- gentoo
- gentoo-systemd
- freebsd-130
- freebsd-122
- freebsd-114
- openbsd-6
- name: py2-git-master
provisioner:
salt_version: master
@ -135,6 +157,10 @@ suites:
- debian-11
- gentoo
- gentoo-systemd
- freebsd-130
- freebsd-122
- freebsd-114
- openbsd-6
- name: py2-stable-3000
provisioner:
salt_version: 3000
@ -145,11 +171,15 @@ suites:
- opensuse-tumbleweed
- debian-10
- debian-11
- fedora-32
- fedora-33
- gentoo
- gentoo-systemd
- ubuntu-2004
- ubuntu-2104
- freebsd-130
- freebsd-122
- freebsd-114
- openbsd-6
- name: py3-git-3000
provisioner:
@ -159,6 +189,7 @@ suites:
- debian-11
- opensuse-tumbleweed
- ubuntu-2004
- ubuntu-2104
- name: py3-git-3001
provisioner:
salt_version: 3001
@ -177,6 +208,11 @@ suites:
- opensuse-tumbleweed
- arch
- ubuntu-2004
- ubuntu-2104
- freebsd-130
- freebsd-122
- freebsd-114
- openbsd-6
- name: py3-stable-3001-0
provisioner:
salt_version: 3001
@ -185,11 +221,15 @@ suites:
- opensuse-15
- opensuse-tumbleweed
- debian-11
- fedora-32
- fedora-33
- arch
- gentoo
- gentoo-systemd
- ubuntu-2104
- freebsd-130
- freebsd-122
- freebsd-114
- openbsd-6
- name: py3-stable-3001
provisioner:
salt_version: 3001
@ -199,6 +239,11 @@ suites:
- opensuse-15
- opensuse-tumbleweed
- arch
- ubuntu-2104
- freebsd-130
- freebsd-122
- freebsd-114
- openbsd-6
- name: py3-stable-3002-0
provisioner:
salt_version: 3002
@ -207,11 +252,14 @@ suites:
- opensuse-15
- opensuse-tumbleweed
- debian-11
- fedora-32
- fedora-33
- arch
- gentoo
- gentoo-systemd
- freebsd-130
- freebsd-122
- freebsd-114
- openbsd-6
- name: py3-stable-3002
provisioner:
salt_version: 3002
@ -220,6 +268,10 @@ suites:
- opensuse-15
- opensuse-tumbleweed
- arch
- freebsd-130
- freebsd-122
- freebsd-114
- openbsd-6
- name: py3-git-master
provisioner:
salt_version: master
@ -229,8 +281,6 @@ suites:
provisioner:
salt_version: latest
salt_bootstrap_options: -MP stable %s
excludes:
- arch
verifier:
name: shell

View file

@ -9,7 +9,9 @@ log = logging.getLogger(__name__)
@pytest.fixture(scope="session")
def host():
if os.environ.get("KITCHEN_USERNAME") == "vagrant":
if os.environ.get("KITCHEN_USERNAME") == "vagrant" or "windows" in os.environ.get(
"KITCHEN_INSTANCE"
):
if "windows" in os.environ.get("KITCHEN_INSTANCE"):
return testinfra.get_host(
"winrm://{KITCHEN_USERNAME}:{KITCHEN_PASSWORD}@{KITCHEN_HOSTNAME}:{KITCHEN_PORT}".format(

View file

@ -1,25 +1,33 @@
# -*- coding: utf-8 -*-
import json
import os
import pytest
import logging
import pprint
from contextlib import nullcontext
log = logging.getLogger(__name__)
def selected_context_manager(host):
if "windows" in os.environ.get("KITCHEN_INSTANCE"):
return nullcontext()
return host.sudo()
def test_ping(host):
with host.sudo():
with selected_context_manager(host):
assert host.salt("test.ping", "--timeout=120")
def test_target_python_version(host, target_python_version):
with host.sudo():
with selected_context_manager(host):
ret = host.salt("grains.item", "pythonversion", "--timeout=120")
assert ret["pythonversion"][0] == target_python_version
def test_target_salt_version(host, target_salt_version):
with host.sudo():
with selected_context_manager(host):
ret = host.salt("grains.item", "saltversion", "--timeout=120")
if target_salt_version.endswith(".0"):
assert ret["saltversion"] == ".".join(target_salt_version.split(".")[:-1])