Skip to content

Commit 32b0e97

Browse files
committed
Minor fixes to PTF tests
- Add make target - Reduce unnecessary scapy logging about missing IPv6 routes - Tidier output when running tests
1 parent 7156466 commit 32b0e97

File tree

4 files changed

+17
-5
lines changed

4 files changed

+17
-5
lines changed

Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,11 @@ netcfg:
7272
reset: stop
7373
-rm -rf ./tmp
7474

75-
clean: reset
75+
clean:
7676
-rm -rf p4src/build
7777
-rm -rf app/target
78+
79+
deep-clean: clean
7880
-docker container rm ${app_build_container_name}
7981

8082
p4-build:
@@ -85,6 +87,9 @@ p4-build:
8587
--p4runtime-files p4src/build/p4info.txt --Wdisable=unsupported \
8688
p4src/main.p4
8789

90+
p4-test:
91+
@cd ptf && ./run_tests
92+
8893
_create_mvn_container:
8994
@if ! docker container ls -a --format '{{.Names}}' | grep -q ${app_build_container_name} ; then \
9095
docker create -v ${curr_dir}/app:/mvn-src -w /mvn-src --name ${app_build_container_name} ${MAVEN_IMG} mvn clean package; \

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,9 @@ the exercises, here's a quick reference:
113113
| Make command | Description |
114114
|---------------------|------------------------------------------------------- |
115115
| `make pull-deps` | Pull all required dependencies |
116-
| `make p4-build ` | Build the P4 program |
117-
| `make app-build ` | Build ONOS app |
116+
| `make p4-build` | Build P4 program |
117+
| `make p4-test` | Run the PTF tests |
118+
| `make app-build` | Build ONOS app |
118119
| `make start` | Start containers (`mininet` and `onos`) |
119120
| `make stop` | Stop and remove all containers |
120121
| `make onos-cli` | Access the ONOS CLI (password: `rocks`, Ctrl+D to exit)|

ptf/lib/base_test.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@
1919
# Carmelo Cascone ([email protected])
2020
#
2121

22+
import logging
23+
# https://stackoverflow.com/questions/24812604/hide-scapy-warning-message-ipv6
24+
logging.getLogger("scapy.runtime").setLevel(logging.ERROR)
25+
2226
import itertools
2327
import Queue
2428
import sys

ptf/run_tests

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ DOCKER_IMG=onosproject/fabric-p4test
1010
runName=ptf-${RANDOM}
1111

1212
function stop() {
13-
echo "Stopping ${runName}..."
14-
docker stop -t0 "${runName}"
13+
echo "Stopping container ${runName}..."
14+
docker stop -t0 "${runName}" > /dev/null
1515
}
1616
trap stop INT
1717

@@ -37,3 +37,5 @@ docker exec "${runName}" ./lib/runner.py \
3737
--ptf-dir ./tests \
3838
--cpu-port 255 \
3939
--port-map /ptf/lib/port_map.json "${@}"
40+
41+
stop

0 commit comments

Comments
 (0)