Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Topotato: Assert Ping #133

Open
wants to merge 2 commits into
base: topotato-base
Choose a base branch
from
Open

Topotato: Assert Ping #133

wants to merge 2 commits into from

Conversation

eznix86
Copy link

@eznix86 eznix86 commented Sep 14, 2023

Untested yet, but waiting for a review on implementation.

implementation:

yield from AssertPing.make(r1, iface, r2)

yield from AssertPing.make(r1, "r1-s1", "192.168.1.2") 
yield from AssertPing.make(r1, "r1-s1",  str(r2.iface_to("s1").ip4[0].ip)) 

Signed-off-by: Bruno Bernard <contact.brunobernard@gmail.com>
topotato/assertions.py Outdated Show resolved Hide resolved
Signed-off-by: Bruno Bernard <contact.brunobernard@gmail.com>
@eznix86
Copy link
Author

eznix86 commented Sep 29, 2023

Updated the code, it seems like I do not receive the expected packet with IP/ICMP (tried with ScapySend + AssertPacket Combination) and remained the same results:

E       topotato.exceptions.TopotatoPacketFail: did not receive a matching packet for:
E               def expect_pkt(ip: IP, icmp: ICMP):
E                   return True

/home/vagrant/dev/topotato/test_ping.py:47: TopotatoPacketFail
-------------------------------------------------------------- Captured log call --------------------------------------------------------------
DEBUG    root:assertions.py:381 element: {'match_for': [], '_pkt': <Ether  dst=33:33:00:00:00:16 src=fe:02:00:bc:01:00 type=IPv6 |<IPv6  version=6 tc=0 fl=0 plen=76 nh=Hop-by-Hop Option Header hlim=1 src=fe80::fc02:ff:febc:100 dst=ff02::16 |<IPv6ExtHdrHopByHop  nh=ICMPv6 len=0 autopad=On options=[<RouterAlert  otype=Router Alert [00: skip, 0: Don't change en-route] optlen=2 value=Datagram contains a MLD message |>, <PadN  otype=PadN [00: skip, 0: Don't change en-route] optlen=0 |>] |<ICMPv6MLReport2  type=MLD Report Version 2 res=0 cksum=0x6d5a reserved=0 records_number=3 records=[<ICMPv6MLDMultAddrRec  rtype=4 auxdata_len=0 sources_number=0 dst=ff02::1:ff00:0 auxdata='' |<ICMPv6MLDMultAddrRec  rtype=4 auxdata_len=0 sources_number=0 dst=ff02::1:ffbc:100 auxdata='' |<ICMPv6MLDMultAddrRec  rtype=4 auxdata_len=0 sources_number=0 dst=ff02::2 |>>>] |>>>>}
DEBUG    root:assertions.py:386 element: {'match_for': [], '_pkt': <Ether  dst=33:33:00:00:00:16 src=fe:02:00:bc:01:00 type=IPv6 |<IPv6  version=6 tc=0 fl=0 plen=76 nh=Hop-by-Hop Option Header hlim=1 src=fe80::fc02:ff:febc:100 dst=ff02::16 |<IPv6ExtHdrHopByHop  nh=ICMPv6 len=0 autopad=On options=[<RouterAlert  otype=Router Alert [00: skip, 0: Don't change en-route] optlen=2 value=Datagram contains a MLD message |>, <PadN  otype=PadN [00: skip, 0: Don't change en-route] optlen=0 |>] |<ICMPv6MLReport2  type=MLD Report Version 2 res=0 cksum=0x6d5a reserved=0 records_number=3 records=[<ICMPv6MLDMultAddrRec  rtype=4 auxdata_len=0 sources_number=0 dst=ff02::1:ff00:0 auxdata='' |<ICMPv6MLDMultAddrRec  rtype=4 auxdata_len=0 sources_number=0 dst=ff02::1:ffbc:100 auxdata='' |<ICMPv6MLDMultAddrRec  rtype=4 auxdata_len=0 sources_number=0 dst=ff02::2 |>>>] |>>>>}
DEBUG    root:assertions.py:381 element: {'match_for': [], '_pkt': <Ether  dst=33:33:00:00:00:16 src=fe:02:00:bc:01:00 type=IPv6 |<IPv6  version=6 tc=0 fl=0 plen=76 nh=Hop-by-Hop Option Header hlim=1 src=fe80::fc02:ff:febc:100 dst=ff02::16 |<IPv6ExtHdrHopByHop  nh=ICMPv6 len=0 autopad=On options=[<RouterAlert  otype=Router Alert [00: skip, 0: Don't change en-route] optlen=2 value=Datagram contains a MLD message |>, <PadN  otype=PadN [00: skip, 0: Don't change en-route] optlen=0 |>] |<ICMPv6MLReport2  type=MLD Report Version 2 res=0 cksum=0x6d5a reserved=0 records_number=3 records=[<ICMPv6MLDMultAddrRec  rtype=4 auxdata_len=0 sources_number=0 dst=ff02::1:ff00:0 auxdata='' |<ICMPv6MLDMultAddrRec  rtype=4 auxdata_len=0 sources_number=0 dst=ff02::1:ffbc:100 auxdata='' |<ICMPv6MLDMultAddrRec  rtype=4 auxdata_len=0 sources_number=0 dst=ff02::2 |>>>] |>>>>}
DEBUG    root:assertions.py:386 element: {'match_for': [], '_pkt': <Ether  dst=33:33:00:00:00:16 src=fe:02:00:bc:01:00 type=IPv6 |<IPv6  version=6 tc=0 fl=0 plen=76 nh=Hop-by-Hop Option Header hlim=1 src=fe80::fc02:ff:febc:100 dst=ff02::16 |<IPv6ExtHdrHopByHop  nh=ICMPv6 len=0 autopad=On options=[<RouterAlert  otype=Router Alert [00: skip, 0: Don't change en-route] optlen=2 value=Datagram contains a MLD message |>, <PadN  otype=PadN [00: skip, 0: Don't change en-route] optlen=0 |>] |<ICMPv6MLReport2  type=MLD Report Version 2 res=0 cksum=0x6d5a reserved=0 records_number=3 records=[<ICMPv6MLDMultAddrRec  rtype=4 auxdata_len=0 sources_number=0 dst=ff02::1:ff00:0 auxdata='' |<ICMPv6MLDMultAddrRec  rtype=4 auxdata_len=0 sources_number=0 dst=ff02::1:ffbc:100 auxdata='' |<ICMPv6MLDMultAddrRec  rtype=4 auxdata_len=0 sources_number=0 dst=ff02::2 |>>>] |>>>>}
DEBUG    root:assertions.py:381 element: {'match_for': [], '_pkt': <Ether  dst=33:33:00:00:00:16 src=fe:01:00:bc:01:00 type=IPv6 |<IPv6  version=6 tc=0 fl=0 plen=76 nh=Hop-by-Hop Option Header hlim=1 src=fe80::fc01:ff:febc:100 dst=ff02::16 |<IPv6ExtHdrHopByHop  nh=ICMPv6 len=0 autopad=On options=[<RouterAlert  otype=Router Alert [00: skip, 0: Don't change en-route] optlen=2 value=Datagram contains a MLD message |>, <PadN  otype=PadN [00: skip, 0: Don't change en-route] optlen=0 |>] |<ICMPv6MLReport2  type=MLD Report Version 2 res=0 cksum=0x6d5b reserved=0 records_number=3 records=[<ICMPv6MLDMultAddrRec  rtype=4 auxdata_len=0 sources_number=0 dst=ff02::1:ff00:0 auxdata='' |<ICMPv6MLDMultAddrRec  rtype=4 auxdata_len=0 sources_number=0 dst=ff02::1:ffbc:100 auxdata='' |<ICMPv6MLDMultAddrRec  rtype=4 auxdata_len=0 sources_number=0 dst=ff02::2 |>>>] |>>>>}
DEBUG    root:assertions.py:386 element: {'match_for': [], '_pkt': <Ether  dst=33:33:00:00:00:16 src=fe:01:00:bc:01:00 type=IPv6 |<IPv6  version=6 tc=0 fl=0 plen=76 nh=Hop-by-Hop Option Header hlim=1 src=fe80::fc01:ff:febc:100 dst=ff02::16 |<IPv6ExtHdrHopByHop  nh=ICMPv6 len=0 autopad=On options=[<RouterAlert  otype=Router Alert [00: skip, 0: Don't change en-route] optlen=2 value=Datagram contains a MLD message |>, <PadN  otype=PadN [00: skip, 0: Don't change en-route] optlen=0 |>] |<ICMPv6MLReport2  type=MLD Report Version 2 res=0 cksum=0x6d5b reserved=0 records_number=3 records=[<ICMPv6MLDMultAddrRec  rtype=4 auxdata_len=0 sources_number=0 dst=ff02::1:ff00:0 auxdata='' |<ICMPv6MLDMultAddrRec  rtype=4 auxdata_len=0 sources_number=0 dst=ff02::1:ffbc:100 auxdata='' |<ICMPv6MLDMultAddrRec  rtype=4 auxdata_len=0 sources_number=0 dst=ff02::2 |>>>] |>>>>}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants