summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2019-08-14 11:32:25 +0200
committerJosé Bollo <jose.bollo@iot.bzh>2019-08-14 11:32:25 +0200
commit81ea2394b8d3dfb89d3d181202ee0a1920cd74e8 (patch)
tree57566e0e59a22357eeac1b10679c0a902d99871c /tests
parentda0b1d974d4d4d78aaf5306027dacbaaba31bb58 (diff)
tests: add stress-cache test
Change-Id: Ieccbd068c032e141c41eb7e2c53969348a959208 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'tests')
-rwxr-xr-xtests/stress-cache.sh32
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/stress-cache.sh b/tests/stress-cache.sh
new file mode 100755
index 0000000..22e5627
--- /dev/null
+++ b/tests/stress-cache.sh
@@ -0,0 +1,32 @@
+#!/bin/bash
+
+me=$(basename $0 .sh)
+d=$(mktemp -d /tmp/${me}.dirXXX)
+
+# initial database
+i=$d/ini
+for((x = 0 ; x < 1000 ; x++))
+do
+ echo "CLIENT$x * USER$x PERMISSION$x yes forever"
+done > $i
+
+# run daemon
+cynarad -i $i -d $d -S $d -l &
+pc=$!
+sleep 2
+
+# stress the cache
+echo ----------- START ------------------
+for((y = 0 ; y < 10 ; y++)); do
+ for((x = 0 ; x < 100 ; x++)); do
+ echo "check CLIENT$x SESSION$x USER$x PERMISSION$x"
+ sleep .05
+ done
+done |
+valgrind cynadm -s $d/cynara.check
+echo ----------- STOP ------------------
+
+# terminate
+kill $pc
+rm -rf $d
+