Skip to content

Commit

Permalink
Merge branch '15.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
chkpnt committed Apr 21, 2024
2 parents 6ba49fc + c55352f commit 91598ff
Show file tree
Hide file tree
Showing 68 changed files with 1,503 additions and 1,609 deletions.
3 changes: 3 additions & 0 deletions .ansible-lint
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
exclude_paths:
- tests
10 changes: 5 additions & 5 deletions .github/workflows/check-markdown-links.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
---
name: Check Markdown links

on:
push:
workflow_dispatch:

jobs:
markdown-link-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: gaurav-nelson/github-action-markdown-link-check@v1
with:
use-verbose-mode: 'yes'
- uses: actions/checkout@v3
- uses: gaurav-nelson/github-action-markdown-link-check@v1
with:
use-verbose-mode: yes
133 changes: 67 additions & 66 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -1,85 +1,86 @@
name: Run tests against latest openSUSE Leap 15.4
---
name: Run tests against latest openSUSE Leap 15.5

on:
on:
push:
workflow_dispatch:
schedule:
- cron: '0 13 * * 0'
- cron: "0 13 * * 0"

jobs:
run-tests:
runs-on: macos-12
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v3

- name: Download current box metadata needed for GitHub cache key
run: |
BOX_URL=$(cat tests/Vagrantfile | sed -n -E 's/.*config\.vm\.box_url = "([^"]*).*/\1/p')
wget -O tests/opensuse.json "${BOX_URL}"
- name: Download current box metadata needed for GitHub cache key
run: |
BOX_URL=$(cat tests/Vagrantfile | sed -n -E 's/.*config\.vm\.box_url = "([^"]*).*/\1/p')
wget -O tests/opensuse.json "${BOX_URL}"
- name: Cache Vagrant boxes
uses: actions/cache@v3
with:
path: ~/.vagrant.d/boxes
key: ${{ runner.os }}-vagrant-${{ hashFiles('tests/opensuse.json') }}

- name: Show Vagrant version
run: vagrant --version
- name: Cache Vagrant boxes
uses: actions/cache@v3
with:
path: ~/.vagrant.d/boxes
key: ${{ runner.os }}-vagrant-${{ hashFiles('tests/opensuse.json') }}

- name: Use Python 3.x
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Show Vagrant version
run: vagrant --version

- name: Install pipenv
run: pip install pipenv
- name: Use Python 3.x
uses: actions/setup-python@v4
with:
python-version: 3.x

- name: Cache pipenv environment
id: cache-pipenv
uses: actions/cache@v3
with:
path: ~/.local/share/virtualenvs
key: ${{ runner.os }}-pipenv-${{ hashFiles('**/Pipfile.lock') }}
- name: Install pipenv
run: pip install pipenv

- name: Install required (and locked) dependecies with pipenv
if: steps.cache-pipenv.outputs.cache-hit != 'true'
run: pipenv install --dev
- name: Cache pipenv environment
id: cache-pipenv
uses: actions/cache@v3
with:
path: ~/.local/share/virtualenvs
key: ${{ runner.os }}-pipenv-${{ hashFiles('**/Pipfile.lock') }}

# Setting env variables as "pipenv run make -j2 setup" doesn't terminate
- name: Enable pipenv environment
run: |
echo "VIRTUAL_ENV=$(pipenv --venv)" >> $GITHUB_ENV
echo "$(pipenv --venv)/bin" >> $GITHUB_PATH
- name: Print environment variables
run: export
- name: Install required (and locked) dependecies with pipenv
if: steps.cache-pipenv.outputs.cache-hit != 'true'
run: pipenv install --dev

- name: Ensure to use the latest boxes
run: vagrant box update
working-directory: tests
# Setting env variables as "pipenv run make -j2 setup" doesn't terminate
- name: Enable pipenv environment
run: |
echo "VIRTUAL_ENV=$(pipenv --venv)" >> $GITHUB_ENV
echo "$(pipenv --venv)/bin" >> $GITHUB_PATH
- name: Prepare Vagrant test environment
run: make -j setup
working-directory: tests

