Reverted to using kitchen-salt in order to get this out faster

This commit is contained in:
David Murphy 2024-06-25 11:23:53 -06:00 committed by Daniel Wozniak
parent 1812ec20e6
commit 1ad1dbe0fc
11 changed files with 436 additions and 65 deletions

View file

@ -27,9 +27,8 @@ jobs:
separator: "," separator: ","
files: | files: |
bootstrap-salt.* bootstrap-salt.*
## DGM Gemfile Gemfile
## DGM kitchen*.yml kitchen*.yml
btstrap-build*.yml
tests/** tests/**
.github/workflows/** .github/workflows/**
files_ignore: | files_ignore: |
@ -62,10 +61,10 @@ jobs:
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Set up Python 3.10 - name: Set up Python 3.9
uses: actions/setup-python@v4 uses: actions/setup-python@v4
with: with:
python-version: "3.10" python-version: 3.9
- name: Install Pre-Commit - name: Install Pre-Commit
run: | run: |

View file

@ -27,9 +27,8 @@ jobs:
separator: "," separator: ","
files: | files: |
bootstrap-salt.* bootstrap-salt.*
## DGM Gemfile Gemfile
## DGM kitchen*.yml kitchen*.yml
btstrap-build*.yml
tests/** tests/**
.github/workflows/** .github/workflows/**
files_ignore: | files_ignore: |
@ -62,10 +61,10 @@ jobs:
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Set up Python 3.10 - name: Set up Python 3.9
uses: actions/setup-python@v4 uses: actions/setup-python@v4
with: with:
python-version: "3.10" python-version: 3.9
- name: Install Pre-Commit - name: Install Pre-Commit
run: | run: |

View file

@ -38,16 +38,17 @@ jobs:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
## DGM Need to replace this ## DGM Need to replace this
## DGM - name: Setup Ruby - name: Setup Ruby
## DGM uses: ruby/setup-ruby@v1 uses: ruby/setup-ruby@v1
## DGM with: with:
## DGM ruby-version: 3.2.3 ## DGM ruby-version: 3.2.3
## DGM bundler-cache: true ruby-version: 2.6.10
bundler-cache: true
- name: Set up Python 3.10 - name: Set up Python 3.9
uses: actions/setup-python@v4 uses: actions/setup-python@v4
with: with:
python-version: "3.10" python-version: 3.9
- name: Install Python Dependencies - name: Install Python Dependencies
run: | run: |
@ -57,27 +58,20 @@ jobs:
- name: Create Test Instance - name: Create Test Instance
run: | run: |
## DGM Need to replace this ## DGM Need to replace this
## DGM b (sleep 10 && bundle exec kitchen create ${{ matrix.instance }}-${{ inputs.distro-slug }})
## DGM (sleep 10 && bundle exec kitchen create ${{ matrix.instance }}-${{ inputs.distro-slug }})
## DGM
## DGM Need to select a GitHub runner here , ubuntu-latest
sleep 2 sleep 2
- name: Test Bootstrap - name: Test Bootstrap
run: | run: |
## DGM Need to replace this ## DGM Need to replace this
## DGM bundle exec kitchen verify ${{ matrix.instance }}-${{ inputs.distro-slug }} bundle exec kitchen verify ${{ matrix.instance }}-${{ inputs.distro-slug }}
## DGM
## DGM Need to run the bootstrap tests for Linux here
sleep 2 sleep 2
- name: Destroy Test Instance - name: Destroy Test Instance
if: always() if: always()
run: | run: |
## DGM Need to replace this ## DGM Need to replace this
## DGM bundle exec kitchen destroy ${{ matrix.instance }}-${{ inputs.distro-slug }} bundle exec kitchen destroy ${{ matrix.instance }}-${{ inputs.distro-slug }}
## DGM
## DGM this can be removed since using GitHub shared runners, and it should just close when done with it
sleep 2 sleep 2
- name: Set Exit Status - name: Set Exit Status

View file

@ -28,9 +28,9 @@ on:
default: 20 default: 20
description: The timeout(in minutes) for the workflow description: The timeout(in minutes) for the workflow
## DGM env: env:
## DGM KITCHEN_LOCAL_YAML: 'kitchen.macos.yml' KITCHEN_LOCAL_YAML: 'kitchen.macos.yml'
## DGM
## DGM Wonder what the KITCHEN_LOCAL_YAML had to be set here for MacOS, do we need to do something similar for runners ? ## DGM Wonder what the KITCHEN_LOCAL_YAML had to be set here for MacOS, do we need to do something similar for runners ?
jobs: jobs:
@ -50,13 +50,14 @@ jobs:
- name: Setup Ruby - name: Setup Ruby
uses: ruby/setup-ruby@v1 uses: ruby/setup-ruby@v1
with: with:
ruby-version: 3.2.3 ## DGM ruby-version: 3.2.3
ruby-version: 2.6.10
bundler-cache: true bundler-cache: true
- name: Set up Python 3.10 - name: Set up Python 3.9
uses: actions/setup-python@v4 uses: actions/setup-python@v4
with: with:
python-version: "3.10" python-version: 3.9
- name: Install Python Dependencies - name: Install Python Dependencies
run: | run: |
@ -65,25 +66,19 @@ jobs:
- name: Create Test Instance - name: Create Test Instance
run: | run: |
## DGM bundle exec kitchen create ${{ matrix.instance }}-${{ inputs.distro-slug }} || \ bundle exec kitchen create ${{ matrix.instance }}-${{ inputs.distro-slug }} || \
## DGM (sleep 10 && bundle exec kitchen create ${{ matrix.instance }}-${{ inputs.distro-slug }}) (sleep 10 && bundle exec kitchen create ${{ matrix.instance }}-${{ inputs.distro-slug }})
## DGM
## DGM Need to select a GitHub runner here , macos-latest
sleep 2 sleep 2
- name: Test Bootstrap - name: Test Bootstrap
run: | run: |
## DGM bundle exec kitchen verify ${{ matrix.instance }}-${{ inputs.distro-slug }} bundle exec kitchen verify ${{ matrix.instance }}-${{ inputs.distro-slug }}
## DGM
## DGM Need to run the bootstrap tests for MacOS here
sleep 2 sleep 2
- name: Destroy Test Instance - name: Destroy Test Instance
if: always() if: always()
run: | run: |
## DGM bundle exec kitchen destroy ${{ matrix.instance }}-${{ inputs.distro-slug }} bundle exec kitchen destroy ${{ matrix.instance }}-${{ inputs.distro-slug }}
## DGM
## DGM this can be removed since using GitHub shared runners, and it should just close when done with it
sleep 2 sleep 2
- name: Set Exit Status - name: Set Exit Status

View file

@ -28,12 +28,12 @@ on:
default: 20 default: 20
description: The timeout(in minutes) for the workflow description: The timeout(in minutes) for the workflow
## DGM env: env:
## DGM machine_user: kitchen machine_user: kitchen
## DGM machine_pass: Password1 machine_pass: Password1
## DGM machine_port: 5985 machine_port: 5985
## DGM KITCHEN_LOCAL_YAML: 'kitchen.windows.yml' KITCHEN_LOCAL_YAML: 'kitchen.windows.yml'
## DGM
## DGM Wonder what the KITCHEN_LOCAL_YAML had to be set here for Windows, do we need to do something similar for runners ? ## DGM Wonder what the KITCHEN_LOCAL_YAML had to be set here for Windows, do we need to do something similar for runners ?
jobs: jobs:
@ -53,7 +53,8 @@ jobs:
- name: Setup Ruby - name: Setup Ruby
uses: ruby/setup-ruby@v1 uses: ruby/setup-ruby@v1
with: with:
ruby-version: 3.2.3 ## DGM ruby-version: 3.2.3
ruby-version: 2.6.10
bundler-cache: true bundler-cache: true
- name: Install Chef - name: Install Chef
@ -82,10 +83,10 @@ jobs:
winrm set winrm/config/service '@{AllowUnencrypted="True"}' winrm set winrm/config/service '@{AllowUnencrypted="True"}'
env env
- name: Set up Python 3.10 - name: Set up Python 3.9
uses: actions/setup-python@v4 uses: actions/setup-python@v4
with: with:
python-version: "3.10" python-version: 3.9
- name: Install Python Dependencies - name: Install Python Dependencies
run: | run: |
@ -94,25 +95,19 @@ jobs:
- name: Create Test Instance - name: Create Test Instance
run: | run: |
## DGM bundle exec kitchen create ${{ matrix.instance }}-${{ inputs.distro-slug }} bundle exec kitchen create ${{ matrix.instance }}-${{ inputs.distro-slug }}
## DGM
## DGM Need to select a GitHub runner here , ubuntu-latest
sleep 2 sleep 2
- name: Test Bootstrap - name: Test Bootstrap
run: | run: |
## DGM env env
## DGM bundle exec kitchen verify ${{ matrix.instance }}-${{ inputs.distro-slug }} bundle exec kitchen verify ${{ matrix.instance }}-${{ inputs.distro-slug }}
## DGM
## DGM Need to run the bootstrap tests for Windows here
sleep 2 sleep 2
- name: Destroy Test Instance - name: Destroy Test Instance
if: always() if: always()
run: | run: |
## DGM bundle exec kitchen destroy ${{ matrix.instance }}-${{ inputs.distro-slug }} bundle exec kitchen destroy ${{ matrix.instance }}-${{ inputs.distro-slug }}
## DGM
## DGM this can be removed since using GitHub shared runners, and it should just close when done with it
sleep 2 sleep 2
- name: Set Exit Status - name: Set Exit Status

View file

@ -37,12 +37,19 @@ repos:
args: args:
- requirements/release.in - requirements/release.in
## DGM - repo: https://github.com/asottile/pyupgrade
## DGM rev: v3.15.0
## DGM hooks:
## DGM - id: pyupgrade
## DGM name: Rewrite Code to be Py3.10+
## DGM args: [--py310-plus]
- repo: https://github.com/asottile/pyupgrade - repo: https://github.com/asottile/pyupgrade
rev: v3.15.0 rev: v3.15.0
hooks: hooks:
- id: pyupgrade - id: pyupgrade
name: Rewrite Code to be Py3.10+ name: Rewrite Code to be Py3.9+
args: [--py310-plus] args: [--py39-plus]
- repo: https://github.com/asottile/reorder_python_imports - repo: https://github.com/asottile/reorder_python_imports
rev: v3.12.0 rev: v3.12.0

View file

@ -2,7 +2,8 @@
## What's Changed ## What's Changed
- Removed support for Ruby, Kitchen and kitchen-salt and it's associated utilities ## DGM - Removed support for Ruby, Kitchen and kitchen-salt and it's associated utilities
- Migrated to using GitHub Actions - Migrated to using GitHub Actions
- Removed support of End-Of-Life OS's, for example: Debian 7, 8, 9 & 10, RHEL 7 - Removed support of End-Of-Life OS's, for example: Debian 7, 8, 9 & 10, RHEL 7
- Removed support for FreeBSD and OpenBSD - Removed support for FreeBSD and OpenBSD

11
Gemfile Normal file
View file

@ -0,0 +1,11 @@
# frozen_string_literal: true
source "https://rubygems.org"
gem 'test-kitchen', '>= 3.2.2'
gem 'kitchen-salt', '>= 0.7.2'
gem 'kitchen-docker', :git => 'https://github.com/test-kitchen/kitchen-docker.git', :branch => 'main'
group :vagrant do
gem 'kitchen-vagrant'
end

42
kitchen.macos.yml Normal file
View file

@ -0,0 +1,42 @@
---
driver:
name: exec
provisioner:
sudo: true
salt_bootstrap_options: -MP stable %s
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
brew install coreutils
sh -c 't=$(gshuf -i 1-15 -n 1); echo Sleeping $t seconds; sleep $t'
platforms:
- name: macos-12
- name: macos-13
suites:
- name: stable-3006
provisioner:
salt_version: 3006
salt_call_command: /opt/salt/salt-call
- name: stable-3006-8
provisioner:
salt_version: 3006.8
salt_call_command: /opt/salt/salt-call
- name: stable-3007
provisioner:
salt_version: 3007
salt_call_command: /opt/salt/salt-call
- name: stable-3007-1
provisioner:
salt_version: 3007.1
salt_call_command: /opt/salt/salt-call
- name: latest
provisioner:
salt_version: latest
salt_call_command: /opt/salt/salt-call
verifier:
command: pytest --cache-clear -v -s -ra --log-cli-level=debug -k "not test_ping" tests/integration/

42
kitchen.windows.yml Normal file
View file

@ -0,0 +1,42 @@
---
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: -Version %s -Verbose
init_environment: ''
platforms:
- name: windows-2022
- name: windows-2019
suites:
- name: stable-3006
provisioner:
salt_version: 3006
salt_call_command: c:\Program Files\Salt Project\Salt\salt-call.exe
- name: stable-3006-8
provisioner:
salt_version: 3006.8
salt_call_command: c:\Program Files\Salt Project\Salt\salt-call.exe
- name: stable-3007
provisioner:
salt_version: 3007
salt_call_command: c:\Program Files\Salt Project\Salt\salt-call.exe
- name: stable-3007-1
provisioner:
salt_version: 3007.1
salt_call_command: c:\Program Files\Salt Project\Salt\salt-call.exe
- name: latest
provisioner:
salt_version: latest
salt_call_command: c:\Program Files\Salt Project\Salt\salt-call.exe
verifier:
command: pytest --cache-clear -v -s -ra --log-cli-level=debug -k "not test_ping" tests/integration/

286
kitchen.yml Normal file
View file

@ -0,0 +1,286 @@
---
driver:
name: docker
use_sudo: false
hostname: salt
privileged: true
username: root
cap_add:
- sys_admin
disable_upstart: false
use_internal_docker_network: false
run_command: /usr/lib/systemd/systemd
provisioner:
name: salt_solo
salt_install: bootstrap
salt_bootstrap_url: bootstrap-salt.sh
salt_bootstrap_options: -MPfq git %s
install_after_init_environment: true
log_level: info
sudo: false
require_chef: false
formula: tests
run_salt_call: false
init_environment: |
echo 'auto_accept: true' > /tmp/auto-accept-keys.conf
mkdir -p /etc/salt/master.d
mv /tmp/auto-accept-keys.conf /etc/salt/master.d/auto-accept-keys.conf
sh -c 't=$(shuf -i 1-15 -n 1); echo Sleeping $t seconds; sleep $t'
platforms:
- name: almalinux-9
driver:
provision_command:
- dnf -y install crypto-policies-scripts procps-ng
## DGM - update-crypto-policies --set DEFAULT:SHA1
- update-crypto-policies
- echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config
- name: almalinux-8
- name: amazon-2
driver:
image: amazonlinux:2
platform: rhel
provision_command:
- yum -y install procps-ng
- name: amazon-2023
driver:
image: amazonlinux:2023
platform: fedora
provision_command:
- yum -y install procps-ng
- name: arch
driver:
image: archlinux/archlinux
provision_command:
- pacman -Syu --noconfirm --needed systemd grep awk procps which
- systemctl enable sshd
- echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config
- name: centos-stream9
driver:
platform: centosstream
image: quay.io/centos/centos:stream9
provision_command:
- dnf -y install crypto-policies-scripts procps-ng
## DGM - update-crypto-policies --set DEFAULT:SHA1
- update-crypto-policies
- echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config
- name: centos-stream8
driver:
image: quay.io/centos/centos:stream8
- name: debian-11
driver:
image: debian:bullseye
run_command: /lib/systemd/systemd
- name: debian-12
driver:
image: debian:bookworm
run_command: /lib/systemd/systemd
- name: fedora-39
driver:
provision_command: &fedora_provision_command
- dnf -y install procps-ng crypto-policies-scripts
- update-crypto-policies --set LEGACY
- name: fedora-40
driver:
provision_command: *fedora_provision_command
- name: gentoo
driver:
image: gentoo/stage3:latest
run_command: /sbin/init
provision_command:
- rc-update add sshd default
- echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config
- name: gentoo-systemd
driver:
image: gentoo/stage3:systemd
run_command: /lib/systemd/systemd
provision_command:
- systemctl enable sshd.service
- echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config
- name: opensuse-15
driver:
image: opensuse/leap:15.4
provision_command:
- &opensuse_provision_command_01 zypper --non-interactive install --auto-agree-with-licenses dbus-1
- &opensuse_provision_command_02 zypper --non-interactive install --auto-agree-with-licenses sudo openssh which curl systemd
- &opensuse_provision_command_03 systemctl enable sshd.service
- name: opensuse-tumbleweed
driver:
image: opensuse/tumbleweed:latest
provision_command:
- *opensuse_provision_command_01
- *opensuse_provision_command_02
- *opensuse_provision_command_03
- echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config
- name: rockylinux-9
driver:
platform: centosstream
run_command: /usr/lib/systemd/systemd
provision_command:
- dnf -y install crypto-policies-scripts procps-ng
## DGM - update-crypto-policies --set DEFAULT:SHA1
- update-crypto-policies
- echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config
- name: rockylinux-8
- name: oraclelinux-8
- name: rockylinux-8
- name: ubuntu-22.04
- name: ubuntu-24.04
driver:
run_command: /lib/systemd/systemd
provision_command:
- echo "PubkeyAcceptedAlgorithms +ssh-rsa" | tee -a /etc/ssh/sshd_config
- name: ubuntu-20.04
driver:
run_command: /lib/systemd/systemd
- name: photon-4
driver:
image: photon:4.0
provision_command:
- tdnf -y install rpm procps-ng coreutils gawk
- echo "PubkeyAcceptedKeyTypes +ssh-rsa" | tee -a /etc/ssh/sshd_config
- sed -ie 's/PermitRootLogin no/PermitRootLogin yes/' /etc/ssh/sshd_config
- systemctl enable sshd.service
- name: photon-5
driver:
image: photon:5.0
provision_command:
- tdnf -y install rpm procps-ng coreutils gawk
- echo "PubkeyAcceptedKeyTypes +ssh-rsa" | tee -a /etc/ssh/sshd_config
- sed -ie 's/PermitRootLogin no/PermitRootLogin yes/' /etc/ssh/sshd_config
- systemctl enable sshd.service
suites:
- name: git-3006
provisioner:
salt_version: v3006
salt_bootstrap_options: -x python3 -MPfq git %s
excludes:
- opensuse-15
- opensuse-tumbleweed
- debian-11
- arch
- gentoo
- gentoo-systemd
- name: git-3006x
provisioner:
salt_version: 3006.x
salt_bootstrap_options: -x python3 -MPfq git %s
excludes:
- opensuse-15
- opensuse-tumbleweed
- debian-11
- arch
- gentoo
- gentoo-systemd
- name: git-3007
provisioner:
salt_version: v3007
salt_bootstrap_options: -x python3 -MPfq git %s
excludes:
- opensuse-15
- opensuse-tumbleweed
- debian-11
- arch
- gentoo
- gentoo-systemd
- name: git-3007x
provisioner:
salt_version: 3007.x
salt_bootstrap_options: -x python3 -MPfq git %s
excludes:
- opensuse-15
- opensuse-tumbleweed
- debian-11
- arch
- gentoo
- gentoo-systemd
- name: stable-3006
provisioner:
salt_version: 3006
salt_bootstrap_options: -x python3 -MP stable %s
excludes:
- opensuse-15
- opensuse-tumbleweed
- arch
- name: stable-3006-8
provisioner:
salt_version: 3006.8
salt_bootstrap_options: -x python3 -MP stable %s
excludes:
- opensuse-15
- opensuse-tumbleweed
- arch
- name: stable-3007
provisioner:
salt_version: 3007
salt_bootstrap_options: -x python3 -MP stable %s
excludes:
- opensuse-15
- opensuse-tumbleweed
- arch
- name: stable-3007-1
provisioner:
salt_version: 3007.1
salt_bootstrap_options: -x python3 -MP stable %s
excludes:
- opensuse-15
- opensuse-tumbleweed
- arch
- name: git-master
provisioner:
salt_version: master
salt_bootstrap_options: -x python3 -MPfq -D git %s
- name: latest
provisioner:
salt_version: latest
salt_bootstrap_options: -MP stable %s
- name: default
provisioner:
salt_version: latest
salt_bootstrap_options: -MP
- name: onedir-nightly
provisioner:
salt_version: nightly
salt_bootstrap_options: -MP onedir %s
- name: onedir-latest
provisioner:
salt_version: latest
salt_bootstrap_options: -MP onedir %s
- name: onedir-3006
provisioner:
salt_version: 3006
salt_bootstrap_options: -MP onedir %s
- name: onedir-3007
provisioner:
salt_version: 3007
salt_bootstrap_options: -MP onedir %s
- name: onedir-rc-3008-0rc1
provisioner:
salt_version: 3008.0rc1
salt_bootstrap_options: -R staging.repo.saltproject.io -MP onedir_rc %s
excludes:
- arch
- gentoo
- opensuse-15
- opensuse-tumbleweed
- ubuntu-2004
- ubuntu-2204
- name: quickstart
provisioner:
salt_bootstrap_options: -Q
verifier:
name: shell
remote_exec: false
command: pytest --cache-clear -v -s -ra --log-cli-level=info tests/integration/