Skip to content

Commit

Permalink
graybox: Test addendums inspired by release protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
ydahhrk committed Jun 19, 2020
1 parent c3a482b commit b5f4cb5
Show file tree
Hide file tree
Showing 20 changed files with 183 additions and 172 deletions.
74 changes: 0 additions & 74 deletions src/mod/common/rfc7915/order.md

This file was deleted.

184 changes: 103 additions & 81 deletions test/graybox/test-suite/siit/7915/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1330,93 +1330,115 @@ Hairpinning on SIIT is actually RFC 7757's realm. This test was adapted from [77
#### ia

- Requirement: Jool should treat ICMP extensions like opaque strings, but update the ICMP header length.
- Test packets:
1. Small ICMPv6 error with ICMP extensions
1. IPv6
2. ICMPv6 (1/4, length 16)
3. IPv6: 40 (swap addresses, TTL-1)
4. TCP: 20
5. Payload: 68
7. ICMP extension: 20
2. Small ICMPv4 error with ICMP extensions
1. IPv4
2. ICMPv4 (3/3, length 32)
3. IPv4: 20
4. TCP: 20
5. Payload: 88
7. ICMP extension: 20
- Expected packets:
1. Small ICMPv4 error with ICMP extensions
1. IPv4
2. ICMPv4 (3/3, length 32)
3. IPv4: 40 (swap addresses, TTL-1)
4. TCP: 20
5. Payload: 68
7. ICMP extension: 20
2. Small ICMPv6 error with ICMP extensions
1. IPv6
2. ICMPv6 (1/4, length 16)
3. IPv6: 20
4. TCP: 20
5. Payload: 88
7. ICMP extension: 20
- Validations: `test-n` must yield `expected-n`.
- Validations: `ia<n>t` must yield `ia<n>e`.

packet ia1t: Small ICMPv6 error with ICMP extensions
40 IPv6
8 ICMPv6 type:1 code:4 length:19
40 IPv6 ttl-- swap payloadLength:112
20 TCP
92 Payload
20 Payload # ICMP Extension

packet ia1e: Small ICMPv4 error with ICMP extensions
20 IPv4 ttl-- !df swap
8 ICMPv4 type:3 code:3 length:33
20 IPv4 ttl-- !df totalLength:132
20 TCP
92 Payload
20 Payload # ICMP extension

packet ia2t: Small ICMPv4 error with ICMP extensions
20 IPv4
8 ICMPv4 type:3 code:3 length:33
20 IPv4 ttl-- swap totalLength:132
20 TCP
92 Payload
20 Payload # ICMP Extension

packet ia2e: Small ICMPv6 error with ICMP extensions
40 IPv6 ttl-- swap
8 ICMPv6 type:1 code:4 length:19
40 IPv6 ttl-- payloadLength:112
20 TCP
92 Payload
20 Payload # ICMP extension

#### ib

This is not actually required by the RFC. It's just my common sense speaking.

- Requirement: Jool needs to adjust padding and length to make up for the difference between the ICMPv6 and ICMPv4 length units.
- Test packets:
1. ICMPv6 error with ICMP extensions
1. IPv6
2. ICMPv6 (1/4, length 16)
3. IPv6: 40 (swap addresses, TTL-1)
4. TCP: 20
5. Payload: 61
6. Padding: 7
7. ICMP extension: 20
2. ICMPv4 error with ICMP extensions
1. IPv4
2. ICMPv4 (3/3, length 32)
3. IPv4: 20
4. TCP: 20
5. Payload: 86
6. Padding: 2
7. ICMP extension: 20
3. ICMPv4 error without padding, but internal packet length not multiple of 8
1. IPv4
2. ICMPv4 (3/3, length 31)
3. IPv4: 20
4. TCP: 20
5. Payload: 84
7. ICMP extension: 20
- Expected packets:
1. ICMPv4 error with ICMP extensions
1. IPv4
2. ICMPv4 (3/3, length 32)
3. IPv4: 40 (swap addresses, TTL-1)
4. TCP: 20
5. Payload: 61
6. Padding: 7
7. ICMP extension: 20
2. ICMPv6 error with ICMP extensions
1. IPv6
2. ICMPv6 (1/4, length 16)
3. IPv6: 20
4. TCP: 20
5. Payload: 86
6. Padding: 2
7. ICMP extension: 20
3. ICMPv6 error with padding
1. IPv6
2. ICMPv6 (1/4, length 16)
3. IPv6: 20
4. TCP: 20
5. Payload: 84
6. Padding: 4
7. ICMP extension: 20
- Validation: `test-n` must yield `expected-n`.
- Validation: `ib<n>t` must yield `ib<n>e`.