- name: Run tests
run: make -k tests
working-directory: tests
- name: Print environment variables
run: export

- name: Gather facts
run: |
pip list
vagrant ssh -c "ip addr show" ns
vagrant ssh -c "ip addr show" sut
vagrant ssh -c "ip addr show" client
vagrant ssh -c "ip addr show" mail-sink
vagrant ssh -c "dig mydomain.test MX" client
vagrant ssh -c "ping -c 3 192.168.56.10" client
vagrant ssh -c "sudo journalctl --no-pager -n 50 -u named" ns
vagrant ssh -c "systemctl --no-page list-units --type=service" sut
vagrant ssh -c "sudo journalctl --no-pager -n 50 -u clamd" sut
vagrant ssh -c "sudo journalctl --no-pager -n 50 -u postfix" sut
vagrant ssh -c "sudo journalctl --no-pager -n 50 -u rspamd" sut
vagrant ssh -c "sudo journalctl --no-pager -n 50 -u dovecot" sut
working-directory: tests
- name: Ensure to use the latest boxes
run: vagrant box update
working-directory: tests

- name: Prepare Vagrant test environment
run: make -j setup
working-directory: tests

- name: Run tests
run: make -k tests
working-directory: tests

- name: Gather facts
run: |
pip list
vagrant ssh -c "ip addr show" ns
vagrant ssh -c "ip addr show" sut
vagrant ssh -c "ip addr show" client
vagrant ssh -c "ip addr show" mail-sink
vagrant ssh -c "dig mydomain.test MX" client
vagrant ssh -c "ping -c 3 192.168.56.10" client
vagrant ssh -c "sudo journalctl --no-pager -n 50 -u named" ns
vagrant ssh -c "systemctl --no-page list-units --type=service" sut
vagrant ssh -c "sudo journalctl --no-pager -n 50 -u clamd" sut
vagrant ssh -c "sudo journalctl --no-pager -n 50 -u postfix" sut
vagrant ssh -c "sudo journalctl --no-pager -n 50 -u rspamd" sut
vagrant ssh -c "sudo journalctl --no-pager -n 50 -u dovecot" sut
working-directory: tests
75 changes: 37 additions & 38 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,56 +7,55 @@ python:
# Cache the big Vagrant boxes
cache:
directories:
- /home/travis/.vagrant.d/boxes
- /home/travis/.vagrant.d/boxes

install:
# Install libvrt & KVM (see https://github.com/alvistack/ansible-role-virtualbox/blob/master/.travis.yml)
- sudo apt-get update && sudo apt-get install -y bridge-utils dnsmasq-base ebtables libvirt-bin libvirt-dev qemu-kvm qemu-utils ruby-dev
# Install libvrt & KVM (see https://github.com/alvistack/ansible-role-virtualbox/blob/master/.travis.yml)
- sudo apt-get update && sudo apt-get install -y bridge-utils dnsmasq-base ebtables libvirt-bin libvirt-dev qemu-kvm qemu-utils ruby-dev

# Unfortunately, newgrp doens't work, as travis-ci will hang
#- sudo adduser travis libvirt
#- newgrp libvrt
- sudo chmod o+rwx /var/run/libvirt/libvirt-sock
# Unfortunately, newgrp doens't work, as travis-ci will hang
#- sudo adduser travis libvirt
#- newgrp libvrt
- sudo chmod o+rwx /var/run/libvirt/libvirt-sock

# Download Vagrant & Install Vagrant package
- sudo wget -nv https://releases.hashicorp.com/vagrant/2.2.14/vagrant_2.2.14_x86_64.deb
- sudo dpkg -i vagrant_2.2.14_x86_64.deb
# Download Vagrant & Install Vagrant package
- sudo wget -nv https://releases.hashicorp.com/vagrant/2.2.14/vagrant_2.2.14_x86_64.deb
- sudo dpkg -i vagrant_2.2.14_x86_64.deb

# Vagrant correctly installed?
- vagrant --version
# Vagrant correctly installed?
- vagrant --version

