#
# Add IP addresses
#
-&Tmp-String-0 := `./build/bin/local/rlm_redis_ippool_tool -a 192.168.0.1/32 $ENV{REDIS_IPPOOL_TEST_SERVER}:30001 %{control.IP-Pool.Name} 192.168.0.0`
+%exec(./build/bin/local/rlm_redis_ippool_tool, -a, 192.168.0.1/32, $ENV{REDIS_IPPOOL_TEST_SERVER}:30001, %{control.IP-Pool.Name}, 192.168.0.0)
#
# Check allocation
#
# Add IP addresses
#
-&Tmp-String-0 := `./build/bin/local/rlm_redis_ippool_tool -a 192.168.1.1/32 $ENV{REDIS_IPPOOL_TEST_SERVER}:30001 %{control.IP-Pool.Name} 192.168.1.0`
+%exec(./build/bin/local/rlm_redis_ippool_tool, -a, 192.168.1.1/32, $ENV{REDIS_IPPOOL_TEST_SERVER}:30001, %{control.IP-Pool.Name}, 192.168.1.0)
#
# Check we get the same lease, with the same lease time
#
# Add IP addresses
#
-&Tmp-String-0 := `./build/bin/local/rlm_redis_ippool_tool -a 192.168.0.1/32 $ENV{REDIS_IPPOOL_TEST_SERVER}:30001 %{control.IP-Pool.Name} 192.168.0.0`
+%exec(./build/bin/local/rlm_redis_ippool_tool, -a, 192.168.0.1/32, $ENV{REDIS_IPPOOL_TEST_SERVER}:30001, %{control.IP-Pool.Name}, 192.168.0.0)
#
# Check allocation
#
# Delete the IP address
#
-&Tmp-String-0 := `./build/bin/local/rlm_redis_ippool_tool -d 192.168.0.1/32 $ENV{REDIS_IPPOOL_TEST_SERVER}:30001 %{control.IP-Pool.Name} 192.168.0.0`
+%exec(./build/bin/local/rlm_redis_ippool_tool, -d, 192.168.0.1/32, $ENV{REDIS_IPPOOL_TEST_SERVER}:30001, %{control.IP-Pool.Name}, 192.168.0.0)
#
# Verify the association with the device has been removed
#
-if !("%(redis:EXISTS {%{control.IP-Pool.Name}}:device:%{Calling-Station-ID})" == '0') {
+if !(%redis(EXISTS, {%{control.IP-Pool.Name}}:device:%{Calling-Station-ID}) == '0') {
test_fail
}
#
# Verify the hash information is removed
#
-if !("%(redis:EXISTS {%{control.IP-Pool.Name}}:ip:%{reply.Framed-IP-Address})" == '0') {
+if !(%redis(EXISTS, {%{control.IP-Pool.Name}}:ip:%{reply.Framed-IP-Address}) == '0') {
test_fail
}
# Check the ZSCORE
-if !("%(redis:ZCOUNT {%{control.IP-Pool.Name}%}:pool -inf +inf)" == 0) {
+if !(%redis(ZCOUNT, {%{control.IP-Pool.Name}%}:pool, -inf, +inf) == 0) {
test_fail
}
#
# Add IP addresses
#
-&Tmp-String-0 := `./build/bin/local/rlm_redis_ippool_tool -a 192.168.0.1/32 $ENV{REDIS_IPPOOL_TEST_SERVER}:30001 %{control.IP-Pool.Name} 192.168.0.0`
+%exec(./build/bin/local/rlm_redis_ippool_tool, -a, 192.168.0.1/32, $ENV{REDIS_IPPOOL_TEST_SERVER}:30001, %{control.IP-Pool.Name}, 192.168.0.0)
#
# Verify the range was set OK
#
-if !("%(redis:HGET {%{control.IP-Pool.Name}}:ip:192.168.0.1 range)" == '192.168.0.0') {
+if !(%redis(HGET, {%{control.IP-Pool.Name}}:ip:192.168.0.1, range) == '192.168.0.0') {
test_fail
}
#
# Modify the range
#
-&Tmp-String-0 := `./build/bin/local/rlm_redis_ippool_tool -m 192.168.0.1/32 $ENV{REDIS_IPPOOL_TEST_SERVER}:30001 %{control.IP-Pool.Name} 10.0.0.0`
+%exec(./build/bin/local/rlm_redis_ippool_tool, -m, 192.168.0.1/32, $ENV{REDIS_IPPOOL_TEST_SERVER}:30001, %{control.IP-Pool.Name}, 10.0.0.0)
#
# Check it was updated
#
-if !("%(redis:HGET {%{control.IP-Pool.Name}}:ip:192.168.0.1 range)" == '10.0.0.0') {
+if !(%redis(HGET, {%{control.IP-Pool.Name}}:ip:192.168.0.1, range) == '10.0.0.0') {
test_fail
}
#
# Add IP addresses
#
-&Tmp-String-0 := `./build/bin/local/rlm_redis_ippool_tool -a 192.168.0.1/32 $ENV{REDIS_IPPOOL_TEST_SERVER}:30001 %{control.IP-Pool.Name} 192.168.0.0`
+%exec(./build/bin/local/rlm_redis_ippool_tool, -a, 192.168.0.1/32, $ENV{REDIS_IPPOOL_TEST_SERVER}:30001, %{control.IP-Pool.Name}, 192.168.0.0)
#
# Check allocation
#
# Release the IP address
#
-&Tmp-String-0 := `./build/bin/local/rlm_redis_ippool_tool -r 192.168.0.1/32 $ENV{REDIS_IPPOOL_TEST_SERVER}:30001 %{control.IP-Pool.Name} 192.168.0.0`
+%exec(./build/bin/local/rlm_redis_ippool_tool, -r, 192.168.0.1/32, $ENV{REDIS_IPPOOL_TEST_SERVER}:30001, %{control.IP-Pool.Name}, 192.168.0.0)
#
# Verify the association with the device has been removed
#
-if !("%(redis:EXISTS {%{control.IP-Pool.Name}}:device:%{Calling-Station-ID})" == '0') {
+if !(%redis(EXISTS, {%{control.IP-Pool.Name}}:device:%{Calling-Station-ID}) == '0') {
test_fail
}
#
# Verify the hash information is retained
#
-if !("%(redis:HGET {%{control.IP-Pool.Name}}:ip:%{reply.Framed-IP-Address} device)" == '00:11:22:33:44:55') {
+if !(%redis(HGET, {%{control.IP-Pool.Name}}:ip:%{reply.Framed-IP-Address}, device) == '00:11:22:33:44:55') {
test_fail
}
-if !("%(redis:HGET {%{control.IP-Pool.Name}}:ip:%{reply.Framed-IP-Address} gateway)" == '127.0.0.1') {
+if !(%redis(HGET, {%{control.IP-Pool.Name}}:ip:%{reply.Framed-IP-Address}, gateway) == '127.0.0.1') {
test_fail
}
-if !("%(redis:HGET {%{control.IP-Pool.Name}}:ip:%{reply.Framed-IP-Address} range)" == '192.168.0.0') {
+if !(%redis(HGET, {%{control.IP-Pool.Name}}:ip:%{reply.Framed-IP-Address}, range) == '192.168.0.0') {
test_fail
}
# Check the ZSCORE
-if !("%(redis:ZSCORE {%{control.IP-Pool.Name}}:pool %{reply.Framed-IP-Address})" == 0) {
+if !(%redis(ZSCORE, {%{control.IP-Pool.Name}}:pool, %{reply.Framed-IP-Address}) == 0) {
test_fail
}
#
# Test static IP allocation using redis_ippool
#
+uint64 zscore
$INCLUDE cluster_reset.inc
&control.IP-Pool.Name := 'test_tool_static'
#
# Add a dynamic IP addresses
#
-&Tmp-String-0 := `./build/bin/local/rlm_redis_ippool_tool -a 192.168.0.1/32 $ENV{REDIS_IPPOOL_TEST_SERVER}:30001 %{control.IP-Pool.Name} 192.168.0.0`
+%exec(./build/bin/local/rlm_redis_ippool_tool, -a, 192.168.0.1/32, $ENV{REDIS_IPPOOL_TEST_SERVER}:30001, %{control.IP-Pool.Name}, 192.168.0.0)
#
# Add a static IP assigned to the calling station in the request
#
-&Tmp-String-0 := `./build/bin/local/rlm_redis_ippool_tool -A 192.168.0.10/32 -O aa:bb:cc:dd:ee:ff $ENV{REDIS_IPPOOL_TEST_SERVER}:30001 %{control.IP-Pool.Name} 192.168.0.0`
+%exec(./build/bin/local/rlm_redis_ippool_tool, -A, 192.168.0.10/32, -O, aa:bb:cc:dd:ee:ff, $ENV{REDIS_IPPOOL_TEST_SERVER}:30001, %{control.IP-Pool.Name}, 192.168.0.0)
#
# Check allocation
#
# Fetch the ZSCORE now on the address
#
-&Tmp-uint64-0 := %(redis:ZSCORE {%{control.IP-Pool.Name}}:pool %{reply.Framed-IP-Address})
+&zscore := %redis(ZSCORE, {%{control.IP-Pool.Name}}:pool, %{reply.Framed-IP-Address})
#
# Attempt to re-assign static lease
#
-&Tmp-String-0 := `./build/bin/local/rlm_redis_ippool_tool -A 192.168.0.10/32 -O aa:bb:cc:dd:ee:ff $ENV{REDIS_IPPOOL_TEST_SERVER}:30001 %{control.IP-Pool.Name} 192.168.0.0`
+%exec(./build/bin/local/rlm_redis_ippool_tool, -A, 192.168.0.10/32, -O, aa:bb:cc:dd:ee:ff, $ENV{REDIS_IPPOOL_TEST_SERVER}:30001, %{control.IP-Pool.Name}, 192.168.0.0)
#
# Check the ZSCORE hasn't changed
#
-if !(%(redis:ZSCORE {%{control.IP-Pool.Name}}:pool %{reply.Framed-IP-Address}) == %{Tmp-uint64-0}) {
+if !(%(redis:ZSCORE {%{control.IP-Pool.Name}}:pool %{reply.Framed-IP-Address}) == %{zscore}) {
test_fail
}
#
# Remove the static assignment - leaves the lease with its remaining time to expire
#
-&Tmp-String-0 := `./build/bin/local/rlm_redis_ippool_tool -U 192.168.0.10/32 -O aa:bb:cc:dd:ee:ff $ENV{REDIS_IPPOOL_TEST_SERVER}:30001 %{control.IP-Pool.Name}`
+%exec(./build/bin/local/rlm_redis_ippool_tool, -U, 192.168.0.10/32, -O, aa:bb:cc:dd:ee:ff, $ENV{REDIS_IPPOOL_TEST_SERVER}:30001, %{control.IP-Pool.Name})
#
# Attempt to assign the address to another device - should fail
#
-&Tmp-String-0 := `./build/bin/local/rlm_redis_ippool_tool -A 192.168.0.10/32 -O aa:bb:cc:dd:ee:00 $ENV{REDIS_IPPOOL_TEST_SERVER}:30001 %{control.IP-Pool.Name} 192.168.0.0`
+%exec(./build/bin/local/rlm_redis_ippool_tool, -A, 192.168.0.10/32, -O, aa:bb:cc:dd:ee:00, $ENV{REDIS_IPPOOL_TEST_SERVER}:30001, %{control.IP-Pool.Name}, 192.168.0.0)
#
# Check the original device is still assigned to the address
#
-if !(%(redis:HGET {%{control.IP-Pool.Name}}:ip:192.168.0.10 'device') == 'aa:bb:cc:dd:ee:ff') {
+if !(%redis(HGET, {%{control.IP-Pool.Name}}:ip:192.168.0.10, 'device') == 'aa:bb:cc:dd:ee:ff') {
test_fail
}
-if !(%(redis:GET {%{control.IP-Pool.Name}}:device:aa:bb:cc:dd:ee:ff) == '192.168.0.10') {
+if !(%redis(GET, {%{control.IP-Pool.Name}}:device:aa:bb:cc:dd:ee:ff) == '192.168.0.10') {
test_fail
}
#
# Attempt to statically assign this to another device
#
-&Tmp-String-0 := `./build/bin/local/rlm_redis_ippool_tool -A 192.168.0.1/32 -O aa:bb:cc:dd:ee:00 $ENV{REDIS_IPPOOL_TEST_SERVER}:30001 %{control.IP-Pool.Name} 192.168.0.0`
+%exec(./build/bin/local/rlm_redis_ippool_tool, -A, 192.168.0.1/32, -O, aa:bb:cc:dd:ee:00, $ENV{REDIS_IPPOOL_TEST_SERVER}:30001, %{control.IP-Pool.Name}, 192.168.0.0)
#
# Check the original device is still assigned to the address and the lease is dynamic
#
-if !(%(redis:HGET {%{control.IP-Pool.Name}}:ip:192.168.0.1 'device') == %{Calling-Station-Id}) {
+if !(%redis(HGET, {%{control.IP-Pool.Name}}:ip:192.168.0.1, 'device') == %{Calling-Station-Id}) {
test_fail
}
-if !(%(redis:GET {%{control.IP-Pool.Name}}:device:11:22:33:44:55:66) == '192.168.0.1') {
+if !(%redis(GET, {%{control.IP-Pool.Name}}:device:11:22:33:44:55:66) == '192.168.0.1') {
test_fail
}
-&Tmp-uint64-1 := %(redis:ZSCORE {%{control.IP-Pool.Name}}:pool 192.168.0.1)
-if !(&Tmp-uint64-1 < (uint64)0x10000000000000) {
+&zscore := %(redis:ZSCORE {%{control.IP-Pool.Name}}:pool 192.168.0.1)
+if !(&zscore < (uint64)0x10000000000000) {
test_fail
}
#
# Now assign it as a static lease for the current device
#
-&Tmp-String-0 := `./build/bin/local/rlm_redis_ippool_tool -A 192.168.0.1/32 -O %{Calling-Station-Id} $ENV{REDIS_IPPOOL_TEST_SERVER}:30001 %{control.IP-Pool.Name} 192.168.0.0`
+%exec(./build/bin/local/rlm_redis_ippool_tool, -A, 192.168.0.1/32, -O, %{Calling-Station-Id}, $ENV{REDIS_IPPOOL_TEST_SERVER}:30001, %{control.IP-Pool.Name}, 192.168.0.0)
#
# Check that the ZSCORE is maintained, simply with the static bit set
#
-if !(%(redis:ZSCORE {%{control.IP-Pool.Name}}:pool 192.168.0.1) == (&Tmp-uint64-1 + %(cast:uint64 0x10000000000000))) {
+if !(%redis(ZSCORE, {%{control.IP-Pool.Name}}:pool, 192.168.0.1) == (&zscore + %(cast:uint64 0x10000000000000))) {
test_fail
}
#
# And that the expiry is now removed on the device
#
-if ("%(redis:TTL {%{control.IP-Pool.Name}}:device:%{Calling-Station-Id})" != '-1') {
+if (%redis(TTL, {%{control.IP-Pool.Name}}:device:%{Calling-Station-Id}) != '-1') {
test_fail
}
#
# Add IP addresses
#
-&Tmp-String-0 := `./build/bin/local/rlm_redis_ippool_tool -a 192.168.0.1/32 $ENV{REDIS_IPPOOL_TEST_SERVER}:30001 %{control.IP-Pool.Name} 192.168.0.0`
+%exec(./build/bin/local/rlm_redis_ippool_tool, -a, 192.168.0.1/32, $ENV{REDIS_IPPOOL_TEST_SERVER}:30001, %{control.IP-Pool.Name}, 192.168.0.0)
#
# Check allocation
#
# Verify the association with the device has been removed
#
-if (!("%(redis:EXISTS {%{control.IP-Pool.Name}}:device:%{Calling-Station-ID})" == '0')) {
+if (!(%redis(EXISTS, {%{control.IP-Pool.Name}}:device:%{Calling-Station-ID}) == '0')) {
test_fail
}
#
# Verify the hash information is retained
#
-if (!("%(redis:HGET {%{control.IP-Pool.Name}}:ip:%{reply.Framed-IP-Address} device)" == '00:11:22:33:44:55')) {
+if (!(%redis(HGET, {%{control.IP-Pool.Name}}:ip:%{reply.Framed-IP-Address}, device) == '00:11:22:33:44:55')) {
test_fail
}
-if (!("%(redis:HGET {%{control.IP-Pool.Name}}:ip:%{reply.Framed-IP-Address} gateway)" == '127.0.0.1')) {
+if (!(%redis(HGET, {%{control.IP-Pool.Name}}:ip:%{reply.Framed-IP-Address}, gateway) == '127.0.0.1')) {
test_fail
}
-if (!("%(redis:HGET {%{control.IP-Pool.Name}}:ip:%{reply.Framed-IP-Address} range)" == '192.168.0.0')) {
+if (!(%redis(HGET, {%{control.IP-Pool.Name}}:ip:%{reply.Framed-IP-Address}, range) == '192.168.0.0')) {
test_fail
}
# Check the ZSCORE - releasing an address sets the ZSCORE to now - 1
-if (%(redis:ZSCORE {%{control.IP-Pool.Name}}:pool %{reply.Framed-IP-Address}) > %c) {
+if (%redis(ZSCORE, {%{control.IP-Pool.Name}}:pool, %{reply.Framed-IP-Address}) > %c) {
test_fail
}
-if ((%c - %(redis:ZSCORE {%{control.IP-Pool.Name}}:pool %{reply.Framed-IP-Address}) > 10)) {
+if ((%c - %redis(ZSCORE, {%{control.IP-Pool.Name}}:pool, %{reply.Framed-IP-Address}) > 10)) {
test_fail
}
#
# Add a dynamic IP addresses
#
-&Tmp-String-0 := `./build/bin/local/rlm_redis_ippool_tool -a 192.168.0.1/32 $ENV{REDIS_IPPOOL_TEST_SERVER}:30001 %{control.IP-Pool.Name} 192.168.0.0`
+%exec(./build/bin/local/rlm_redis_ippool_tool, -a, 192.168.0.1/32, $ENV{REDIS_IPPOOL_TEST_SERVER}:30001, %{control.IP-Pool.Name}, 192.168.0.0)
#
# Add a static IP assigned to the calling station in the request
#
-&Tmp-String-0 := `./build/bin/local/rlm_redis_ippool_tool -A 192.168.0.10/32 -O aa:bb:cc:dd:ee:ff $ENV{REDIS_IPPOOL_TEST_SERVER}:30001 %{control.IP-Pool.Name} 192.168.0.0`
+%exec(./build/bin/local/rlm_redis_ippool_tool, -A, 192.168.0.10/32, -O, aa:bb:cc:dd:ee:ff, $ENV{REDIS_IPPOOL_TEST_SERVER}:30001, %{control.IP-Pool.Name}, 192.168.0.0)
#
# Check allocation
#
# Verify no expiry has been set on device
#
-if ("%(redis:TTL {%{control.IP-Pool.Name}}:device:%{Calling-Station-Id})" != '-1') {
+if (%redis(TTL, {%{control.IP-Pool.Name}}:device:%{Calling-Station-Id}) != '-1') {
test_fail
}
#
# Verify the association with the device remains
#
-if ("%(redis:EXISTS {%{control.IP-Pool.Name}}:device:%{Calling-Station-ID})" == '0') {
+if (%redis(EXISTS, {%{control.IP-Pool.Name}}:device:%{Calling-Station-ID}) == '0') {
test_fail
}
#
# Verify the hash information is retained
#
-if ("%(redis:EXISTS {%{control.IP-Pool.Name}}:ip:%{reply.Framed-IP-Address})" == '0') {
+if (%redis(EXISTS, {%{control.IP-Pool.Name}}:ip:%{reply.Framed-IP-Address}) == '0') {
test_fail
}
# Check the ZSCORE
-if ("%(redis:ZSCORE {%{control.IP-Pool.Name}%}:pool %{reply.Framed-IP-Address})" <= %l) {
+if (%redis(ZSCORE, {%{control.IP-Pool.Name}%}:pool, %{reply.Framed-IP-Address}) <= %l) {
test_fail
}
#
# Add a static IP assigned to a calling station not in the request
#
-&Tmp-String-0 := `./build/bin/local/rlm_redis_ippool_tool -A 192.168.0.10/32 -O aa:bb:cc:dd:ee:ff $ENV{REDIS_IPPOOL_TEST_SERVER}:30001 %{control.IP-Pool.Name} 192.168.0.0`
+%exec(./build/bin/local/rlm_redis_ippool_tool, -A, 192.168.0.10/32, -O, aa:bb:cc:dd:ee:ff, $ENV{REDIS_IPPOOL_TEST_SERVER}:30001, %{control.IP-Pool.Name}, 192.168.0.0)
#
# Check allocation fails - pool only contains an address assigned to another owner
#
# Add a dynamic IP addresses
#
-&Tmp-String-0 := `./build/bin/local/rlm_redis_ippool_tool -a 192.168.0.1/32 $ENV{REDIS_IPPOOL_TEST_SERVER}:30001 %{control.IP-Pool.Name} 192.168.0.0`
+%exec(./build/bin/local/rlm_redis_ippool_tool, -a, 192.168.0.1/32, $ENV{REDIS_IPPOOL_TEST_SERVER}:30001, %{control.IP-Pool.Name}, 192.168.0.0)
#
# Check allocation
#
# Add a dynamic IP addresses
#
-&Tmp-String-0 := `./build/bin/local/rlm_redis_ippool_tool -a 192.168.0.1/32 $ENV{REDIS_IPPOOL_TEST_SERVER}:30001 %{control.IP-Pool.Name} 192.168.0.0`
+%exec(./build/bin/local/rlm_redis_ippool_tool, -a, 192.168.0.1/32, $ENV{REDIS_IPPOOL_TEST_SERVER}:30001, %{control.IP-Pool.Name}, 192.168.0.0)
#
# Add a static IP assigned to the calling station in the request
#
-&Tmp-String-0 := `./build/bin/local/rlm_redis_ippool_tool -A 192.168.0.10/32 -O aa:bb:cc:dd:ee:ff $ENV{REDIS_IPPOOL_TEST_SERVER}:30001 %{control.IP-Pool.Name} 192.168.0.0`
+%exec(./build/bin/local/rlm_redis_ippool_tool, -A, 192.168.0.10/32, -O, aa:bb:cc:dd:ee:ff, $ENV{REDIS_IPPOOL_TEST_SERVER}:30001, %{control.IP-Pool.Name}, 192.168.0.0)
#
# Check allocation
#
# Un-assign static allocation
#
-&Tmp-String-0 := `./build/bin/local/rlm_redis_ippool_tool -U 192.168.0.10/32 -O aa:bb:cc:dd:ee:ff $ENV{REDIS_IPPOOL_TEST_SERVER}:30001 %{control.IP-Pool.Name}`
+%exec(./build/bin/local/rlm_redis_ippool_tool, -U, 192.168.0.10/32, -O, aa:bb:cc:dd:ee:ff, $ENV{REDIS_IPPOOL_TEST_SERVER}:30001, %{control.IP-Pool.Name})
#
# Check ZSCORE is now < 2^52 - the "static bit"
#
-if (%(redis:ZSCORE {%{control.IP-Pool.Name}}:pool %{reply.Framed-IP-Address}) >= %(cast:uint64 0x10000000000000)) {
+if (%redis(ZSCORE, {%{control.IP-Pool.Name}}:pool, %{reply.Framed-IP-Address}) >= %(cast:uint64 0x10000000000000)) {
test_fail
}
# This is based on the initial lease duration given (of 30 sec) but will have reduced
# due to elapsed time since the allocation.
#
-if ("%(redis:TTL {%{control.IP-Pool.Name}}:device:%{Calling-Station-Id})" < 20) {
+if (%redis(TTL, {%{control.IP-Pool.Name}}:device:%{Calling-Station-Id}) < 20) {
test_fail
}
#
# Verify the association with the device is removed
#
-if ("%(redis:EXISTS {%{control.IP-Pool.Name}}:device:%{Calling-Station-ID})" != '0') {
+if (%redis(EXISTS, {%{control.IP-Pool.Name}}:device:%{Calling-Station-ID}) != '0') {
test_fail
}
# Check the ZSCORE
-if ("%(redis:ZSCORE {%{control.IP-Pool.Name}%}:pool %{reply.Framed-IP-Address})" > %l) {
+if (%redis(ZSCORE, {%{control.IP-Pool.Name}%}:pool, %{reply.Framed-IP-Address}) > %l) {
test_fail
}
#
# Delete original dynamic address - so only the previously static one remains
#
-&Tmp-String-0 := `./build/bin/local/rlm_redis_ippool_tool -d 192.168.0.1/32 $ENV{REDIS_IPPOOL_TEST_SERVER}:30001 %{control.IP-Pool.Name}`
+%exec(./build/bin/local/rlm_redis_ippool_tool, -d, 192.168.0.1/32, $ENV{REDIS_IPPOOL_TEST_SERVER}:30001, %{control.IP-Pool.Name})
#
# Perform IP allocation for alternative device
#
# Verify the IP hash has been set to point to the new device
#
-if !("%(redis:HGET {%{control.IP-Pool.Name}}:ip:%{reply.Framed-IP-Address} 'device')" == '00:11:22:33:44:55') {
+if !(%redis(HGET, {%{control.IP-Pool.Name}}:ip:%{reply.Framed-IP-Address}, device) == '00:11:22:33:44:55') {
test_fail
}
#
# Add IP addresses
#
-&Tmp-String-0 := `./build/bin/local/rlm_redis_ippool_tool -a 192.168.0.1/32 $ENV{REDIS_IPPOOL_TEST_SERVER}:30001 %{control.IP-Pool.Name} 192.168.0.0`
+%exec(./build/bin/local/rlm_redis_ippool_tool, -a, 192.168.0.1/32, $ENV{REDIS_IPPOOL_TEST_SERVER}:30001, %{control.IP-Pool.Name}, 192.168.0.0)
# 1. Check allocation
redis_ippool
}
# 4. Verify the gateway was set
-if !(%redis('HGET', "{%{control.IP-Pool.Name}}:ip:%{reply.Framed-IP-Address}", 'gateway') == '127.0.0.1') {
+if !(%redis(HGET, {%{control.IP-Pool.Name}}:ip:%{reply.Framed-IP-Address}, gateway) == '127.0.0.1') {
test_fail
}
# 5. Add another IP addresses
-&Tmp-String-0 := `./build/bin/local/rlm_redis_ippool_tool -a 192.168.1.1/32 $ENV{REDIS_IPPOOL_TEST_SERVER}:30001 %{control.IP-Pool.Name} 192.168.1.0`
+%exec(./build/bin/local/rlm_redis_ippool_tool, -a, 192.168.1.1/32, $ENV{REDIS_IPPOOL_TEST_SERVER}:30001, %{control.IP-Pool.Name}, 192.168.1.0)
# 6. Verify that the lease time is extended
&Framed-IP-Address := &reply.Framed-IP-Address
}
# 8. Check ZSCORE reflects that
-if !((%redis('ZSCORE', "{%{control.IP-Pool.Name}}:pool", "%{reply.Framed-IP-Address}") - %l) > 50) {
+if !((%redis(ZSCORE, {%{control.IP-Pool.Name}}:pool, %{reply.Framed-IP-Address}) - %l) > 50) {
test_fail
}
# 9.
-if !((%redis('ZSCORE', "{%{control.IP-Pool.Name}}:pool", "%{reply.Framed-IP-Address}") - %l) < 70) {
+if !((%redis(ZSCORE, {%{control.IP-Pool.Name}}:pool, %{reply.Framed-IP-Address}) - %l) < 70) {
test_fail
}
# 10. Verify the lease is still associated with the device
-if !(&reply.Framed-IP-Address == %redis('GET', "{%{control.IP-Pool.Name}}:device:%{Calling-Station-ID}")) {
+if !(&reply.Framed-IP-Address == %redis(GET, {%{control.IP-Pool.Name}}:device:%{Calling-Station-ID})) {
test_fail
}
# 11. And that the device object will expire a suitable number of seconds into the future
-if !(%redis('TTL', "{%{control.IP-Pool.Name}}:device:%{Calling-Station-ID}") == 60) {
+if !(%redis(TTL, {%{control.IP-Pool.Name}}:device:%{Calling-Station-ID}) == 60) {
test_fail
}
# 12. Verify the gateway was updated
-if !(%redis('HGET', "{%{control.IP-Pool.Name}}:ip:%{Framed-IP-Address}", 'gateway') == '127.0.0.2') {
+if !(%redis(HGET, {%{control.IP-Pool.Name}}:ip:%{Framed-IP-Address}, gateway) == '127.0.0.2') {
test_fail
}
}
# 16. Verify the lease is still associated with the previous device
-if !(&reply.Framed-IP-Address == %redis('GET', "{%{control.IP-Pool.Name}}:device:00:11:22:33:44:55")) {
+if !(&reply.Framed-IP-Address == %redis(GET, {%{control.IP-Pool.Name}}:device:00:11:22:33:44:55)) {
test_fail
}
#
# Add IP addresses
#
-&Tmp-String-0 := `./build/bin/local/rlm_redis_ippool_tool -a 192.168.0.1/32 $ENV{REDIS_IPPOOL_TEST_SERVER}:30001 %{control.IP-Pool.Name} 192.168.0.0`
+%exec(./build/bin/local/rlm_redis_ippool_tool, -a, 192.168.0.1/32, $ENV{REDIS_IPPOOL_TEST_SERVER}:30001, %{control.IP-Pool.Name}, 192.168.0.0)
# 1. Check allocation
redis_ippool
}
# 4. Verify the gateway was set
-if !("%(redis:HGET {%{control.IP-Pool.Name}}:ip:%{reply.Framed-IP-Address} gateway)" == '127.0.0.1') {
+if !(%redis(HGET, {%{control.IP-Pool.Name}}:ip:%{reply.Framed-IP-Address}, gateway) == '127.0.0.1') {
test_fail
}