summaryrefslogtreecommitdiff
path: root/source3/torture
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2014-03-10 15:43:19 +0100
committerMichael Adam <obnox@samba.org>2014-05-24 16:16:43 +0200
commita448699b7dcb310e4d47d9d9e7ef0291b6c3760f (patch)
treeb133a8fb1e564cb7265acf8ff9080dc16cc63781 /source3/torture
parent8f3be3dcff8c42a93be3c0841b34250c795fb1c4 (diff)
downloadsamba-a448699b7dcb310e4d47d9d9e7ef0291b6c3760f.tar.gz
torture3: Add a little gencache_parse load test
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Christof Schmitt <cs@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Autobuild-User(master): Michael Adam <obnox@samba.org> Autobuild-Date(master): Sat May 24 16:16:43 CEST 2014 on sn-devel-104
Diffstat (limited to 'source3/torture')
-rw-r--r--source3/torture/torture.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/source3/torture/torture.c b/source3/torture/torture.c
index 95d8b333ecb..cea908930c1 100644
--- a/source3/torture/torture.c
+++ b/source3/torture/torture.c
@@ -8119,12 +8119,26 @@ static bool run_local_base64(int dummy)
return ret;
}
+static void parse_fn(time_t timeout, DATA_BLOB blob, void *private_data)
+{
+ return;
+}
+
static bool run_local_gencache(int dummy)
{
char *val;
time_t tm;
DATA_BLOB blob;
char v;
+ struct memcache *mem;
+ int i;
+
+ mem = memcache_init(NULL, 0);
+ if (mem == NULL) {
+ d_printf("%s: memcache_init failed\n", __location__);
+ return false;
+ }
+ memcache_set_global(mem);
if (!gencache_set("foo", "bar", time(NULL) + 1000)) {
d_printf("%s: gencache_set() failed\n", __location__);
@@ -8136,6 +8150,16 @@ static bool run_local_gencache(int dummy)
return False;
}
+ for (i=0; i<1000000; i++) {
+ gencache_parse("foo", parse_fn, NULL);
+ }
+
+ if (!gencache_get("foo", talloc_tos(), &val, &tm)) {
+ d_printf("%s: gencache_get() failed\n", __location__);
+ return False;
+ }
+ TALLOC_FREE(val);
+
if (!gencache_get("foo", talloc_tos(), &val, &tm)) {
d_printf("%s: gencache_get() failed\n", __location__);
return False;