╰─ cat example1.rb
class Example1 < NTT::BgpFuzz::Test
  PEER = 3942
  SUT  = "204.42.111.60"
  setup do
    #log
    peer.add name: "tx", local_as: 100, peer_ip: SUT
    peer.add name: "rx", local_as: 200, peer_ip: SUT, local_ip: "204.42.111.32", rx: true
  end

  test name: 'blaab' do
    net  = "1.2.3.0/24"
    path = [100, 42]
    peer[:tx].tx net: net, path: path
    if msg = peer[:rx].rx
      assert_equal msg.path, [PEER, 5]+path, msg: "bad path"
      assert_equal msg.nlris.size, 1, msg: "bad nlri size"
      assert_equal msg.net, net, msg: "bad network"
    else
      flunk "no route"
    end
  end
end
╭─ ytti@ytti-rpki   ~/git/bgpfuzz     master                                                                      12:26:27 
╰─ cat example2.rb
class Example2 < NTT::BgpFuzz::Test
  setup { from_yaml }

  test name: 'blaab' do
    net  = yaml["routes"]["yaya"]["net"]
    path = yaml["routes"]["yaya"]["path"]
    peer[:tx].tx net: net, path: path
    if msg = peer[:rx].rx
      assert_equal msg.path, [yaml["sut"]["as"]] + path, msg: "bad path"
      assert_equal msg.nlris.size, 1, msg: "bad nlris"
      assert_equal msg.net, net, msg: "bad nlri"
    else
      flunk "no route"
    end
  end
end
╭─ ytti@ytti-rpki   ~/git/bgpfuzz     master                                                                      12:26:29 
╰─ cat example2.yaml
---
sut:
  as: 3942

peers:
  tx:
    local_as: 100
    peer_ip:  204.42.111.60
  rx:
    local_as: 200
    peer_ip:  204.42.111.60
    local_ip: 204.42.111.32

routes:
  yaya: { net: "1.2.3.0/24", path: [100, 42] }
  baba: { net: "1.2.4.0/24", path: [100, 43] }
╭─ ytti@ytti-rpki   ~/git/bgpfuzz     master                                                                      12:26:31 
╰─