# SPDX-License-Identifier: BSD-3-Clause
---
- name: Play for testing provider
  hosts: all
  vars:
    interface: testnic1
    profile: "{{ interface }}"
    lsr_fail_debug:
      - __network_connections_result
  tasks:
    - name: Show playbook name
      debug:
        msg: "this is: playbooks/tests_states.yml"
      tags:
        - always


    - name: Test managing a veth interface with NM provider after managing it
        with initscripts provider
      tags:
        - tests::provider:initscripts_to_nm
      block:
        - name: Include the task 'run_test.yml'
          include_tasks: tasks/run_test.yml
          vars:
            state: present
            lsr_description: I can manage a veth interface with NM after I
                managed it with initscripts.
            lsr_setup:
              - tasks/setup_test_interface.yml
              # run role once with defaults but nm provider to ensure that
              # NetworKManager is running
              - tasks/provider/default_with_nm.yml
              - tasks/provider/create_and_remove_with_initscripts.yml
            lsr_test:
              - tasks/provider/create_with_nm.yml
            lsr_assert:
              - tasks/assert_profile_present.yml
            lsr_cleanup:
              - tasks/cleanup_profile+device.yml
              - tasks/check_network_dns.yml
