bench: fix scripts

Remove bashism - execute on /bin/sh.

Rename SNAB to SNABB variables. Rename snab to snabb in file names.
Update README with QEMU instructions and small details.

Signed-off-by: Nikolay Nikolaev <n.nikolaev@virtualopensystems.com>
bench: add trap handler

Add a generic trap handler to ensure proper cleanup upon exit.

Signed-off-by: Nikolay Nikolaev <n.nikolaev@virtualopensystems.com>
bench: override SNABB on the command line

If the scripts are run with SNABB env set, then it will override the global
and user settings.
NFV and LOADGEN are computed from teh relative path to SNABB executable and
can't be set by hand.

Signed-off-by: Nikolay Nikolaev <n.nikolaev@virtualopensystems.com>
app: main can take an external 'done' function
    
Will assert if both duration and done are passed as arguments.


Signed-off-by: Nikolay Nikolaev <n.nikolaev@virtualopensystems.com>
nfv: run upto a number of a packets

The nfv design will be able to get an optional argument which tells it
what number of packets the VM shal receive before exiting.
It will start measuring time once the packets get actually received.

Signed-off-by: Nikolay Nikolaev <n.nikolaev@virtualopensystems.com>
bench: loadgen run NFV upto a number of packets

Qemu will run in the background and will receive "powerdown" at the end of the execution.
Add the new NFV_PACKETS variable.

Signed-off-by: Nikolay Nikolaev <n.nikolaev@virtualopensystems.com>
bench: use flock to ensure resource exclusivity


Signed-off-by: Nikolay Nikolaev <n.nikolaev@virtualopensystems.com>
bench: update example conf and README

Signed-off-by: Nikolay Nikolaev <n.nikolaev@virtualopensystems.com>
Merge pull request #195 from virtualopensystems/bench

Improved benchmark environment based on loadgen for chur.