aboutsummaryrefslogtreecommitdiffstats
path: root/test/sys_req
diff options
context:
space:
mode:
Diffstat (limited to 'test/sys_req')
-rwxr-xr-xtest/sys_req/set_system_parameters.sh57
-rw-r--r--test/sys_req/system_parameters18
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