Skip to content
This repository has been archived by the owner on Aug 22, 2023. It is now read-only.

Latest commit

 

History

History
174 lines (127 loc) · 3.81 KB

bf_assert.rst

File metadata and controls

174 lines (127 loc) · 3.81 KB

bf_assert

Makes assertions about a Batfish snapshot

  • Makes assertions about the contents and/or behavior of a Batfish snapshot.

The following software packages must be installed on hosts that execute this module:

  • pybatfish

The following options may be specified for this module:

parameter type required default comments
assertions
list yes
List of assertions to make about the snapshot.
See assertions.rst for documentation of supported assertions.
network
str no Value in the bf_network fact.
Name of the network to make assertions about.
session
dict no Value in the bf_session fact.
Batfish session object required to connect to the Batfish service.
snapshot
str no Value in the bf_snapshot fact.
Name of the snapshot to make assertions about.

# Confirm there are no undefined references or incompatible BGP sessions
- bf_assert:
    assertions:
      - type: assert_no_undefined_references
        name: Confirm we have no undefined references
      - type: assert_no_incompatible_bgp_sessions
        name: Confirm we have no incompatible BGP sessions

# Confirm 10.10.10.10 is reachable by traffic entering Gig0/0 of as1border1
- bf_assert:
    assertions:
      - type: assert_all_flows_succeed
        name: confirm host is reachable for traffic received on GigEth0/0
        parameters:
          startLocation: '@enter(as1border1[GigabitEthernet0/0])'
          headers:
            dstIps: '10.10.10.10'

# Confirm a filter denies some specific traffic
- bf_assert:
    assertions:
      - type: assert_filter_denies
        name: confirm node1 filter block_access denies TCP traffic on port 22
        parameters:
          filters: 'node1["block_access"]'
          headers:
            applications: 'ssh'
name description returned type
result
List of assertion results. There is one entry per assertion, and each entry contains details of the assertion and additional information when the assertion fails.
always list
summary
Summary of action(s) performed.
always str


This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.