Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f7376df
commit c529efc
Showing
10 changed files
with
128 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Config file for automatic testing at travis-ci.org | ||
|
||
sudo: required | ||
|
||
# workaround for a travis Python issue | ||
# see https://github.com/travis-ci/travis-ci/issues/4948 | ||
language: generic | ||
|
||
dist: trusty | ||
|
||
# My very smart trick to force inclusion of the veth kernel module | ||
# (even though we do not use docker at all her) | ||
services: | ||
- docker | ||
|
||
addons: | ||
apt: | ||
packages: | ||
- python-dev | ||
- python-pip | ||
- cmake | ||
- libffi-dev | ||
|
||
before_install: | ||
- sudo apt-get install ethtool | ||
- sudo pip install --upgrade pip | ||
- sudo apt-get remove python-scapy | ||
- git clone https://github.com/p4lang/scapy-vxlan.git && cd scapy-vxlan && sudo python setup.py install && cd .. | ||
- bash CI/travis/install-nanomsg.sh | ||
- sudo ldconfig | ||
- bash CI/travis/install-nnpy.sh | ||
|
||
install: | ||
- sudo python setup.py install | ||
|
||
before_script: | ||
- cd ptf_nn/; sudo ./veth_setup.sh; cd .. | ||
|
||
script: | ||
- python CI/travis/check-nnpy.py | ||
- ./CI/travis/run_tests.sh |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
force=0 | ||
while [[ $# -gt 0 ]]; do | ||
key="$1" | ||
case $key in | ||
-f|--force) | ||
force=1 | ||
;; | ||
*) | ||
# unknown option | ||
;; | ||
esac | ||
shift # past argument or value | ||
done | ||
|
||
function quit { | ||
if [ $force == 0 ]; then | ||
echo "skipping installation, you can force installation with '-f'" | ||
exit 0 | ||
fi | ||
} | ||
|
||
function check_lib { | ||
ldconfig -p | grep $2 &> /dev/null | ||
if [ $? == 0 ]; then | ||
echo "$2 found" | ||
quit | ||
fi | ||
ldconfig -p | grep $1 &> /dev/null | ||
if [ $? == 0 ]; then | ||
echo "a version of $1 was found, but not $2" | ||
echo "you may experience issues when using a different version" | ||
quit | ||
fi | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/sh | ||
|
||
THIS_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) | ||
source $THIS_DIR/common.sh | ||
|
||
# nanomsg is very confusing in how it manages SOVERSION vs VERSION, but this | ||
# should be okay... (5.0.0 is the SOVERSION) | ||
check_lib libnanomsg libnanomsg.so.5.0.0 | ||
|
||
set -e | ||
wget https://github.com/nanomsg/nanomsg/archive/1.0.0.tar.gz -O nanomsg-1.0.0.tar.gz | ||
tar -xzvf nanomsg-1.0.0.tar.gz | ||
cd nanomsg-1.0.0 | ||
mkdir build | ||
cd build | ||
# I added -DCMAKE_INSTALL_PREFIX=/usr because on my Ubuntu 14.04 machine, the | ||
# library is installed in /usr/local/lib/x86_64-linux-gnu/ by default, and for | ||
# some reason ldconfig cannot find it | ||
cmake .. -DCMAKE_INSTALL_PREFIX=/usr | ||
cmake --build . | ||
sudo cmake --build . --target install | ||
cd .. |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/usr/bin/env bash | ||
|
||
sudo python ptf_nn/ptf_nn_agent.py \ | ||
--device-socket 0@tcp://127.0.0.1:10001 -i 0-1@veth0 \ | ||
&>/dev/null & | ||
|
||
sleep 5 | ||
|
||
sudo python ptf_nn/ptf_nn_agent.py \ | ||
--device-socket 1@tcp://127.0.0.1:10002 -i 1-1@veth3 \ | ||
&>/dev/null & | ||
|
||
sleep 5 | ||
|
||
sudo python ptf_nn/ptf_nn_test_bridge.py -ifrom veth1 -ito veth2 \ | ||
&>/dev/null & | ||
|
||
sleep 5 | ||
|
||
sudo ptf --test-dir ptf_nn/ptf_nn_test \ | ||
--device-socket 0-{0-64}@tcp://127.0.0.1:10001 \ | ||
--device-socket 1-{0-64}@tcp://127.0.0.1:10002 \ | ||
--platform nn |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../CI/travis/check-nnpy.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../CI/travis/install-nnpy.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters