--- /dev/null
+../cache_rbtree/cache-compound.attrs
\ No newline at end of file
--- /dev/null
+../cache_rbtree/cache-compound.unlang
\ No newline at end of file
Callback-Id := Callback-Id[0]
}
}
+
+cache compound_key {
+ driver = "htrie"
+ key = "%{Framed-IP-Address} %{User-Name}"
+ ttl = 5
+
+ update {
+ Callback-Id := control.Callback-Id[0]
+ }
+}
--- /dev/null
+../cache_rbtree/cache-compound.attrs
\ No newline at end of file
--- /dev/null
+../cache_rbtree/cache-compound.unlang
\ No newline at end of file
Callback-Id := Callback-Id[0]
}
}
+
+cache compound_key {
+ driver = "memcached"
+ key = "%{Framed-IP-Address}%{User-Name}"
+ ttl = 5
+
+ update {
+ Callback-Id := control.Callback-Id[0]
+ }
+}
--- /dev/null
+#
+# Input packet
+#
+Packet-Type = Access-Request
+User-Name = "bob"
+User-Password = "olobobob"
+
+#
+# Expected answer
+#
+Packet-Type == Access-Accept
--- /dev/null
+#
+# PRE: cache-logic
+#
+
+#
+# Basic update and retrieve
+#
+control.Callback-Id := 'cache me'
+Framed-IP-Address := 1.2.3.4
+
+compound_key.store
+if (!updated) {
+ test_fail
+}
+
+# Merge
+compound_key.load
+if (!updated) {
+ test_fail
+}
+
+if (Callback-Id != 'cache me') {
+ test_fail
+}
+
+Framed-IP-Address := 2.3.4.5
+
+compound_key.load
+if (!notfound) {
+ test_fail
+}
+
+test_pass
Callback-Id := Callback-Id[0]
}
}
+
+cache compound_key {
+ driver = "rbtree"
+ key = "%{Framed-IP-Address} %{User-Name}"
+ ttl = 5
+
+ update {
+ Callback-Id := control.Callback-Id[0]
+ }
+}
--- /dev/null
+../cache_rbtree/cache-compound.attrs
\ No newline at end of file
--- /dev/null
+../cache_rbtree/cache-compound.unlang
\ No newline at end of file
Callback-Id := Callback-Id[0]
}
}
+
+cache compound_key {
+ driver = "redis"
+
+ redis {
+ server = $ENV{CACHE_REDIS_TEST_SERVER}:30001
+ server = $ENV{CACHE_REDIS_TEST_SERVER}:30002
+ server = $ENV{CACHE_REDIS_TEST_SERVER}:30003
+ server = $ENV{CACHE_REDIS_TEST_SERVER}:30004
+ server = $ENV{CACHE_REDIS_TEST_SERVER}:30005
+ server = $ENV{CACHE_REDIS_TEST_SERVER}:30006
+ }
+
+ key = "%{Framed-IP-Address} %{User-Name}"
+ ttl = 5
+
+ update {
+ Callback-Id := control.Callback-Id[0]
+ }
+}