Skip to content

Commit

Permalink
Merge pull request #62 from open-traffic-generator/gosnappi-v0.13
Browse files Browse the repository at this point in the history
gosnappi 0.13 with HasBgp() as a fix
  • Loading branch information
bortok authored Dec 19, 2023
2 parents 52e9573 + c30297b commit a957be5
Show file tree
Hide file tree
Showing 7 changed files with 175 additions and 38 deletions.
2 changes: 1 addition & 1 deletion cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ func startProtocols(api gosnappi.GosnappiApi, config gosnappi.Config) (gosnappi.
var configuredProtocols = make(map[string]bool)
var routesPerProtocol = make(map[string]uint64)
for _, d := range config.Devices().Items() {
if d.Bgp().RouterId() != "" {
if d.HasBgp() {
proto := "bgp4"
if len(d.Bgp().Ipv4Interfaces().Items()) > 0 {
if !configuredProtocols[proto] {
Expand Down
14 changes: 7 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require (
github.com/lucasb-eyer/go-colorful v1.2.0
github.com/mum4k/termdash v0.18.0
github.com/olekukonko/tablewriter v0.0.5
github.com/open-traffic-generator/snappi/gosnappi v0.12.6
github.com/open-traffic-generator/snappi/gosnappi v0.13.2
github.com/sirupsen/logrus v1.9.3
github.com/spf13/cobra v1.7.0
google.golang.org/protobuf v1.31.0
Expand All @@ -25,11 +25,11 @@ require (
github.com/mattn/go-runewidth v0.0.14 // indirect
github.com/rivo/uniseg v0.2.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
golang.org/x/net v0.12.0 // indirect
golang.org/x/sys v0.10.0 // indirect
golang.org/x/term v0.10.0 // indirect
golang.org/x/text v0.11.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98 // indirect
google.golang.org/grpc v1.58.3 // indirect
golang.org/x/net v0.14.0 // indirect
golang.org/x/sys v0.11.0 // indirect
golang.org/x/term v0.11.0 // indirect
golang.org/x/text v0.12.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d // indirect
google.golang.org/grpc v1.59.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
)
89 changes: 67 additions & 22 deletions go.sum

Large diffs are not rendered by default.

60 changes: 60 additions & 0 deletions test/systest/cpdp-frr/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,63 @@ deploy-clab:

remove-clab:
sudo containerlab destroy --cleanup

###############################
# Run tests
###############################

.PHONY: run
run: test1 test2 test3 test4 test5 test6 test7 test8

test1:
@echo "CREATE --dmac auto | RUN"
OTG_LOCATION_P1="localhost:5555+localhost:50071" \
OTG_LOCATION_P2="localhost:5556+localhost:50072" \
otgen create device -n otg1 -p p1 --ip 192.0.2.1 --gw 192.0.2.2 --prefix 30 | otgen add device -n otg2 -p p2 --ip 192.0.2.5 --gw 192.0.2.6 --prefix 30 | otgen --log debug add flow --tx otg1 --rx otg2 --dmac auto --src 192.0.2.1 --dst 192.0.2.5 | otgen --log debug run -k --metrics flow,port

test2:
@echo RUN --rxbgp 2x
OTG_LOCATION_P1="localhost:5555+localhost:50071" \
OTG_LOCATION_P2="localhost:5556+localhost:50072" \
otgen --log debug run -k --file otg.json --json --rxbgp 2x

test3:
@echo RUN --rxbgp 2x --metrics bgp4
OTG_LOCATION_P1="localhost:5555+localhost:50071" \
OTG_LOCATION_P2="localhost:5556+localhost:50072" \
otgen --log debug run -k --file otg.json --json --rxbgp 2x --metrics bgp4

test4:
@echo RUN --rxbgp 2x --metrics bgp4,port
OTG_LOCATION_P1="localhost:5555+localhost:50071" \
OTG_LOCATION_P2="localhost:5556+localhost:50072" \
otgen --log debug run -k --file otg.json --json --rxbgp 2x --metrics bgp4,port

test5:
@echo RUN --rxbgp 2x --metrics bgp4,flow
OTG_LOCATION_P1="localhost:5555+localhost:50071" \
OTG_LOCATION_P2="localhost:5556+localhost:50072" \
otgen --log debug run -k --file otg.json --json --rxbgp 2x --metrics bgp4,flow

test6:
@echo RUN --rxbgp 2x --metrics bgp4,flow,port
OTG_LOCATION_P1="localhost:5555+localhost:50071" \
OTG_LOCATION_P2="localhost:5556+localhost:50072" \
otgen --log debug run -k --file otg.json --json --rxbgp 2x --metrics bgp4,flow,port

test7:
@echo RUN --rxbgp 2x --metrics flow,port
OTG_LOCATION_P1="localhost:5555+localhost:50071" \
OTG_LOCATION_P2="localhost:5556+localhost:50072" \
otgen --log debug run -k --file otg.json --json --rxbgp 2x --metrics flow,port

test8:
@echo "CREATE --dmac auto | ADD BGP | RUN --rxbgp 2x --metrics bgp4,flow"
OTG_LOCATION_P1="localhost:5555+localhost:50071" \
otgen create device -n otg1 -p p1 --ip 192.0.2.1 --gw 192.0.2.2 --prefix 30 | \
otgen add bgp -d otg1 --id 1.1.1.1 --asn 1111 --peer 192.0.2.2 --route 198.51.100.0/24 | \
OTG_LOCATION_P2="localhost:5556+localhost:50072" \
otgen add device -n otg2 -p p2 --ip 192.0.2.5 --gw 192.0.2.6 --prefix 30 | \
otgen add bgp -d otg2 --id 2.2.2.2 --asn 2222 --peer 192.0.2.6 --route 203.0.113.0/24 | \
otgen add flow --tx otg1 --rx otg2 --dmac auto --src 198.51.100.1 --dst 203.0.113.1 | \
otgen --log debug run -k --rxbgp 2x --metrics bgp4,flow
10 changes: 5 additions & 5 deletions test/systest/cpdp-frr/topo.clab.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ topology:
nodes:
ixc:
kind: linux
image: ghcr.io/open-traffic-generator/keng-controller:0.1.0-3
image: ghcr.io/open-traffic-generator/keng-controller:0.1.0-84
network-mode: host
cmd: --accept-eula --http-port 8443
ports:
- 8443:8443
te1:
kind: linux
image: ghcr.io/open-traffic-generator/ixia-c-traffic-engine:1.6.0.85
image: ghcr.io/open-traffic-generator/ixia-c-traffic-engine:1.6.0.100
ports:
- 5555:5555
- 50071:50071
Expand All @@ -22,7 +22,7 @@ topology:
WAIT_FOR_IFACE: Yes
pe1:
kind: linux
image: ghcr.io/open-traffic-generator/ixia-c-protocol-engine:1.00.0.337
image: ghcr.io/open-traffic-generator/ixia-c-protocol-engine:1.00.0.340
network-mode: container:te1
startup-delay: 5
env:
Expand All @@ -36,7 +36,7 @@ topology:
- ./frr/vtysh.conf:/etc/frr/vtysh.conf
te2:
kind: linux
image: ghcr.io/open-traffic-generator/ixia-c-traffic-engine:1.6.0.85
image: ghcr.io/open-traffic-generator/ixia-c-traffic-engine:1.6.0.100
ports:
- 5556:5556
- 50072:50071
Expand All @@ -48,7 +48,7 @@ topology:
WAIT_FOR_IFACE: Yes
pe2:
kind: linux
image: ghcr.io/open-traffic-generator/ixia-c-protocol-engine:1.00.0.337
image: ghcr.io/open-traffic-generator/ixia-c-protocol-engine:1.00.0.340
network-mode: container:te2
startup-delay: 5
env:
Expand Down
32 changes: 32 additions & 0 deletions test/systest/dp-b2b/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,35 @@ deploy-lab:

remove-lab:
sudo docker-compose down


###############################
# Run tests
###############################

.PHONY: run
run: test1 test2 test3 test4 test5 test6

test1:
@echo RUN with STDIN YAML
cat otg.yml | otgen --log debug run -k

test2:
@echo RUN with --api
cat otg.yml | otgen --log debug run -k --api https://127.0.0.1:8443

test3:
@echo RUN with --file --yaml
otgen --log debug run -k --file otg.yml --yaml

test4:
@echo RUN with --interval
otgen --log debug run -k --file otg.yml --interval 2s

test5:
@echo RUN with --metrics flow
otgen --log debug run -k --file otg.yml --metrics flow

test6:
@echo RUN with --xeta 1.5
otgen --log debug run -k --file otg.yml --xeta 1.5
6 changes: 3 additions & 3 deletions test/systest/dp-b2b/compose.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
services:
controller:
image: ghcr.io/open-traffic-generator/keng-controller:0.1.0-3
image: ghcr.io/open-traffic-generator/keng-controller:0.1.0-84
command: --accept-eula --http-port 8443
network_mode: "host"
restart: always
traffic_engine_1:
image: ghcr.io/open-traffic-generator/ixia-c-traffic-engine:1.6.0.85
image: ghcr.io/open-traffic-generator/ixia-c-traffic-engine:1.6.0.100
network_mode: "host"
restart: always
privileged: true
Expand All @@ -14,7 +14,7 @@ services:
- ARG_IFACE_LIST=virtual@af_packet,veth0
- OPT_NO_HUGEPAGES=Yes
traffic_engine_2:
image: ghcr.io/open-traffic-generator/ixia-c-traffic-engine:1.6.0.85
image: ghcr.io/open-traffic-generator/ixia-c-traffic-engine:1.6.0.100
network_mode: "host"
restart: always
privileged: true
Expand Down

0 comments on commit a957be5

Please sign in to comment.