Skip to content

Commit

Permalink
Check port state in PTP tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mlichvar authored and richm committed Nov 8, 2021
1 parent 134e7ac commit 58fe170
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 3 deletions.
20 changes: 18 additions & 2 deletions tests/tests_ptp_multi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,23 +42,39 @@

- name: Run pmc
# yamllint disable-line rule:line-length
command: pmc -u -b 0 -d 0 -s /var/run/timemaster/ptp4l.0.socket 'GET DOMAIN'
command: pmc -u -b 0 -d 0 -s /var/run/timemaster/ptp4l.0.socket 'GET DOMAIN' 'GET PORT_DATA_SET'
register: pmc

- name: Check PTP domain
assert:
that:
- "'domainNumber 0' in pmc.stdout"

- name: Check PTP port state
assert:
that:
- pmc.stdout is search("portState\s+LISTENING")
when:
- ansible_distribution not in ['RedHat', 'CentOS'] or
ansible_distribution_version is not version('8.3', '<')

- name: Run pmc
# yamllint disable-line rule:line-length
command: pmc -u -b 0 -d 1 -s /var/run/timemaster/ptp4l.1.socket 'GET DOMAIN'
command: pmc -u -b 0 -d 1 -s /var/run/timemaster/ptp4l.1.socket 'GET DOMAIN' 'GET PORT_DATA_SET'
register: pmc

- name: Check PTP domain
assert:
that:
- "'domainNumber 1' in pmc.stdout"

- name: Check PTP port state
assert:
that:
- pmc.stdout is search("portState\s+LISTENING")
when:
- ansible_distribution not in ['RedHat', 'CentOS'] or
ansible_distribution_version is not version('8.3', '<')

when: "'SOF_TIMESTAMPING_TX_' in ethtool.stdout"
tags: tests::verify
10 changes: 9 additions & 1 deletion tests/tests_ptp_single.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,21 @@
timeout: 2

- name: Run pmc
command: pmc -u -b 0 -d 3 'GET DOMAIN'
command: pmc -u -b 0 -d 3 'GET DOMAIN' 'GET PORT_DATA_SET'
register: pmc

- name: Check PTP domain
assert:
that:
- "'domainNumber 3' in pmc.stdout"

- name: Check PTP port state
assert:
that:
- pmc.stdout is search("portState\s+LISTENING")
when:
- ansible_distribution not in ['RedHat', 'CentOS'] or
ansible_distribution_version is not version('8.3', '<')

when: "'SOF_TIMESTAMPING_TX_' in ethtool.stdout"
tags: tests::verify

0 comments on commit 58fe170

Please sign in to comment.