packet ib1th
40 IPv6 ttl-- swap
20 TCP
62 Payload

packet ib1t: ICMPv6 error with ICMP extensions
40 IPv6
8 ICMPv6 type:1 code:4 length:16
122 Payload file:ib1th
6 Padding
20 Payload # ICMP extension

packet ib1eh
20 IPv4 !df ttl--
20 TCP
62 Payload

packet ib1e: ICMPv4 error with ICMP extensions
20 IPv4 !df ttl-- swap
8 ICMPv4 type:3 code:3 length:32
102 Payload file:ib1eh
26 Padding
20 Payload # ICMP extension

packet ib2th
20 IPv4 ttl-- swap
20 TCP
86 Payload

packet ib2t: ICMPv4 error with ICMP extensions
20 IPv4
8 ICMPv4 type:3 code:3 length:32
126 Payload file:ib2th
2 Padding
20 Payload # ICMP extension

packet ib2eh
40 IPv6 ttl--
20 TCP
86 Payload

packet ib2e: ICMPv6 error with ICMP extensions
40 IPv6 ttl-- swap
8 ICMPv6 type:1 code:4 length:18
144 Payload file:ib2eh
20 Payload # ICMP extension

packet ib3th
20 IPv4 ttl-- swap
20 TCP
88 Payload

packet ib3t: ICMPv4 error without padding, but internal packet length not multiple of 8
20 IPv4
8 ICMPv4 type:3 code:3 length:32
128 Payload file:ib3th
20 Payload # ICMP extension

packet ib3eh
40 IPv6 ttl--
20 TCP
88 Payload

packet ib3e: ICMPv6 error with padding
40 IPv6 ttl-- swap
8 ICMPv6 type:1 code:4 length:18
144 Payload file:ib3eh
20 Payload # ICMP extension

#### ic

Expand Down
Binary file added test/graybox/test-suite/siit/7915/ia1e.pkt
Binary file not shown.
Binary file added test/graybox/test-suite/siit/7915/ia1t.pkt
Binary file not shown.
Binary file added test/graybox/test-suite/siit/7915/ia2e.pkt
Binary file not shown.
Binary file added test/graybox/test-suite/siit/7915/ia2t.pkt
Binary file not shown.
Binary file added test/graybox/test-suite/siit/7915/ib1e.pkt
Binary file not shown.
Binary file added test/graybox/test-suite/siit/7915/ib1t.pkt
Binary file not shown.
Binary file added test/graybox/test-suite/siit/7915/ib2e.pkt
Binary file not shown.
Binary file added test/graybox/test-suite/siit/7915/ib2t.pkt
Binary file not shown.
Binary file added test/graybox/test-suite/siit/7915/ib3e.pkt
Binary file not shown.
Binary file added test/graybox/test-suite/siit/7915/ib3t.pkt
Binary file not shown.
Binary file not shown.
Binary file added test/graybox/test-suite/siit/manual/6791v46e.pkt
Binary file not shown.
Binary file added test/graybox/test-suite/siit/manual/6791v46t.pkt
Binary file not shown.
Binary file not shown.
58 changes: 44 additions & 14 deletions test/graybox/test-suite/siit/manual/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ In contrast with the "auto" (pktgen) tests, the manual tests were generated manu

## 6791v64

Test of pool6791v4. It's missing an empty pool counterpart.
Test of pool6791v4, populated version.

packet 6791v64t
40 IPv6 src:4000::1
Expand All @@ -22,29 +22,59 @@ Test of pool6791v4. It's missing an empty pool counterpart.

Source address is untranslatable, so it gets assigned the pool6791v4 entry.

## empty6791-64
## 6791v64-empty

