]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Remove Tmp- variables from redis ippool tests
authorNick Porter <nick@portercomputing.co.uk>
Fri, 5 Jan 2024 11:09:20 +0000 (11:09 +0000)
committerNick Porter <nick@portercomputing.co.uk>
Fri, 5 Jan 2024 11:09:20 +0000 (11:09 +0000)
src/tests/modules/redis_ippool/alloc.unlang
src/tests/modules/redis_ippool/pool_tool_delete.unlang
src/tests/modules/redis_ippool/pool_tool_modify.unlang
src/tests/modules/redis_ippool/pool_tool_release.unlang
src/tests/modules/redis_ippool/pool_tool_static.unlang
src/tests/modules/redis_ippool/release.unlang
src/tests/modules/redis_ippool/static.unlang
src/tests/modules/redis_ippool/static_dynamic.unlang
src/tests/modules/redis_ippool/static_unassign.unlang
src/tests/modules/redis_ippool/update.unlang
src/tests/modules/redis_ippool/update_alloc.unlang

index a5e19feedd8250dedbfb54581e924b47fc31cec9..5505546b49f436ff3ecbb93710cb1c1c002fbd1d 100644 (file)
@@ -8,7 +8,7 @@ $INCLUDE cluster_reset.inc
 #
 #  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
@@ -75,7 +75,7 @@ if !(&reply.Session-Timeout == 30) {
 #
 #  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
index ebc65fd63519f6e88675c466e063b6114434cfaf..313e0f8e5fcd97a31f30cd065739489b36127bed 100644 (file)
@@ -8,7 +8,7 @@ $INCLUDE cluster_reset.inc
 #
 #  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
@@ -27,24 +27,24 @@ if !(&reply.Framed-IP-Address == 192.168.0.1) {
 #
 #  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
 }
 
index 629f5d6517fa5c02b7e4a3052eb73ea9e379e9ca..8df47d93b1a2bf4d68227a5817c785edadf47e01 100644 (file)
@@ -8,24 +8,24 @@ $INCLUDE cluster_reset.inc
 #
 #  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
 }
 
index af455202560360f33cd6328e02b5b4231cc1fb3b..1be1b98e8a1c0590e5a00d7d27f2904608687bd1 100644 (file)
@@ -8,7 +8,7 @@ $INCLUDE cluster_reset.inc
 #
 #  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
@@ -27,32 +27,32 @@ if !(&reply.Framed-IP-Address == 192.168.0.1) {
 #
 #  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
 }
 
index ad067e1b2a0e96bd5edaa12037576df47b2be448..5e5a36f2d6a28c55e048aa3ce443c9b677aee55f 100644 (file)
@@ -1,6 +1,7 @@
 #
 #  Test static IP allocation using redis_ippool
 #
+uint64 zscore
 $INCLUDE cluster_reset.inc
 
 &control.IP-Pool.Name := 'test_tool_static'
@@ -8,12 +9,12 @@ $INCLUDE cluster_reset.inc
 #
 #  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
@@ -32,37 +33,37 @@ if !(&reply.Framed-IP-Address == 192.168.0.10) {
 #
 #  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
 }
 
@@ -85,39 +86,39 @@ if !(&reply.Framed-IP-Address == 192.168.0.1) {
 #
 #  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
 }
 
index 97fc1204d609e7acc667c5bd0c176c9f7c7cf70a..f24112deb456c794221b4bae5620252aa8b04ced 100644 (file)
@@ -8,7 +8,7 @@ $INCLUDE cluster_reset.inc
 #
 #  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
@@ -39,31 +39,31 @@ if (!(updated)) {
 #
 #  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
 }
 
index a23a0a7f136ca2be5f0508ccce245785bef7af4e..9ff478f44d04b7cedb981b9c807c030ef378b241 100644 (file)
@@ -8,12 +8,12 @@ $INCLUDE cluster_reset.inc
 #
 #  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
@@ -49,7 +49,7 @@ redis_ippool.renew {
 #
 #  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
 }
 
@@ -73,19 +73,19 @@ if (!(updated)) {
 #
 #  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
 }
 
index 116827a8fc130d303f6450fd302a2d1c945c5e4d..a2e1817765e18d160238491e585c1c2272fbf653 100644 (file)
@@ -8,7 +8,7 @@ $INCLUDE cluster_reset.inc
 #
 #  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
@@ -23,7 +23,7 @@ if (!notfound) {
 #
 #  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
index d511dcc262bfcfecc55995bd5f95f7f959a1e8d9..a3ea7dac2e355c9a109f2446c0839cefd85a011a 100644 (file)
@@ -8,12 +8,12 @@ $INCLUDE cluster_reset.inc
 #
 #  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
@@ -40,12 +40,12 @@ if (!(&reply.Session-Timeout == 30)) {
 #
 #  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
 }
 
@@ -54,7 +54,7 @@ if (%(redis:ZSCORE {%{control.IP-Pool.Name}}:pool %{reply.Framed-IP-Address}) >=
 #  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
 }
 
@@ -80,19 +80,19 @@ if (!updated) {
 #
 #  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
@@ -117,7 +117,7 @@ if !(&reply.Framed-IP-Address == '192.168.0.10') {
 #
 #  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
 }
 
index ad593047e98c316591a703bc9422abfed5be2992..428c6c6545fdea6e43804facb78b15d3877aa54d 100644 (file)
@@ -8,7 +8,7 @@ $INCLUDE cluster_reset.inc
 #
 #  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
@@ -27,12 +27,12 @@ if !(&reply.Session-Timeout == 30) {
 }
 
 # 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
@@ -49,27 +49,27 @@ if !(&reply.Session-Timeout == 60) {
 }
 
 # 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
 }
 
@@ -101,7 +101,7 @@ if (!invalid) {
 }
 
 # 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
 }
 
index c076631bccfb679e5d9aa9f03188f3edf24f5686..e7b2e5fe9dab8d93bc830638f1c987cb9c327232 100644 (file)
@@ -8,7 +8,7 @@ $INCLUDE cluster_reset.inc
 #
 #  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
@@ -30,7 +30,7 @@ if !(&reply.Session-Timeout == 60) {
 }
 
 # 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
 }