# Install vagrant-libvirt Vagrant plugin
- vagrant plugin install vagrant-libvirt
- find ~/.vagrant.d/gems/
# Install vagrant-libvirt Vagrant plugin
- vagrant plugin install vagrant-libvirt
- find ~/.vagrant.d/gems/

# Install required (and locked) dependecies with pipenv
- pip install pipenv
- pipenv install --dev
# Install required (and locked) dependecies with pipenv
- pip install pipenv
- pipenv install --dev

before_script:
- cd tests
- vagrant box update
- make -j -e PROVIDER=libvirt setup
- cd tests
- vagrant box update
- make -j -e PROVIDER=libvirt setup

script:
- make -k tests
- make -k tests

after_failure:
# Some useful information in case the tests fail
- pip list
- vagrant ssh -c "ip addr show" ns
- vagrant ssh -c "ip addr show" sut
- vagrant ssh -c "ip addr show" client
- vagrant ssh -c "ip addr show" mail-sink
- vagrant ssh -c "dig mydomain.test MX" client
- vagrant ssh -c "ping -c 3 192.168.56.10" client
- vagrant ssh -c "sudo journalctl --no-pager -n 50 -u named" ns
- vagrant ssh -c "systemctl --no-page list-units --type=service" sut
- vagrant ssh -c "sudo journalctl --no-pager -n 50 -u clamd" sut
- vagrant ssh -c "sudo journalctl --no-pager -n 50 -u postfix" sut
- vagrant ssh -c "sudo journalctl --no-pager -n 50 -u rspamd" sut
- vagrant ssh -c "sudo journalctl --no-pager -n 50 -u dovecot" sut

# Some useful information in case the tests fail
- pip list
- vagrant ssh -c "ip addr show" ns
- vagrant ssh -c "ip addr show" sut
- vagrant ssh -c "ip addr show" client
- vagrant ssh -c "ip addr show" mail-sink
- vagrant ssh -c "dig mydomain.test MX" client
- vagrant ssh -c "ping -c 3 192.168.56.10" client
- vagrant ssh -c "sudo journalctl --no-pager -n 50 -u named" ns
- vagrant ssh -c "systemctl --no-page list-units --type=service" sut
- vagrant ssh -c "sudo journalctl --no-pager -n 50 -u clamd" sut
- vagrant ssh -c "sudo journalctl --no-pager -n 50 -u postfix" sut
- vagrant ssh -c "sudo journalctl --no-pager -n 50 -u rspamd" sut
- vagrant ssh -c "sudo journalctl --no-pager -n 50 -u dovecot" sut

# Mmh.... don't know yet how to deal with copyright notice when using
# open sourced code snippets and where to put the license header.
Expand Down Expand Up @@ -84,4 +83,4 @@ after_failure:
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
# SOFTWARE.
14 changes: 7 additions & 7 deletions .yamllint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@
extends: default

rules:
braces: {max-spaces-inside: 1, level: error}
brackets: {max-spaces-inside: 1, level: error}
colons: {max-spaces-after: -1, level: error}
commas: {max-spaces-after: -1, level: error}
braces: { max-spaces-inside: 1, level: error }
brackets: { max-spaces-inside: 1, level: error }
colons: { max-spaces-after: -1, level: error }
commas: { max-spaces-after: -1, level: error }
comments: disable
comments-indentation: disable
document-start: disable
empty-lines: {max: 3, level: error}
hyphens: {level: error}
empty-lines: { max: 3, level: error }
hyphens: { level: error }
indentation: disable
key-duplicates: enable
line-length: disable
new-line-at-end-of-file: disable
new-lines: {type: unix}
new-lines: { type: unix }
trailing-spaces: disable
truthy: disable
12 changes: 6 additions & 6 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ url = "https://pypi.org/simple"
verify_ssl = true

[dev-packages]
ansible-lint = "*"
yamllint = "*"
pytest = "*"
ansible-lint = "==24.2.1"
yamllint = "==1.35.1"
pytest = "==8.1.1"

[packages]
ansible = "~=4.8"
jmespath = "*"
ansible = "==9.4.0"
jmespath = "==1.0.1"

[requires]
python_version = "3.11"
python_version = "3"

0 comments on commit 91598ff

Please sign in to comment.