Skip to content

Commit

Permalink
Add base autotests for route, decap, nat64stateless modules
Browse files Browse the repository at this point in the history
  • Loading branch information
Timur Aitov authored and taitov committed Sep 26, 2023
1 parent ab06093 commit 5b98486
Show file tree
Hide file tree
Showing 64 changed files with 1,314 additions and 0 deletions.
6 changes: 6 additions & 0 deletions autotests/units/001_one_port/001_default/autotest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
steps:
- ipv4Update: "0.0.0.0/0 -> 200.0.0.1"
- sendPackets:
- port: kni0
send: send.pcap
expect: expect.pcap
32 changes: 32 additions & 0 deletions autotests/units/001_one_port/001_default/controlplane.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"modules": {
"lp0.100": {
"type": "logicalPort",
"physicalPort": "kni0",
"vlanId": "100",
"macAddress": "00:11:22:33:44:55",
"nextModule": "vrf0"
},
"lp0.200": {
"type": "logicalPort",
"physicalPort": "kni0",
"vlanId": "200",
"macAddress": "00:11:22:33:44:55",
"nextModule": "vrf0"
},
"vrf0": {
"type": "route",
"interfaces": {
"kni0.100": {
"nextModule": "lp0.100"
},
"kni0.200": {
"ipv4Prefix": "200.0.0.2/24",
"neighborIPv4Address": "200.0.0.1",
"neighborMacAddress": "00:00:00:11:11:11",
"nextModule": "lp0.200"
}
}
}
}
}
Binary file not shown.
Binary file added autotests/units/001_one_port/001_default/send.pcap
Binary file not shown.
6 changes: 6 additions & 0 deletions autotests/units/001_one_port/002_decap_default/autotest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
steps:
- ipv4Update: "0.0.0.0/0 -> 200.0.0.1"
- sendPackets:
- port: kni0
send: send.pcap
expect: expect.pcap
45 changes: 45 additions & 0 deletions autotests/units/001_one_port/002_decap_default/controlplane.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"modules": {
"lp0.100": {
"type": "logicalPort",
"physicalPort": "kni0",
"vlanId": "100",
"macAddress": "00:11:22:33:44:55",
"nextModule": "acl0"
},
"lp0.200": {
"type": "logicalPort",
"physicalPort": "kni0",
"vlanId": "200",
"macAddress": "00:11:22:33:44:55",
"nextModule": "drop"
},
"acl0": {
"type": "acl",
"nextModules": [
"decap0"
]
},
"decap0": {
"type": "decap",
"ipv6DestinationPrefixes": [
"1:2:3:4::abcd/128"
],
"nextModule": "vrf0"
},
"vrf0": {
"type": "route",
"interfaces": {
"kni0.100": {
"nextModule": "lp0.100"
},
"kni0.200": {
"ipv4Prefix": "200.0.0.2/24",
"neighborIPv4Address": "200.0.0.1",
"neighborMacAddress": "00:00:00:11:11:11",
"nextModule": "lp0.200"
}
}
}
}
}
Binary file not shown.
Binary file not shown.
14 changes: 14 additions & 0 deletions autotests/units/001_one_port/003_ecmp/autotest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
steps:
- ipv4Update:
- "0.0.0.0/0 -> 200.0.2.1 200.0.3.1"
- "128.0.0.0/1 -> 99.0.0.1 99.0.0.2 99.0.0.3"
- ipv4LabelledUpdate:
- "99.0.0.1/32 -> 200.0.2.1:1200 200.0.3.1:1300"
- "99.0.0.2/32 -> 200.0.2.1:2200 200.0.3.1:2300"
- "99.0.0.3/32 -> 200.0.2.1:3200 200.0.3.1:3300"
- "100.0.0.1/32 -> 200.0.2.1:4001 200.0.3.1:4002"
- "111.0.0.0/24 -> 100.0.0.1:50001"
- sendPackets:
- port: kni0
send: send.pcap
expect: expect.pcap
45 changes: 45 additions & 0 deletions autotests/units/001_one_port/003_ecmp/controlplane.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"modules": {
"lp0.100": {
"type": "logicalPort",
"physicalPort": "kni0",
"vlanId": "100",
"macAddress": "00:11:22:33:44:55",
"nextModule": "vrf0"
},
"lp0.200": {
"type": "logicalPort",
"physicalPort": "kni0",
"vlanId": "200",
"macAddress": "00:11:22:33:44:55",
"nextModule": "vrf0"
},
"lp0.300": {
"type": "logicalPort",
"physicalPort": "kni0",
"vlanId": "300",
"macAddress": "00:11:22:33:44:55",
"nextModule": "vrf0"
},
"vrf0": {
"type": "route",
"interfaces": {
"kni0.100": {
"nextModule": "lp0.100"
},
"kni0.200": {
"ipv4Prefix": "200.0.2.2/24",
"neighborIPv4Address": "200.0.2.1",
"neighborMacAddress": "00:00:00:22:22:22",
"nextModule": "lp0.200"
},
"kni0.300": {
"ipv4Prefix": "200.0.3.2/24",
"neighborIPv4Address": "200.0.3.1",
"neighborMacAddress": "00:00:00:33:33:33",
"nextModule": "lp0.300"
}
}
}
}
}
Binary file not shown.
Binary file not shown.
13 changes: 13 additions & 0 deletions autotests/units/001_one_port/004_decap_ecmp/autotest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
steps:
- ipv4Update:
- "0.0.0.0/0 -> 200.0.2.1 200.0.3.1"
- "1.1.0.0/16 -> 99.0.0.1 99.0.0.2 99.0.0.3 99.0.0.4"
- ipv4LabelledUpdate:
- "99.0.0.1/32 -> 200.0.3.1:1300"
- "99.0.0.2/32 -> 200.0.2.1:2200 200.0.3.1:2300"
- "99.0.0.3/32 -> 200.0.2.1:3200 200.0.3.1:3300"
- "99.0.0.4/32 -> 200.0.2.1:4200"
- sendPackets:
- port: kni0
send: send.pcap
expect: expect.pcap
58 changes: 58 additions & 0 deletions autotests/units/001_one_port/004_decap_ecmp/controlplane.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"modules": {
"lp0.100": {
"type": "logicalPort",
"physicalPort": "kni0",
"vlanId": "100",
"macAddress": "00:11:22:33:44:55",
"nextModule": "acl0"
},
"lp0.200": {
"type": "logicalPort",
"physicalPort": "kni0",
"vlanId": "200",
"macAddress": "00:11:22:33:44:55",
"nextModule": "drop"
},
"lp0.300": {
"type": "logicalPort",
"physicalPort": "kni0",
"vlanId": "300",
"macAddress": "00:11:22:33:44:55",
"nextModule": "drop"
},
"acl0": {
"type": "acl",
"nextModules": [
"decap0"
]
},
"decap0": {
"type": "decap",
"ipv6DestinationPrefixes": [
"1:2:3:4::abcd/128"
],
"nextModule": "vrf0"
},
"vrf0": {
"type": "route",
"interfaces": {
"kni0.100": {
"nextModule": "lp0.100"
},
"kni0.200": {
"ipv4Prefix": "200.0.2.2/24",
"neighborIPv4Address": "200.0.2.1",
"neighborMacAddress": "00:00:00:22:22:22",
"nextModule": "lp0.200"
},
"kni0.300": {
"ipv4Prefix": "200.0.3.2/24",
"neighborIPv4Address": "200.0.3.1",
"neighborMacAddress": "00:00:00:33:33:33",
"nextModule": "lp0.300"
}
}
}
}
}
Binary file not shown.
Binary file not shown.
10 changes: 10 additions & 0 deletions autotests/units/001_one_port/005_decap_dscp/autotest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
steps:
- ipv4Update: "0.0.0.0/0 -> 200.0.0.1"
- sendPackets:
- port: kni0
send: send.pcap
expect: expect.pcap
# - sendPackets:
# - port: kni0
# send: send_many.pcap
# expect: expect_many.pcap
134 changes: 134 additions & 0 deletions autotests/units/001_one_port/005_decap_dscp/controlplane.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
{
"modules": {
"lp0.100": {
"type": "logicalPort",
"physicalPort": "kni0",
"vlanId": "100",
"macAddress": "00:11:22:33:44:55",
"nextModule": "acl0"
},
"lp0.101": {
"type": "logicalPort",
"physicalPort": "kni0",
"vlanId": "101",
"macAddress": "00:11:22:33:44:55",
"nextModule": "acl1"
},
"lp0.102": {
"type": "logicalPort",
"physicalPort": "kni0",
"vlanId": "102",
"macAddress": "00:11:22:33:44:55",
"nextModule": "acl2"
},
"lp0.103": {
"type": "logicalPort",
"physicalPort": "kni0",
"vlanId": "103",
"macAddress": "00:11:22:33:44:55",
"nextModule": "acl3"
},
"lp0.104": {
"type": "logicalPort",
"physicalPort": "kni0",
"vlanId": "104",
"macAddress": "00:11:22:33:44:55",
"nextModule": "acl4"
},
"lp0.200": {
"type": "logicalPort",
"physicalPort": "kni0",
"vlanId": "200",
"macAddress": "00:11:22:33:44:55",
"nextModule": "drop"
},
"acl0": {
"type": "acl",
"nextModules": [
"decap0"
]
},
"acl1": {
"type": "acl",
"nextModules": [
"decap1"
]
},
"acl2": {
"type": "acl",
"nextModules": [
"decap2"
]
},
"acl3": {
"type": "acl",
"nextModules": [
"decap3"
]
},
"acl4": {
"type": "acl",
"nextModules": [
"decap4"
]
},
"decap0": {
"type": "decap",
"ipv6DestinationPrefixes": [
"1:2:3:4::abcd/128"
],
"dscpMarkType": "never",
"nextModule": "vrf0"
},
"decap1": {
"type": "decap",
"ipv6DestinationPrefixes": [
"1:2:3:4::abcd/128"
],
"dscpMarkType": "onlyDefault",
"dscp": 10,
"nextModule": "vrf0"
},
"decap2": {
"type": "decap",
"ipv6DestinationPrefixes": [
"1:2:3:4::abcd/128"
],
"dscpMarkType": "always",
"dscp": 20,
"nextModule": "vrf0"
},
"decap3": {
"type": "decap",
"ipv6DestinationPrefixes": [
"1:2:3:4::abcd/128"
],
"dscpMarkType": "always",
"dscp": 40,
"nextModule": "vrf0"
},
"decap4": {
"type": "decap",
"ipv6DestinationPrefixes": [
"1:2:3:4::abcd/128"
],
"dscpMarkType": "onlyDefault",
"dscp": 40,
"nextModule": "vrf0"
},
"vrf0": {
"type": "route",
"interfaces": {
"kni0.100": {
"nextModule": "lp0.100"
},
"kni0.200": {
"ipv4Prefix": "200.0.0.2/24",
"neighborIPv4Address": "200.0.0.1",
"neighborMacAddress": "00:00:00:11:11:11",
"nextModule": "lp0.200"
}
}
}
}
}
Binary file not shown.
Loading

0 comments on commit 5b98486

Please sign in to comment.