Skip to content

Commit

Permalink
adds teap playbooks
Browse files Browse the repository at this point in the history
  • Loading branch information
stgmsa committed Mar 6, 2025
1 parent 7dd7e25 commit 698c82d
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 0 deletions.
44 changes: 44 additions & 0 deletions t/venom/scenarios/dot1x_eap_teap/playbooks/configure.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
- hosts: pfservers
name: configure Packetfence VM
become: True

vars:
debianPackages:
- curl
- python3-pip
- virtualenv
- jq

el8Packages:
- curl
- python3-pip
- python3-setuptools
- virtualenv
- jq

tasks:
- name: Install packages on debian
package:
name: "{{ debianPackages }}"
state: present
when: ansible_facts['os_family'] == "Debian"

- name: Install packages on el8
package:
name: "{{ el8Packages }}"
state: present
when: ansible_facts['os_family'] == "RedHat"

- name: Install xmltodict python package
pip:
name: xmltodict
when: ansible_facts['os_family'] == "RedHat"

- name: Install xmltodict python package
shell: |
set -e -o pipefail
pip install xmltodict --break-system-packages
args:
executable: /usr/bin/bash
when: ansible_facts['os_family'] == "Debian"
31 changes: 31 additions & 0 deletions t/venom/scenarios/dot1x_eap_teap/playbooks/run_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
- hosts: pfservers
name: Run dot1x_eap_teap tests
become: True

vars:
test_suites:
- configurator
- global_config
- wired_dot1x_eap_teap
- wired_dot1x_eap_teap/teardown
- global_teardown

tasks:
- name: Run Venom testsuites
command: '{{ venom_dir }}/venom-wrapper.sh {{ venom_dir }}/test_suites/{{ item }}'
args:
chdir: '{{ venom_dir }}'
loop: '{{ test_suites }}'
vars:
venom_wrapper_args:
# temp, overcome Venom issue:
# - when running test suite one by one, previous logs and results are overriden
# Venom will create one directory per test suite to store results
VENOM_COMMON_FLAGS: '--output-dir={{ venom_dir }}/results/{{ item }}
--var test_suite_results_dir={{ venom_dir }}/results/{{ item }}'

# add inventory__group_environment to Ansible environment
# useful to make env vars available for Venom
environment: '{{ inventory__group_environment | d({})
| combine(venom_wrapper_args | d({})) }}'
12 changes: 12 additions & 0 deletions t/venom/scenarios/dot1x_eap_teap/site.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
# Development environnement
## rsync before tests when doing local development
## preinstall vim
## fix term
- import_playbook: ../common/dev.yml
when: lookup("env", "CI") != 'true'

# Add extra configuration before running venom tests
- import_playbook: playbooks/configure.yml

- import_playbook: playbooks/run_tests.yml

0 comments on commit 698c82d

Please sign in to comment.