nginx-server: server side of the http performance tests

The nginx-server.sh script implements the same protocol as the
httperf-client.sh script, namely:

client                           server
   |                                |
   |<----------- num_cores ---------| # server indicates num cores
   |---------- client_ready ------->| # server is configured for 1 core
   |<-- server_num_cores_1_ready ---| # client runs tests for 1 core
   |--- client_num_cores_1_done --->| # client is finished testing
   |                                | # server reconfigures for 2 cores
   |<-- server_num_cores_2_ready ---| # client runs tests for 2 cores
   |--- client_num_cores_2_done --->| # client is finished testing
   |                                | # repeated until num_cores in
   |                                | # increments of 2 (1, 2, 4, 6...)
   ...

Currently it supports testing NGiNX on plain linux IP stack, and a
special version of NGiNX compiled for OFP and ODP-DPDK, however the
latter is not too portable at the moment and will require further work.
Whether one or the other is tested is configured by the CONFIG_TYPE
environment variable in the test definition: linux-ip or odp-dpdk,
respectively.
Also the maximum amount of cores for which to test can be limited by
setting the MAX_CORES environment variable (0 meaning all cores).

This relies completely on VLAND and lava-{send,wait} for
synchronization.

Change-Id: I775083f7183895039064141b51172a3280249848
Signed-off-by: Josep Puigdemont <josep.puigdemont@linaro.org>
Signed-off-by: Milosz Wasilewski <milosz.wasilewski@linaro.org>
diff --git a/automated/linux/nginx-server/nginx-odp-dpdk.yaml b/automated/linux/nginx-server/nginx-odp-dpdk.yaml
new file mode 100644
index 0000000..35d1e3d
--- /dev/null
+++ b/automated/linux/nginx-server/nginx-odp-dpdk.yaml
@@ -0,0 +1,42 @@
+metadata:
+    name: httperf-nginx-ofp-odp-dpdk
+    format: Lava-Test-Shell Test Definition 1.0
+    description: Server running OFP+ODP+DPDK NGiNX
+    environment:
+        - lava-test-shell
+    maintainer:
+        - josep.puigdemont@linaro.org
+    os:
+        - debian
+        - ubuntu
+    devices:
+        - x86
+
+install:
+    deps:
+        - bash
+        - ethtool
+        - pciutils
+        - procps
+        - sysstat
+        - wget
+
+run:
+    steps:
+        - wget -O - http://deb.opendataplane.org/odp.key|sudo apt-key add -
+        - echo "deb http://deb.opendataplane.org jessie main" > /etc/apt/sources.list.d/odp.list
+        - echo "deb http://ftp.debian.org/debian jessie-backports main" > /etc/apt/sources.list.d/backports.list
+        - apt-get update
+        - apt-get -t jessie-backports install -y libssl1.0.0 libssl-dev
+        - wget http://people.linaro.org/~anders.roxell/ubuntu-v4.4/linux-headers-4.4.0-31_4.4.0-31.50_all.deb
+        - dpkg -i linux-headers-4.4.0-31_4.4.0-31.50_all.deb
+        - wget http://people.linaro.org/~anders.roxell/x86_64-ofp-2/overlay.tar.gz
+        - tar xzf overlay.tar.gz -C /
+        - depmod -a
+        - sysctl -w vm.nr_hugepages=1024
+        - modprobe uio
+        - apt-get install -y dpdk-igb-uio-dkms dpdk pciutils
+        - export CONFIG_TYPE=${CONFIG_TYPE:-odp-dpdk}
+        - export MAX_CORES=${MAX_CORES:-0}
+        - export VLAND_NAME=${VLAND_NAME:-vlan_one}
+        - lava-test-case httperf-nginx-server --shell ./automated/linux/nginx-server/nginx-server.sh