<commit_before>---

- name: setup - remove vrf
  eos_vrf:
    name: test
    state: absent
    authorize: yes
    provider: "{{ cli }}"

- name: Create vrf
  eos_vrf:
    name: test
    rd: 1:200
    state: present
    authorize: yes
    provider: "{{ cli }}"
  register: result

- assert:
    that:
      - "result.changed == true"
      - "'vrf definition test' in result.commands"
      - "'rd 1:200' in result.commands"
      # Ensure sessions contains epoc. Will fail after 18th May 2033
      - "'ansible_1' in result.session_name"

- name: Create vrf again (idempotent)
  eos_vrf:
    name: test
    rd: 1:200
    state: present
    authorize: yes
    provider: "{{ cli }}"
  register: result

- assert:
    that:
      - "result.changed == false"
      - "result.commands | length == 0"
      # Ensure sessions contains epoc. Will fail after 18th May 2033
      - "result.session_name is not defined"

- name: Modify rd
  eos_vrf:
    name: test
    rd: 1:201
    state: present
    authorize: yes
    provider: "{{ cli }}"
  register: result

- assert:
    that:
      - "result.changed == true"
      - "'vrf definition test' in result.commands"
      - "'rd 1:201' in result.commands"
      # Ensure sessions contains epoc. Will fail after 18th May 2033
      - "'ansible_1' in result.session_name"

- name: Modify rd again (idempotent)
  eos_vrf:
    name: test
    rd: 1:201
    state: present
    authorize: yes
    provider: "{{ cli }}"
  register: result

- assert:
    that:
      - "result.changed == false"
      - "result.commands | length == 0"
      # Ensure sessions contains epoc. Will fail after 18th May 2033
      - "result.session_name is not defined"

- name: Add Ethernet2 to vrf
  eos_vrf:
    name: test
    rd: 1:201
    state: present
    authorize: yes
    interfaces:
      - Ethernet2
    provider: "{{ cli }}"
  register: result

- assert:
    that:
      - "result.changed == true"
      - "'interface Ethernet2' in result.commands"
      - "'vrf forwarding test' in result.commands"
      # Ensure sessions contains epoc. Will fail after 18th May 2033
      - "'ansible_1' in result.session_name"

- name: Add Ethernet2 to vrf again (idempotent)
  eos_vrf:
    name: test
    rd: 1:201
    state: present
    authorize: yes
    interfaces:
      - Ethernet2
    provider: "{{ cli }}"
  register: result

- assert:
    that:
      - "result.changed == false"
      - "result.commands | length == 0"
      # Ensure sessions contains epoc. Will fail after 18th May 2033
      - "result.session_name is not defined"


# FIXME add in tests for everything defined in docs
# FIXME Test state:absent + test:
# FIXME Without powers ensure "privileged mode required"
<commit_msg>Fix assert on eos_vrf integration test (#26686)<commit_after>---

- name: setup - remove vrf
  eos_vrf:
    name: test
    state: absent
    authorize: yes
    provider: "{{ cli }}"

- name: Create vrf
  eos_vrf:
    name: test
    rd: 1:200
    state: present
    authorize: yes
    provider: "{{ cli }}"
  register: result

- assert:
    that:
      - "result.changed == true"
      - "'vrf definition test' in result.commands"
      - "'rd 1:200' in result.commands"
      # Ensure sessions contains epoc. Will fail after 18th May 2033
      - "'ansible_1' in result.session_name"

- name: Create vrf again (idempotent)
  eos_vrf:
    name: test
    rd: 1:200
    state: present
    authorize: yes
    provider: "{{ cli }}"
  register: result

- assert:
    that:
      - "result.changed == false"
      - "result.commands | length == 0"
      # Ensure sessions contains epoc. Will fail after 18th May 2033
      - "result.session_name is not defined"

- name: Modify rd
  eos_vrf:
    name: test
    rd: 1:201
    state: present
    authorize: yes
    provider: "{{ cli }}"
  register: result

- assert:
    that:
      - "result.changed == true"
      - "'vrf definition test' in result.commands"
      - "'rd 1:201' in result.commands"
      # Ensure sessions contains epoc. Will fail after 18th May 2033
      - "'ansible_1' in result.session_name"

- name: Modify rd again (idempotent)
  eos_vrf:
    name: test
    rd: 1:201
    state: present
    authorize: yes
    provider: "{{ cli }}"
  register: result

- assert:
    that:
      - "result.changed == false"
      - "result.commands | length == 0"
      # Ensure sessions contains epoc. Will fail after 18th May 2033
      - "result.session_name is not defined"

- name: Add Ethernet2 to vrf
  eos_vrf:
    name: test
    rd: 1:201
    state: present
    authorize: yes
    interfaces:
      - Ethernet2
    provider: "{{ cli }}"
  register: result

- assert:
    that:
      - "result.changed == true"
      - "'interface Ethernet2' in result.commands"
      - "'vrf forwarding test' in result.commands"
      # Ensure sessions contains epoc. Will fail after 18th May 2033
      - "'ansible_1' in result.session_name"

- name: Add Ethernet2 to vrf again (idempotent)
  eos_vrf:
    name: test
    rd: 1:201
    state: present
    authorize: yes
    interfaces:
      - Ethernet2
    provider: "{{ cli }}"
  register: result

- assert:
    that:
      - "result.changed == false"
      - "result.commands | length == 0"
      # Ensure sessions contains epoc. Will fail after 18th May 2033
      - "'session_name' not in result.commands"


# FIXME add in tests for everything defined in docs
# FIXME Test state:absent + test:
# FIXME Without powers ensure "privileged mode required"

{'fraction_non_alphanumeric': 0.10687442713107241, 'fraction_numerical': 0.02988084326306141, 'mean_word_length': 2.3616759088108443, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3829719', 'n_tokens_mistral': 1941, 'n_tokens_neox': 1785, 'n_words': 576}