Rename files to be valid python identifiers

This commit is contained in:
Jack Adolph 2020-04-21 13:23:44 +10:00 committed by Till Maas
parent 330729c6dd
commit 97129717a5
33 changed files with 73 additions and 74 deletions

View file

@ -33,10 +33,10 @@ call_ansible() {
remote_coverage_dir="$(mktemp -d /tmp/remote_coverage-XXXXXX)"
trap "rm -rf '${remote_coverage_dir}'" EXIT
ansible-playbook -i "${host}", get-coverage.yml -e "test_playbook=${playbook} destdir=${remote_coverage_dir}"
ansible-playbook -i "${host}", get_coverage.yml -e "test_playbook=${playbook} destdir=${remote_coverage_dir}"
#COVERAGE_FILE=remote-coverage coverage combine remote-coverage/tests_*/*/root/.coverage
./merge-coverage.sh coverage "${coverage_data}"-tmp $(find "${remote_coverage_dir}" -type f | tr , _)
./merge_coverage.sh coverage "${coverage_data}"-tmp $(find "${remote_coverage_dir}" -type f | tr , _)
cat > tmp_merge_coveragerc <<EOF
[paths]

View file

@ -20,13 +20,13 @@ tox -e py26,py27,py36,py37 -- --cov-append
for test_playbook in tests_*.yml
do
./get-coverage.sh "${testhost}" "${test_playbook}"
./get_coverage.sh "${testhost}" "${test_playbook}"
done
./merge-coverage.sh coverage "total-remote-coveragedata" remote-coveragedata-*
./merge_coverage.sh coverage "total-remote-coveragedata" remote-coveragedata-*
./covstats .coverage remote-coveragedata-* "total-remote-coveragedata"
./merge-coverage.sh coverage "${coverage_data}" .coverage remote-coveragedata-*
./merge_coverage.sh coverage "${coverage_data}" .coverage remote-coveragedata-*
echo "Total coverage:"
COVERAGE_FILE="${coverage_data}" coverage report ||:
COVERAGE_FILE="${coverage_data}" coverage html --directory "htmlcov-${coverage_data}" ||:

View file

@ -7,7 +7,7 @@
- name: "INIT: 802.1x tests"
debug:
msg: "##################################################"
- include_tasks: tasks/setup-802_1x_server.yml
- include_tasks: tasks/setup_802_1x_server.yml
- name: Copy client certs
copy:
src: "{{ item }}"
@ -101,6 +101,6 @@
persistent_state: absent
state: down
ignore_errors: true
- include_tasks: tasks/cleanup-802_1x_server.yml
- include_tasks: tasks/cleanup_802_1x_server.yml
tags:
- "tests::cleanup"

View file

@ -9,8 +9,8 @@
- name: "set interface={{ interface }}"
set_fact:
interface: "{{ interface }}"
- include_tasks: tasks/show-interfaces.yml
- include_tasks: tasks/assert-device_absent.yml
- include_tasks: tasks/show_interfaces.yml
- include_tasks: tasks/assert_device_absent.yml
- name: Add test bridge
hosts: all
@ -28,12 +28,12 @@
- import_playbook: run_tasks.yml
vars:
task: tasks/assert-device_present.yml
task: tasks/assert_device_present.yml
- import_playbook: run_tasks.yml
vars:
profile: "{{ interface }}"
task: tasks/assert-profile_present.yml
task: tasks/assert_profile_present.yml
- import_playbook: down_profile.yml
vars:
@ -47,9 +47,9 @@
- import_playbook: run_tasks.yml
vars:
profile: "{{ interface }}"
task: tasks/assert-profile_absent.yml
task: tasks/assert_profile_absent.yml
# FIXME: Devices might still be left when profile is absent
# - import_playbook: run_tasks.yml
# vars:
# task: tasks/assert-device_absent.yml
# task: tasks/assert_device_absent.yml

View file

@ -12,8 +12,8 @@
pre_tasks:
- debug:
msg: Inside states tests
- include_tasks: tasks/show-interfaces.yml
- include_tasks: tasks/assert-device_absent.yml
- include_tasks: tasks/show_interfaces.yml
- include_tasks: tasks/assert_device_absent.yml
roles:
- linux-system-roles.network
tasks:
@ -30,8 +30,8 @@
ip:
dhcp4: false
auto6: false
- include_tasks: tasks/assert-device_present.yml
- include_tasks: tasks/assert-profile_present.yml
- include_tasks: tasks/assert_device_present.yml
- include_tasks: tasks/assert_profile_present.yml
# Use internal module directly for speedup
- network_connections:
provider: nm

View file

@ -18,11 +18,11 @@
set_fact:
type: "{{ type }}"
interface: "{{ interface }}"
- include_tasks: tasks/show-interfaces.yml
- include_tasks: tasks/manage-test-interface.yml
- include_tasks: tasks/show_interfaces.yml
- include_tasks: tasks/manage_test_interface.yml
vars:
state: present
- include_tasks: tasks/assert-device_present.yml
- include_tasks: tasks/assert_device_present.yml
- name: Test static interface up
hosts: all
@ -56,7 +56,7 @@
- name: Remove interfaces
hosts: all
tasks:
- include_tasks: tasks/manage-test-interface.yml
- include_tasks: tasks/manage_test_interface.yml
vars:
state: absent
- include_tasks: tasks/assert-device_absent.yml
- include_tasks: tasks/assert_device_absent.yml

View file

@ -8,11 +8,11 @@
- name: "INIT: Ethtool feeatures tests"
debug:
msg: "##################################################"
- include_tasks: tasks/show-interfaces.yml
- include_tasks: tasks/manage-test-interface.yml
- include_tasks: tasks/show_interfaces.yml
- include_tasks: tasks/manage_test_interface.yml
vars:
state: present
- include_tasks: tasks/assert-device_present.yml
- include_tasks: tasks/assert_device_present.yml
- name: Install ethtool (test dependency)
package:
name: ethtool
@ -112,7 +112,7 @@
persistent_state: absent
state: down
ignore_errors: true
- include_tasks: tasks/manage-test-interface.yml
- include_tasks: tasks/manage_test_interface.yml
vars:
state: absent
tags:

View file

@ -12,8 +12,8 @@
pre_tasks:
- debug:
msg: Inside states tests
- include_tasks: tasks/show-interfaces.yml
- include_tasks: tasks/assert-device_absent.yml
- include_tasks: tasks/show_interfaces.yml
- include_tasks: tasks/assert_device_absent.yml
roles:
- linux-system-roles.network
tasks:
@ -29,8 +29,8 @@
ip:
dhcp4: false
auto6: false
- include_tasks: tasks/assert-device_present.yml
- include_tasks: tasks/assert-profile_present.yml
- include_tasks: tasks/assert_device_present.yml
- include_tasks: tasks/assert_profile_present.yml
# Use internal module to get output
- network_connections:
provider: nm

View file

@ -8,8 +8,8 @@
tasks:
- debug:
msg: Inside states tests
- include_tasks: tasks/show-interfaces.yml
- include_tasks: tasks/assert-device_absent.yml
- include_tasks: tasks/show_interfaces.yml
- include_tasks: tasks/assert_device_absent.yml
# create test profile
- include_role:
@ -22,8 +22,8 @@
ip:
dhcp4: false
auto6: false
- include_tasks: tasks/assert-device_present.yml
- include_tasks: tasks/assert-profile_present.yml
- include_tasks: tasks/assert_device_present.yml
- include_tasks: tasks/assert_profile_present.yml
# test case (remove profile but keep it up)
# I can remove a profile but keep the configuration active.
@ -33,8 +33,8 @@
network_connections:
- name: statebr
persistent_state: absent
- include_tasks: tasks/assert-device_present.yml
- include_tasks: tasks/assert-profile_absent.yml
- include_tasks: tasks/assert_device_present.yml
- include_tasks: tasks/assert_profile_absent.yml
# test case
# I can set a profile down that is up and absent.
@ -45,5 +45,5 @@
network_connections:
- name: statebr
state: down
- include_tasks: tasks/assert-device_absent.yml
- include_tasks: tasks/assert-profile_absent.yml
- include_tasks: tasks/assert_device_absent.yml
- include_tasks: tasks/assert_profile_absent.yml

View file

@ -6,11 +6,11 @@
interface: lsr101
vlan_interface: lsr101.90
tasks:
- include_tasks: tasks/show-interfaces.yml
- include_tasks: tasks/manage-test-interface.yml
- include_tasks: tasks/show_interfaces.yml
- include_tasks: tasks/manage_test_interface.yml
vars:
state: present
- include_tasks: tasks/assert-device_present.yml
- include_tasks: tasks/assert_device_present.yml
- name: >-
TEST: I can configure the MTU for a vlan interface without autoconnect.
debug:
@ -38,10 +38,10 @@
ip:
dhcp4: false
auto6: false
- include_tasks: tasks/assert-device_present.yml
- include_tasks: tasks/assert_device_present.yml
vars:
interface: "{{ vlan_interface }}"
- include_tasks: tasks/assert-profile_present.yml
- include_tasks: tasks/assert_profile_present.yml
vars:
profile: "{{ item }}"
loop:
@ -62,6 +62,6 @@
persistent_state: absent
state: down
ignore_errors: true
- include_tasks: tasks/manage-test-interface.yml
- include_tasks: tasks/manage_test_interface.yml
vars:
state: absent

View file

@ -1,6 +1,6 @@
# SPDX-License-Identifier: BSD-3-Clause
---
- include: get-interface_stat.yml
- include: get_interface_stat.yml
- name: "assert that interface {{ interface }} is absent"
assert:
that: not interface_stat.stat.exists

View file

@ -1,6 +1,6 @@
# SPDX-License-Identifier: BSD-3-Clause
---
- include: get-interface_stat.yml
- include: get_interface_stat.yml
- name: "assert that interface {{ interface }} is present"
assert:
that: interface_stat.stat.exists

View file

@ -1,6 +1,6 @@
# SPDX-License-Identifier: BSD-3-Clause
---
- include: get-profile_stat.yml
- include: get_profile_stat.yml
- name: "assert that profile '{{ profile }}' is absent"
assert:
that: not profile_stat.stat.exists

View file

@ -1,6 +1,6 @@
# SPDX-License-Identifier: BSD-3-Clause
---
- include: get-profile_stat.yml
- include: get_profile_stat.yml
- name: "assert that profile '{{ profile }}' is present"
assert:
that: profile_stat.stat.exists

View file

@ -1,20 +0,0 @@
# SPDX-License-Identifier: BSD-3-Clause
---
- include_tasks: show-interfaces.yml
- include_tasks: manage-test-interface.yml
vars:
state: absent
- include_tasks: show-interfaces.yml
- include_tasks: assert-device_absent.yml
- include_tasks: manage-test-interface.yml
vars:
state: present
- include_tasks: show-interfaces.yml
- include_tasks: assert-device_present.yml
- include_tasks: manage-test-interface.yml
vars:
state: absent
- include_tasks: show-interfaces.yml
- include_tasks: assert-device_absent.yml

View file

@ -0,0 +1,20 @@
# SPDX-License-Identifier: BSD-3-Clause
---
- include_tasks: show_interfaces.yml
- include_tasks: manage_test_interface.yml
vars:
state: absent
- include_tasks: show_interfaces.yml
- include_tasks: assert_device_absent.yml
- include_tasks: manage_test_interface.yml
vars:
state: present
- include_tasks: show_interfaces.yml
- include_tasks: assert_device_present.yml
- include_tasks: manage_test_interface.yml
vars:
state: absent
- include_tasks: show_interfaces.yml
- include_tasks: assert_device_absent.yml

View file

@ -8,8 +8,7 @@
msg: "type needs to be dummy, tap or veth, not '{{ type }}'"
when: type not in ["dummy", "tap", "veth"]
# - include: get-current_interfaces.yml
- include: show-interfaces.yml
- include: show_interfaces.yml
- name: Install iproute
package:

View file

@ -1,5 +1,5 @@
# SPDX-License-Identifier: BSD-3-Clause
---
- include: get-current_interfaces.yml
- include: get_current_interfaces.yml
- debug:
msg: "current_interfaces: {{ current_interfaces }}"

View file

@ -4,13 +4,13 @@
hosts: all
tasks:
- name: test veth interface management
include_tasks: tasks/create-and-remove-interface.yml
include_tasks: tasks/create_and_remove_interface.yml
vars:
type: veth
interface: veth1298
- name: test veth interface management
include_tasks: tasks/create-and-remove-interface.yml
include_tasks: tasks/create_and_remove_interface.yml
vars:
type: dummy
interface: dummy1298
@ -18,7 +18,7 @@
# FIXME: when: does not seem to work with include_tasks, therefore this cannot
# be safely tested for now
# - name: test tap interfaces
# include_tasks: tasks/create-and-remove-interface.yml
# include_tasks: tasks/create_and_remove_interface.yml
# vars:
# - type: tap
# - interface: tap1298