This is a puzzling one. From the name it seems like another attempt to check pool6791v4 assignment (which would make it a duplicate of [`6791v64`](#6791v64)), but the original blueprint looked like this:
Test of pool6791v64, empty version.

packet e6791-64-sender-nofrag
40 IPv6 src:2001:db8:2::
8 ICMPv6 type:1 code:0
40 IPv6 swap
packet 6791v64t-empty
Same as 6791v64t.

packet 6791v64e-empty
20 IPv4 !df ttl-- swap src:198.51.100.1
8 ICMPv4
20 IPv4 !df
8 UDP
32 Payload

Environment: Empty pool6791v4.

## 6791v46

- Set `pool6` to null
- Set `rfc6791v6-prefix` to 2::2
- Add EAM entry: 198.51.100 | 2001:db8:1c6:3364::/72
- Add EAM entry: 192.0.2 | 2001:db8:1c0:2/72

packet 6791v46t
20 IPv4 src:2.0.0.2
8 ICMPv4
20 IPv4 ttl-- swap
8 UDP
4 Payload

packet e6791-64-receiver-nofrag
20 IPv4 src:198.51.100.1 dst:198.51.100.2 ttl--
8 ICMPv4 type:3 code:1
20 IPv4
packet 6791v46e
40 IPv6 ttl-- src:2::2 dst:2001:db8:1c0:2:21::
8 ICMPv6
40 IPv6 ttl--
8 UDP
4 Payload

The source address is translatable (and does not yield 198.51.100.1), which suggests the test was already obsolete by the time it was git'd. I suppose this isn't too strange because, for some reason, the test was never actually referenced in the run script; it's been dormant this whole time.
## 6791v46-empty

The packets don't feature any additional peculiarities, so I don't think there is a reason to retain them.
- Set pool6 to null
- Set rfc6791v6-prefix to null
- Add EAM entry: 198.51.100 | 2001:db8:1c6:3364::/72
- Add EAM entry: 192.0.2 | 2001:db8:1c0:2/72

Deleted.
packet 6791v46t-empty
Same as 6791v46t.

packet 6791v46e-empty
40 IPv6 ttl-- src:2001:db8:1c0:2:1:: dst:2001:db8:1c0:2:21::
8 ICMPv6
40 IPv6 ttl--
8 UDP
4 Payload

## 6791v66

Expand Down
25 changes: 22 additions & 3 deletions test/graybox/test-suite/siit/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,21 @@ fi
if [ -z "$1" -o "$1" = "misc" ]; then
test64_11 manual 6791v64t 6791v64e $IDENTIFICATION,$INNER_IDENTIFICATION
test66_11 manual 6791v66t 6791v66e

ip netns exec joolns jool_siit global update rfc6791v4-prefix null
test64_11 manual 6791v64t 6791v64e-empty $IDENTIFICATION,$INNER_IDENTIFICATION
ip netns exec joolns jool_siit global update rfc6791v4-prefix 203.0.113.8

ip netns exec joolns jool_siit global update pool6 null
ip netns exec joolns jool_siit eamt add 198.51.100.0/24 2001:db8:1c6:3364::/72
ip netns exec joolns jool_siit eamt add 192.0.2.0/24 2001:db8:1c0:2::/72
test46_11 manual 6791v46t 6791v46e-empty
ip netns exec joolns jool_siit global update rfc6791v6-prefix 2::2
test46_11 manual 6791v46t 6791v46e
ip netns exec joolns jool_siit global update pool6 2001:db8:100::/40
ip netns exec joolns jool_siit eamt remove 198.51.100.0/24 2001:db8:1c6:3364::/72
ip netns exec joolns jool_siit eamt remove 192.0.2.0/24 2001:db8:1c0:2::/72
ip netns exec joolns jool_siit global update rfc6791v6-prefix null
fi

# "RFC 6791" tests
Expand Down Expand Up @@ -295,11 +310,15 @@ if [ -z "$1" -o "$1" = "rfc7915" ]; then
test66_11 7915 gat1 gae1

# h
test46_11 7915 hat1 hae1 $IDENTIFICATION,$INNER_IDENTIFICATION
# TODO there seems to be a missing test here
test46_11 7915 hat1 hae1
test46_11 7915 hat2 hae2

# i
# TODO there seem to be several missing tests here
test64_11 7915 ia1t ia1e $IDENTIFICATION,$INNER_IDENTIFICATION
test46_11 7915 ia2t ia2e
test64_11 7915 ib1t ib1e $IDENTIFICATION,$INNER_IDENTIFICATION
test46_11 7915 ib2t ib2e
test46_11 7915 ib3t ib3e
test64_11 7915 ic1t ic1e $IDENTIFICATION,$INNER_IDENTIFICATION
test64_11 7915 ic2t ic2e $IDENTIFICATION,$INNER_IDENTIFICATION
test64_11 7915 ic3t ic3e $IDENTIFICATION,$INNER_IDENTIFICATION
Expand Down
Loading

0 comments on commit b5f4cb5

Please sign in to comment.