-
-
Save netj/f2d8c9528e1c6aa5e399 to your computer and use it in GitHub Desktop.
Test kit for mkmimo on OS X
This file contains hidden or 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
#!/usr/bin/env bash | |
# a script for testing prebuilt mkmimo binaries on a Mac | |
# with a oneliner: | |
# $ bash <(curl -fsSL j.mp/mkmimo-osx-test) | |
## | |
# Author: Jaeho Shin <[email protected]> | |
# Created: 2016-03-19 | |
set -eux | |
tmpdir=$(mktemp -d "${TMPDIR:-/tmp}"/mkmimo.osx-test.XXXXXXX) | |
trap 'rm -rf "$tmpdir"' EXIT | |
cd "$tmpdir" | |
# download mkmimo source tree | |
: ${BRANCH:=master} | |
curl -RL https://github.com/netj/mkmimo/archive/$BRANCH.tar.gz | tar vzxf - | |
cd mkmimo-$BRANCH | |
# download OS X test dependencies | |
curl -RL https://gist.github.com/netj/f2d8c9528e1c6aa5e399/archive/master.tar.gz | tar vzxf - | |
ln -sfnv f2d8c9528e1c6aa5e399-master util | |
# set up environment | |
export LC_ALL=C # XXX OS X's tr is sensitive to locale | |
export PATH="$PWD:$PWD/test/util:$PWD/util:$PATH" | |
# run tests | |
set +e | |
for bin in mkmimo.{10,11}; do | |
ln -sfnv util/$bin mkmimo | |
MKMIMO_IMPL=multithreaded \ | |
MULTIBUFFERING=2 \ | |
mkmimo_throughput \ | |
timeout=1m \ | |
num_producer_fast=10 \ | |
num_producer_slow=1 \ | |
num_consumer_fast=10 \ | |
num_consumer_slow=2 \ | |
producer_fast_throughput= \ | |
producer_slow_throughput=2M \ | |
consumer_fast_throughput= \ | |
consumer_slow_throughput=1M \ | |
# | |
read -p "### $bin multithreaded test done ###" -t 3 || true | |
MKMIMO_IMPL=nonblocking \ | |
mkmimo_throughput \ | |
timeout=1m \ | |
num_producer_fast=10 \ | |
num_producer_slow=1 \ | |
num_consumer_fast=10 \ | |
num_consumer_slow=2 \ | |
producer_fast_throughput= \ | |
producer_slow_throughput=2M \ | |
consumer_fast_throughput= \ | |
consumer_slow_throughput=1M \ | |
# | |
read -p "### $bin nonblocking test done ###" -t 3 || true | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment