Skip to content

Commit

Permalink
Merge pull request #7421 from inverse-inc/fix/venom-stability
Browse files Browse the repository at this point in the history
Fix/venom stability
  • Loading branch information
nqb authored Dec 13, 2022
2 parents c514bf5 + bdbb2bb commit 9dee893
Show file tree
Hide file tree
Showing 53 changed files with 208 additions and 435 deletions.
1 change: 1 addition & 0 deletions t/venom/lib/pf_api_action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,4 @@ output:
pf_api_action__node_unregdate: "{{.http_json.item.unregdate}}"
pf_api_action__node_security_event_id: "{{.http_json.items.items0.security_event_id}}"
pf_api_action__items: "{{.http_json.items}}"
pf_api_action__token: "{{.result.token}}"
4 changes: 2 additions & 2 deletions t/venom/lib/pf_api_domain_join.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ input:
id: ""
username: ""
password: ""
i_retry: 24
i_delay: 5
i_retry: 40
i_delay: 3
steps:
- type: pf_api_domain_action
method: POST
Expand Down
4 changes: 2 additions & 2 deletions t/venom/lib/pf_api_domain_unjoin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ input:
id: ""
username: ""
password: ""
i_retry: 24
i_delay: 5
i_retry: 40
i_delay: 3
steps:
- type: pf_api_domain_action
method: POST
Expand Down
4 changes: 2 additions & 2 deletions t/venom/lib/pf_api_poll.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ input:
i_task_id: ""
i_message: "Completed"
i_progress: 100
i_retry: 24
i_delay: 5
i_retry: 40
i_delay: 3
steps:
- type: pf_api_action
url: "pfqueue/task/{{.input.i_task_id}}/status/poll"
Expand Down
21 changes: 21 additions & 0 deletions t/venom/lib/pf_api_service_pf_start_async.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
executor: pf_api_service_pf_start_async
steps:
- type: pf_api_service_action
service: "pf"
action: "start"
method: POST
time_to_sleep: "0"
status_code: 202
body: >-
{
"async": "true"
}
# radiusd-auth is a service with a lot of service dependencies
# so, one of the lastest vital services to start
- type: pf_api_service_status
service: "radiusd-auth"
retry: 600
delay: 3
assertions:
- result.pf_api_service_status_json.alive ShouldEqual 1
2 changes: 2 additions & 0 deletions t/venom/lib/pf_api_service_restart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,7 @@ steps:

- type: pf_api_service_status
service: "{{.input.service}}"
retry: 40
delay: 3
assertions:
- result.pf_api_service_status_json.alive ShouldEqual 1
4 changes: 2 additions & 2 deletions t/venom/lib/pf_api_service_restart_async.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ executor: pf_api_service_restart_async
input:
service: ""
time_to_sleep: 0
i_retry: 24
i_delay: 5
i_retry: 40
i_delay: 3
time_to_sleep_before_status: 0
steps:
- type: pf_api_service_action
Expand Down
2 changes: 2 additions & 0 deletions t/venom/lib/pf_api_service_start.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,7 @@ steps:

- type: pf_api_service_status
service: "{{.input.service}}"
retry: 40
delay: 3
assertions:
- result.pf_api_service_status_json.alive ShouldEqual 1
4 changes: 2 additions & 2 deletions t/venom/lib/pf_api_service_start_async.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ executor: pf_api_service_start_async
input:
service: ""
time_to_sleep: 0
i_retry: 24
i_delay: 5
i_retry: 40
i_delay: 3
steps:
- type: pf_api_service_action
service: "{{.input.service}}"
Expand Down
2 changes: 2 additions & 0 deletions t/venom/lib/pf_api_service_stop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,7 @@ steps:

- type: pf_api_service_status
service: "{{.input.service}}"
retry: 40
delay: 3
assertions:
- result.pf_api_service_status_json.pid ShouldEqual 0
4 changes: 2 additions & 2 deletions t/venom/lib/pf_api_system_service_restart_async.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ executor: pf_api_system_service_restart_async
input:
service: ""
time_to_sleep: 0
i_retry: 24
i_delay: 5
i_retry: 40
i_delay: 3
steps:
- type: pf_api_system_service_action
service: "{{.input.service}}"
Expand Down
14 changes: 11 additions & 3 deletions t/venom/lib/systemctl_service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,16 @@ input:
steps:
- type: exec
script: '{{.input.sudo}} systemctl {{.input.unit_command}} {{.input.service}}'
# TO BE REMOVE IF DEFAULT IF ENOUGH
#assertions:
# - result.systemout ShouldContainSubstring "
vars:
status_lines:
from: result.systemout

