Skip to content

Commit 3216684

Browse files
authored
[service_acl] Make test reliable when testing Arista service ACL solution (#542)
1 parent d334a41 commit 3216684

2 files changed

Lines changed: 12 additions & 7 deletions

File tree

ansible/roles/test/files/helpers/config_service_acls.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ EOF
7575
# Install the new service ACLs
7676
acl-loader update full /tmp/testacl.json
7777

78-
# Sleep to allow Ansible playbook to attmept to connect and timeout
79-
sleep 30
78+
# Sleep to allow Ansible playbook ample time to attempt to connect and timeout
79+
sleep 60
8080

8181
# Delete the test ACL config file
8282
rm -rf /tmp/testacl.json

ansible/roles/test/tasks/service_acl.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,20 @@
2828
become: true
2929
shell: "nohup /tmp/config_service_acls.sh < /dev/null > /dev/null 2>&1 &"
3030

31-
# Note that the timeout here should be sufficiently long enough to allow
32-
# config_service_acls.sh to apply the new service ACLs
31+
- name: Sleep a bit to allow config_service_acls.sh to apply the new service ACLs
32+
pause:
33+
seconds: 5
34+
3335
- name: Ensure the SSH port on the DuT becomes closed to us
3436
local_action: wait_for
3537
args:
3638
host: "{{ ansible_host }}"
3739
port: 22
38-
state: stopped
39-
timeout: 15
40+
state: started
41+
search_regex: "OpenSSH"
42+
timeout: 10
43+
register: result
44+
failed_when: "'Timeout when waiting for search string OpenSSH' not in result.msg"
4045

4146
# Gather facts with SNMP version 2
4247
- name: Ensure attempt to gather basic SNMP facts about the device now times out
@@ -57,7 +62,7 @@
5762
port: 22
5863
state: started
5964
search_regex: "OpenSSH"
60-
timeout: 60
65+
timeout: 90
6166

6267
- name: Delete config_service_acls.sh from the DuT
6368
become: true

0 commit comments

Comments
 (0)