14 changed files with 165 additions and 12 deletions
@ -0,0 +1,18 @@
|
||||
cd ../../ |
||||
make clean |
||||
make |
||||
cd netcon |
||||
make -f make-intercept.mk lib |
||||
rm *.o |
||||
rm liblwip.so |
||||
make -f make-liblwip.mk |
||||
|
||||
cd ../docker-test/httpd_demo |
||||
|
||||
cp ../../zerotier-one zerotier-one |
||||
cp ../../zerotier-cli zerotier-cli |
||||
|
||||
cp ../../netcon/liblwip.so liblwip.so |
||||
cp ../../netcon/libintercept.so.1.0 libintercept.so.1.0 |
||||
cp ../../netcon/intercept intercept |
||||
|
||||
@ -0,0 +1,2 @@
|
||||
docker build --tag="throughput_httpd_2.4.6" . |
||||
docker run -it -v $PWD/../_results:/opt/results --device=/dev/net/tun throughput_httpd_2.4.6:latest |
||||
@ -0,0 +1,40 @@
|
||||
# ZT Netcon Throughput test |
||||
FROM fedora:23 |
||||
MAINTAINER https://www.zerotier.com/ |
||||
|
||||
# Install apps |
||||
RUN yum -y update |
||||
RUN yum -y install httpd-2.4.17-3.fc23 |
||||
RUN yum -y install nano |
||||
RUN yum -y install strace |
||||
RUN yum clean all |
||||
|
||||
EXPOSE 9993/udp 9992/udp 9991/udp 9990/udp |
||||
|
||||
# Install sys-call intercept library |
||||
ADD intercept / |
||||
ADD libintercept.so.1.0 / |
||||
RUN cp libintercept.so.1.0 lib/libintercept.so.1.0 |
||||
RUN cp libintercept.so.1.0 /lib/libintercept.so.1.0 |
||||
RUN ln -sf /lib/libintercept.so.1.0 /lib/libintercept |
||||
RUN /usr/bin/install -c intercept /usr/bin |
||||
|
||||
# Add ZT files |
||||
RUN mkdir -p /var/lib/zerotier-one/networks.d |
||||
RUN touch /var/lib/zerotier-one/networks.d/e5cd7a9e1c5311ab.conf |
||||
ADD zerotier-one / |
||||
ADD zerotier-cli / |
||||
|
||||
# Install test-setup scripts |
||||
ADD generate_file.sh /generate_file.sh |
||||
RUN chmod -v +x /generate_file.sh |
||||
ADD entrypoint.sh /entrypoint.sh |
||||
RUN chmod -v +x /entrypoint.sh |
||||
|
||||
# Install LWIP library used by service |
||||
ADD liblwip.so / |
||||
RUN mkdir -p ext/bin/lwip |
||||
RUN cp liblwip.so ext/bin/lwip/liblwip.so |
||||
|
||||
# Start ZeroTier-One |
||||
CMD ["./entrypoint.sh"] |
||||
@ -0,0 +1,18 @@
|
||||
cd ../../ |
||||
make clean |
||||
make |
||||
cd netcon |
||||
make -f make-intercept.mk lib |
||||
rm *.o |
||||
rm liblwip.so |
||||
make -f make-liblwip.mk |
||||
|
||||
cd ../docker-test/redis-3.0.4-1.fc23.x86_64 |
||||
|
||||
cp ../../zerotier-one zerotier-one |
||||
cp ../../zerotier-cli zerotier-cli |
||||
|
||||
cp ../../netcon/liblwip.so liblwip.so |
||||
cp ../../netcon/libintercept.so.1.0 libintercept.so.1.0 |
||||
cp ../../netcon/intercept intercept |
||||
|
||||
@ -0,0 +1,14 @@
|
||||
#!/bin/bash |
||||
|
||||
export PATH=/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/ |
||||
|
||||
echo '***' |
||||
echo '*** ZeroTier Network Containers Test Image' |
||||
echo '*** https://www.zerotier.com/' |
||||
echo '***' |
||||
|
||||
./zerotier-one & |
||||
./zerotier-cli join e5cd7a9e1c5311ab |
||||
./zerotier-cli listnetworks |
||||
|
||||
|
||||
@ -0,0 +1 @@
|
||||
dd if=/dev/urandom of=/var/www/html/big bs=100M count=1 |
||||
@ -0,0 +1,2 @@
|
||||
/httpd_demo/test.sh |
||||
/throughput_httpd.2.4.6/test.sh |
||||
@ -0,0 +1,54 @@
|
||||
#!/bin/sh |
||||
# usage: |
||||
# /usr/bin/intercept program <args> |
||||
|
||||
if [ $# = 0 ] ; then |
||||
echo "$0: insufficient arguments" |
||||
exit |
||||
fi |
||||
|
||||
case "$1" in |
||||
on) |
||||
if [ -z "$LD_PRELOAD" ] |
||||
then |
||||
export LD_PRELOAD="/lib/libintercept.so.1.0" |
||||
else |
||||
echo $LD_PRELOAD | grep -q "/lib/libintercept\.so.1.0" || \ |
||||
export LD_PRELOAD="/lib/libintercept.so $LD_PRELOAD" |
||||
fi |
||||
;; |
||||
off) |
||||
export LD_PRELOAD=`echo -n $LD_PRELOAD | sed 's/\/lib\/libintercept.so.1.0 \?//'` |
||||
if [ -z "$LD_PRELOAD" ] |
||||
then |
||||
unset LD_PRELOAD |
||||
fi |
||||
;; |
||||
show|sh) |
||||
echo "LD_PRELOAD=\"$LD_PRELOAD\"" |
||||
;; |
||||
-h|-?) |
||||
echo "" |
||||
;; |
||||
*) |
||||
if [ -z "$LD_PRELOAD" ] |
||||
then |
||||
export LD_PRELOAD="/lib/libintercept.so.1.0" |
||||
else |
||||
echo $LD_PRELOAD | grep -q "/lib/libintercept\.so.1.0" || \ |
||||
export LD_PRELOAD="/lib/libintercept.so.1.0 $LD_PRELOAD" |
||||
fi |
||||
|
||||
if [ $# = 0 ] |
||||
then |
||||
${SHELL:-/bin/sh} |
||||
fi |
||||
|
||||
if [ $# -gt 0 ] |
||||
then |
||||
exec "$@" |
||||
fi |
||||
;; |
||||
esac |
||||
|
||||
#EOF |
||||
@ -0,0 +1,2 @@
|
||||
docker build --tag="throughput_httpd_2.4.6" . |
||||
docker run -it -v $PWD/../_results:/opt/results --device=/dev/net/tun throughput_httpd_2.4.6:latest |
||||
Binary file not shown.
Loading…
Reference in new issue