diff options
author | Klement Sekera <ksekera@cisco.com> | 2017-09-20 08:26:30 +0200 |
---|---|---|
committer | Florin Coras <florin.coras@gmail.com> | 2018-02-01 23:41:17 +0000 |
commit | 75e7d1301475d49311d14e202936c62df0c07d10 (patch) | |
tree | 1a7e1d211cc97352f093a0207e6c94952e39e611 /test/sys_req | |
parent | 2b9453c55a7294d8eedf126d616a608c32be0e36 (diff) |
IPv4/6 reassembly
Change-Id: Ic5dcadd13c88b8a5e7896dab82404509c081614a
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Diffstat (limited to 'test/sys_req')
-rwxr-xr-x | test/sys_req/set_system_parameters.sh | 57 | ||||
-rw-r--r-- | test/sys_req/system_parameters | 18 |
2 files changed, 75 insertions, 0 deletions
diff --git a/test/sys_req/set_system_parameters.sh b/test/sys_req/set_system_parameters.sh new file mode 100755 index 00000000000..533a02edbaa --- /dev/null +++ b/test/sys_req/set_system_parameters.sh @@ -0,0 +1,57 @@ +#!/bin/bash + +file="$1" + +usage(){ + echo "Usage: $0 <requirements file>" +} + +if [ "$file" == "" ] +then + echo "Invalid parameters specified." + usage + exit 1 +fi + +if [ ! -f $file ] +then + echo "File '$file' does not exist." + usage + exit 1 +fi + +cat $file | grep -v -e '^#.*$' | grep -v -e '^ *$' | while read line +do + value_file=`echo $line | awk '{print $1}'` + operator=`echo $line | awk '{print $2}'` + value=`echo $line | awk '{print $3}'` + set_value=`echo $line | awk '{print $4}'` + if [[ "$value_file" == "" || "$operator" == "" || "$value" == "" || "$set_value" == "" ]] + then + echo "Syntax error in requirements file." + exit 1 + fi + current_value=`cat $value_file` + if test "$current_value" $operator "$value" + then + if test "$V" = "2" + then + echo "Requirement '$value_file $operator $value' satisfied." + fi + else + echo "Requirement '$value_file $operator $value' not satisfied." + echo "Writing '$set_value' to '$value_file'." + echo "$set_value" | tee "$value_file" > /dev/null + if ! test "`cat $value_file`" = "$set_value" + then + echo "Repeating the write using sudo..." + echo "$set_value" | sudo -n tee "$value_file" > /dev/null + if ! test "`cat $value_file`" = "$set_value" + then + echo "Couldn't set the required value. Is that value allowed? Is sudo working?" + exit 1 + fi + fi + echo "Succesfully wrote '$set_value' to '$value_file'." + fi +done diff --git a/test/sys_req/system_parameters b/test/sys_req/system_parameters new file mode 100644 index 00000000000..6373774dd94 --- /dev/null +++ b/test/sys_req/system_parameters @@ -0,0 +1,18 @@ +# test framework system requirements +# format of this file is +# <path> <operator> <comparison-value> <set-value> +# +# path - path to value e.g. in /proc which needs to be checked +# operator - test operator (e.g. -gt) +# comparison-value - value, against which the value read from <path> is compared +# set-value - value, to which the path is set if the test fails +# +# the comparison is done using `test' command + + +# test_reassembly.py +# needed by test_reassembly which uses udp punt via unix domain sockets +# to ensure that all data which vpp might produce in a burst fits into +# the socket send buffer +/proc/sys/net/core/wmem_max -ge 4636252 4636252 +/proc/sys/net/core/wmem_default -ge 4636252 4636252 |