-
Notifications
You must be signed in to change notification settings - Fork 299
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into yang-local
# Conflicts: # src/core/counter.lua
- Loading branch information
Showing
64 changed files
with
2,229 additions
and
694 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 |
---|---|---|
|
@@ -16,3 +16,4 @@ obj | |
/deps/*.vsn | ||
/src/programs.inc | ||
.images | ||
/lib/luajit/usr |
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,39 @@ | ||
# Run like this: | ||
# nix-build /path/to/this/directory | ||
# ... and the files are produced in ./result/ | ||
|
||
{ pkgs ? (import <nixpkgs> {}) | ||
}: | ||
|
||
with pkgs; | ||
|
||
stdenv.mkDerivation rec { | ||
# TODO: get the version from somewhere? | ||
name = "snabb"; | ||
|
||
src = ./.; | ||
|
||
buildInputs = [ makeWrapper ]; | ||
|
||
patchPhase = '' | ||
patchShebangs . | ||
# some hardcodeism | ||
for f in $(find src/program/snabbnfv/ -type f); do | ||
substituteInPlace $f --replace "/bin/bash" "${bash}/bin/bash" | ||
done | ||
# We need a way to pass $PATH to the scripts | ||
sed -i '2iexport PATH=${git}/bin:${mariadb}/bin:${which}/bin:${procps}/bin:${coreutils}/bin' src/program/snabbnfv/neutron_sync_master/neutron_sync_master.sh.inc | ||
sed -i '2iexport PATH=${git}/bin:${coreutils}/bin:${diffutils}/bin:${nettools}/bin' src/program/snabbnfv/neutron_sync_agent/neutron_sync_agent.sh.inc | ||
''; | ||
|
||
preBuild = '' | ||
make clean | ||
''; | ||
|
||
installPhase = '' | ||
mkdir -p $out/bin | ||
cp src/snabb $out/bin | ||
''; | ||
} |
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,67 @@ | ||
# Run like this: | ||
# nix-build /path/to/this/directory/release.nix -A manual | ||
# ... and the files are produced in ./result/ | ||
|
||
{ pkgs ? (import <nixpkgs> {}) | ||
}: | ||
|
||
with pkgs; | ||
|
||
let | ||
# see https://github.com/snabbco/snabb/blob/master/src/doc/testing.md | ||
test_env = fetchurl { | ||
url = "http://lab1.snabb.co:2008/~max/assets/vm-ubuntu-trusty-14.04-dpdk-snabb.tar.gz"; | ||
sha256 = "0323591i925jhd6wv8h268wc3ildjpa6j57n4p9yg9d6ikwkw06j"; | ||
}; | ||
optionalGetEnv = first: default: let | ||
maybeEnv = builtins.getEnv first; | ||
in if (maybeEnv != "") then maybeEnv else default; | ||
in rec { | ||
manual = import ./src/doc {}; | ||
snabb = import ./default.nix {}; | ||
tests = stdenv.mkDerivation rec { | ||
name = "snabb-tests"; | ||
|
||
src = snabb.src; | ||
|
||
# allow sudo | ||
__noChroot = true; | ||
requiredSystemFeatures = [ "performance" ]; | ||
|
||
buildInputs = [ git telnet tmux numactl bc iproute which qemu ]; | ||
|
||
buildPhase = '' | ||
export PATH=$PATH:/var/setuid-wrappers/ | ||
export HOME=$TMPDIR | ||
# make sure we reuse the snabb built in another derivation | ||
ln -s ${snabb}/bin/snabb src/snabb | ||
sed -i 's/testlog snabb/testlog/' src/Makefile | ||
# setup the environment | ||
mkdir ~/.test_env | ||
tar xvzf ${test_env} -C ~/.test_env/ | ||
''; | ||
|
||
doCheck = true; | ||
checkPhase = '' | ||
export SNABB_PCI0=${ optionalGetEnv "SNABB_PCI0" "0000:01:00.0"} | ||
export SNABB_PCI_INTEL0=${ optionalGetEnv "SNABB_PCI_INTEL0" "0000:01:00.0"} | ||
export SNABB_PCI_INTEL1=${ optionalGetEnv "SNABB_PCI_INTEL1" "0000:01:00.1"} | ||
export FAIL_ON_FIRST=true | ||
# run tests | ||
sudo -E make test -C src/ | ||
''; | ||
|
||
installPhase = '' | ||
mkdir -p $out/nix-support | ||
# keep the logs | ||
cp src/testlog/* $out/ | ||
for f in $(ls $out/* | sort); do | ||
echo "file log $f" >> $out/nix-support/hydra-build-products | ||
done | ||
''; | ||
}; | ||
} |
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
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
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
Binary file not shown.
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
Oops, something went wrong.