- type: exec
script: echo -n '{{.status_lines}}' | sed -nr 's/.*(Loaded.*Memory).*/\1/p'
vars:
first_lines:
from: result.systemout

output:
service_systemout: "{{.result.systemout}}"
service_first_lines: "{{.first_lines}}"
2 changes: 1 addition & 1 deletion t/venom/lib/systemctl_service_restart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ executor: systemctl_service_restart
input:
service: ""
time_to_sleep: 0
sudo: ""
sudo: "sudo"
steps:
# service restarted by hand because using API cause Venom failure (EOF)
- type: systemctl_service
Expand Down
6 changes: 5 additions & 1 deletion t/venom/lib/systemctl_service_status.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@ input:
service: ""
sudo: ""
substring: "active (running)"
i_retry: 40
i_delay: 3
steps:
- type: systemctl_service
unit_command: status
service: "{{.input.service}}"
sudo: "{{.input.sudo}}"
retry: "{{.input.i_retry}}"
delay: "{{.input.i_delay}}"
assertions:
- result.service_systemout ShouldContainSubstring '{{.input.substring}}'
- result.service_first_lines ShouldContainSubstring '{{.input.substring}}'
output:
service_status_systemout: "{{.result.service_systemout}}"
18 changes: 0 additions & 18 deletions t/venom/scenarios/captive_portal/playbooks/rsync.yml

This file was deleted.

10 changes: 6 additions & 4 deletions t/venom/scenarios/captive_portal/site.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
---
# - import_playbook: playbooks/provision.yml

# rsync before tests when doing local development
- import_playbook: playbooks/rsync.yml
# 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
18 changes: 0 additions & 18 deletions t/venom/scenarios/cli_login/playbooks/rsync.yml

This file was deleted.

10 changes: 6 additions & 4 deletions t/venom/scenarios/cli_login/site.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
---
# - import_playbook: playbooks/provision.yml

# rsync before tests when doing local development
- import_playbook: playbooks/rsync.yml
# 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
18 changes: 0 additions & 18 deletions t/venom/scenarios/cluster/playbooks/rsync.yml

This file was deleted.

10 changes: 6 additions & 4 deletions t/venom/scenarios/cluster/site.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
---
# - import_playbook: playbooks/provision.yml

# rsync before tests when doing local development
- import_playbook: playbooks/rsync.yml
# 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
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,21 @@
rsync_opts:
- "--exclude=vars/local.yml"

- name: Synchronize Git repository t/mock_servers with /usr/local/pf/t/mock_servers
ansible.posix.synchronize:
# src is provided through test-wrapper.sh
# as $PWD/venom (no leading slash)
src: "{{ lookup('env', 'VENOM_ROOT_DIR') }}/../mock_servers"
dest: '/usr/local/pf/t/'
archive: yes
delete: yes
# exclude files dynamically generated by Ansible
rsync_opts:
- "--exclude=vars/local.yml"
- name: Set users term linux
ansible.builtin.lineinfile:
path: /etc/environment
regexp: '^TERM='
line: TERM=linux
when: ansible_facts['os_family'] == "Debian"

- name: Set root term linux
ansible.builtin.lineinfile:
path: /root/.profile
regexp: '^export TERM='
line: export TERM=linux
when: ansible_facts['os_family'] == "Debian"

- name: Add vim
ansible.builtin.package:
name: vim
state: present
18 changes: 0 additions & 18 deletions t/venom/scenarios/configurator/playbooks/rsync.yml

This file was deleted.

10 changes: 6 additions & 4 deletions t/venom/scenarios/configurator/site.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
---
# - import_playbook: playbooks/provision.yml

# rsync before tests when doing local development
- import_playbook: playbooks/rsync.yml
# 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
10 changes: 6 additions & 4 deletions t/venom/scenarios/dot1x_eap_peap/site.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
---
# - import_playbook: playbooks/provision.yml

# rsync before tests when doing local development
- import_playbook: playbooks/rsync.yml
# 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
18 changes: 0 additions & 18 deletions t/venom/scenarios/dot1x_eap_tls/playbooks/rsync.yml

This file was deleted.

10 changes: 6 additions & 4 deletions t/venom/scenarios/dot1x_eap_tls/site.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
---
# - import_playbook: playbooks/provision.yml

# rsync before tests when doing local development
- import_playbook: playbooks/rsync.yml
# 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
Loading

0 comments on commit 9dee893

Please sign in to comment.