-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathMakefile
66 lines (46 loc) · 1.41 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
SHELL = /bin/bash
.PHONY: all
all: install build deploy run
.PHONY: clean
clean: remove-clab
.PHONY: clean-all
clean-all: clean build-clean install-clean
###############################
# Install components
###############################
.PHONY: install
install: install-clab
install-clab: /usr/bin/containerlab
/usr/bin/containerlab:
bash -c "$$(curl -sL https://get.containerlab.dev)"
install-clean:
-sudo apt remove containerlab -y
###############################
# Build components
###############################
.PHONY: build
build: build-snappi
build-snappi:
sudo docker build -t snappi:local .
build-clean:
-sudo docker rmi snappi:local
###############################
# Deploy lab
###############################
.PHONY: deploy
deploy: deploy-clab
deploy-clab:
sudo -E containerlab deploy -t topo.yml --reconfigure
remove-clab:
sudo containerlab destroy -t topo.yml --cleanup
###############################
# Run tests
###############################
.PHONY: run
run: run-snappi run-scapy run-scapy-port
run-snappi:
sudo docker exec clab-ixcb2b-snappi bash -c "python otg.py"
run-scapy:
sudo docker exec clab-ixcb2b-snappi bash -c "OTG_API='https://clab-ixcb2b-ixia-c:8443' OTG_LOCATION_P1=eth1 OTG_LOCATION_P2=eth2 python scapy2otg.py"
run-scapy-port:
sudo docker exec clab-ixcb2b-snappi bash -c "OTG_API='https://clab-ixcb2b-ixia-c:8443' OTG_LOCATION_P1=eth1 OTG_LOCATION_P2=eth2 python scapy2otg-port.py"