&Class = 0x090a0b0c,
}
-if (%{Class[#]} != 3) {
+if (!(%{Class[#]} == 3)) {
test_fail
}
-if (&Class[0] != 0x01020304) {
+if (!(&Class[0] == 0x01020304)) {
test_fail
}
-if (&Class[1] != 0x05060708) {
+if (!(&Class[1] == 0x05060708)) {
test_fail
}
-if (&Class[2] != 0x090a0b0c) {
+if (!(&Class[2] == 0x090a0b0c)) {
test_fail
}
}
# Last element of the array
-if (&Class[n] != 0x090a0b0c) {
+if (!(&Class[n] == 0x090a0b0c)) {
test_fail
}
&Tmp-String-0[1] := "yellow"
-if ("%{Tmp-String-0[*]}" != "fooyellowbaz") {
+if (!("%{Tmp-String-0[*]}" == "fooyellowbaz")) {
test_fail
}
&Tmp-String-0[2] += "red"
-if ("%{Tmp-String-0[*]}" != "fooyellowbazred") {
+if (!("%{Tmp-String-0[*]}" == "fooyellowbazred")) {
test_fail
}
&Tmp-String-0[2] -= "red"
-if ("%{Tmp-String-0[*]}" != "fooyellowbaz") {
+if (!("%{Tmp-String-0[*]}" == "fooyellowbaz")) {
test_fail
}
&Tmp-String-0[0] := "oof"
-if ("%{Tmp-String-0[*]}" != "oofyellowbaz") {
+if (!("%{Tmp-String-0[*]}" == "oofyellowbaz")) {
test_fail
}
&Tmp-String-0[1] := "bar"
-if ("%{Tmp-String-0[*]}" != "oofbarbaz") {
+if (!("%{Tmp-String-0[*]}" == "oofbarbaz")) {
test_fail
}
}
# String - bin 0x39383730
-if (&Tmp-String-0[0] != 'OTg3MA==') {
+if (!(&Tmp-String-0[0] == 'OTg3MA==')) {
test_fail
}
# Octets - bin 0x39383731
-if (&Tmp-String-1[0] != 'OTg3MQ==') {
+if (!(&Tmp-String-1[0] == 'OTg3MQ==')) {
test_fail
}
# IP Address - bin 0x39383732
-if (&Tmp-String-2[0] != 'OTg3Mg==') {
+if (!(&Tmp-String-2[0] == 'OTg3Mg==')) {
test_fail
}
# Integer - bin 0x39383734
-if (&Tmp-String-4[0] != 'OTg3NA==') {
+if (!(&Tmp-String-4[0] == 'OTg3NA==')) {
test_fail
}
# ifid - bin 0x0000000039383737
-if (&Tmp-String-6[0] != 'AAAAADk4Nzc=') {
+if (!(&Tmp-String-6[0] == 'AAAAADk4Nzc=')) {
test_fail
}
# ipv6addr - bin 0x00000000000000000000000039383738
-if (&Tmp-String-7[0] != 'AAAAAAAAAAAAAAAAOTg3OA==') {
+if (!(&Tmp-String-7[0] == 'AAAAAAAAAAAAAAAAOTg3OA==')) {
test_fail
}
# ipv6addrprefix - bin 0x008000000000000000000000000039383739
-if (&Tmp-String-8[0] != 'AIAAAAAAAAAAAAAAAAA5ODc5') {
+if (!(&Tmp-String-8[0] == 'AIAAAAAAAAAAAAAAAAA5ODc5')) {
test_fail
}
# byte - bin 0x3a
-if (&Tmp-String-9[0] != 'Og==') {
+if (!(&Tmp-String-9[0] == 'Og==')) {
test_fail
}
}
# short - bin 0x373b
-if (&Tmp-String-0[0] != 'Nzs=') {
+if (!(&Tmp-String-0[0] == 'Nzs=')) {
test_fail
}
# ethernet - bin 0x00003938373c
-if (&Tmp-String-1[0] != 'AAA5ODc8') {
+if (!(&Tmp-String-1[0] == 'AAA5ODc8')) {
test_fail
}
# integer64 - bin 0x100000003938373d
-if (&Tmp-String-2[0] != 'EAAAADk4Nz0=') {
+if (!(&Tmp-String-2[0] == 'EAAAADk4Nz0=')) {
test_fail
}
# ipv4prefix - bin 0x203938373e
-if (&Tmp-String-3[0] != 'IDk4Nz4=') {
+if (!(&Tmp-String-3[0] == 'IDk4Nz4=')) {
test_fail
}
&Tmp-Octets-1 = "%{base64decode:AIAAAAAAAAAAAAAAAAA5ODc5}"
}
-if (&Tmp-Octets-0 != "foo") {
+if (!(&Tmp-Octets-0 == "foo")) {
+ debug_request
test_fail
}
-if (&Tmp-Octets-1 != 0x008000000000000000000000000039383739) {
+if (!(&Tmp-Octets-1 == 0x008000000000000000000000000039383739)) {
test_fail
}
&request -= &Tmp-Octets-0[*]
&Tmp-Octets-0 := %{base64decode:5RNqNl8iYLbkCc7JhR8as4TtDDCX6otuuWtcja8rITUyx9zrnHSe9tTHGmKK}
-if (&Tmp-Octets-0 != 0xe5136a365f2260b6e409cec9851f1ab384ed0c3097ea8b6eb96b5c8daf2b213532c7dceb9c749ef6d4c71a628a) {
+if (!(&Tmp-Octets-0 == 0xe5136a365f2260b6e409cec9851f1ab384ed0c3097ea8b6eb96b5c8daf2b213532c7dceb9c749ef6d4c71a628a)) {
test_fail
}
&request -= &Tmp-Octets-0[*]
&Tmp-Octets-0 = "%{base64decode:eHfXPKZ+2iv9cnMV1MOmE/moYYA1Uk5xTmw4aVlMYmtDYzdKaFI4YXM0VHRERENYNm90dXVXdGNqYThySVRVeXg5enJuSFNlOXRUSEdtS0s=}"
-if (&Tmp-Octets-0 != 0x7877d73ca67eda2bfd727315d4c3a613f9a8618035524e714e6c3869594c626b4363374a685238617334547444444358366f7475755774636a6138724954557978397a726e48536539745448476d4b4b) {
+if (!(&Tmp-Octets-0 == 0x7877d73ca67eda2bfd727315d4c3a613f9a8618035524e714e6c3869594c626b4363374a685238617334547444444358366f7475755774636a6138724954557978397a726e48536539745448476d4b4b)) {
test_fail
}
success
&NAS-IP-Address := 0.0.0.0
&Framed-IP-Address := 255.255.255.255
-if (!(&NAS-IP-Address != &Framed-IP-Address)) {
+if (!(!(&NAS-IP-Address == &Framed-IP-Address))) {
test_fail
}
&Reply-Message = "I am #literally a comment #"
}
-if (&Tmp-String-0 != 'candy') {
+if (!(&Tmp-String-0 == 'candy')) {
test_fail
}
# Convert string to integer
&Tmp-Integer-1 := %(integer:%(date:%{Tmp-String-0}))
-if (&Tmp-Integer-1 != &Tmp-Integer-0) {
+if (!(&Tmp-Integer-1 == &Tmp-Integer-0)) {
test_fail
}
&Tmp-String-0 := %(localdate:request)
&Tmp-String-1 := "%S"
-if (&Tmp-String-0 != &Tmp-String-1) {
+if (!(&Tmp-String-0 == &Tmp-String-1)) {
test_fail
}
&Tmp-Integer-2 := %(integer:%(sqldate:%{Tmp-String-2}))
-if (&Tmp-Integer-2 != &Tmp-Integer-0) {
+if (!(&Tmp-Integer-2 == &Tmp-Integer-0)) {
test_fail
}
&Tmp-Integer-0 := "%(debug:4)"
# Check debug level is now 4
-if ("%(debug:3)" != 4) {
+if (!("%(debug:3)" == 4)) {
test_fail
}
# Call with NULL arg, should report current level
-if ("%(debug:%{Tmp-String-8})" != 3) {
+if (!("%(debug:%{Tmp-String-8})" == 3)) {
test_fail
}
# ...and again
-if ("%(debug:%{Tmp-String-8})" != 3) {
+if (!("%(debug:%{Tmp-String-8})" == 3)) {
test_fail
}
# ...and again
-if ("%(debug:)" != 3) {
+if (!("%(debug:)" == 3)) {
test_fail
}
# ...and again
-if ("%(debug:)" != 3) {
+if (!("%(debug:)" == 3)) {
test_fail
}
#
&Tmp-Integer-0 += 5
-if (&Tmp-Integer-0 != 9) {
+if (!(&Tmp-Integer-0 == 9)) {
test_fail
}
&Tmp-Integer-0 += &Tmp-Integer-1
-if (&Tmp-Integer-0 != 15) {
+if (!(&Tmp-Integer-0 == 15)) {
test_fail
}
&Tmp-String-2 := "bar"
}
-if (&Tmp-String-0 != "foo") {
+if (!(&Tmp-String-0 == "foo")) {
test_fail
}
-if (&Tmp-String-1 != "yup") {
+if (!(&Tmp-String-1 == "yup")) {
test_fail
}
-if (&Tmp-String-2 != "bar") {
+if (!(&Tmp-String-2 == "bar")) {
test_fail
}
}
# and have the correct value
-if (&reply.Tmp-String-0 != "foo") {
+if (!(&reply.Tmp-String-0 == "foo")) {
test_fail
}
&Tmp-String-3 := { &Tmp-String-0, "bar", "%{Tmp-String-0}", %{Tmp-String-2} }
-if (%{Tmp-String-3[#]} != 4) {
+if (!(%{Tmp-String-3[#]} == 4)) {
test_fail
}
-if ("%{Tmp-String-3[*]}" != "foobarfooTmp-String-0") {
+if (!("%{Tmp-String-3[*]}" == "foobarfooTmp-String-0")) {
test_fail
}
&User-Name
}
-if (%{request.Tmp-String-0[#]} != 4) {
+if (!(%{request.Tmp-String-0[#]} == 4)) {
test_fail
}
-if (&Tmp-String-0[0] != "foo") {
+if (!(&Tmp-String-0[0] == "foo")) {
test_fail
}
-if (&Tmp-String-0[1] != "bar") {
+if (!(&Tmp-String-0[1] == "bar")) {
test_fail
}
-if (&Tmp-String-0[2] != "baz") {
+if (!(&Tmp-String-0[2] == "baz")) {
test_fail
}
-if (&Tmp-String-0[3] != "bob") {
+if (!(&Tmp-String-0[3] == "bob")) {
test_fail
}
test_fail
}
-if (&Framed-IP-Address != 127.0.0.1) {
+if (!(&Framed-IP-Address == 127.0.0.1)) {
test_fail
}
# Do operations on sets of inputs.
#
&Tmp-Integer-1 += &Tmp-Integer-0[*]
-if (&Tmp-Integer-1 != 27) {
+if (!(&Tmp-Integer-1 == 27)) {
test_fail
}
# Do operations on sets of inputs.
#
&Tmp-Integer-1 += &Tmp-Integer-2[*]
-if (&Tmp-Integer-1 != 27) {
+if (!(&Tmp-Integer-1 == 27)) {
test_fail
}
&control.Tmp-String-0 := { "a", "b", "c", "d" }
&request += &control.Tmp-String-0[*]
-if (%{request.Tmp-String-0[#]} != 4) {
+if (!(%{request.Tmp-String-0[#]} == 4)) {
test_fail
}
&request -= &Tmp-String-0[0]
# the first one has been removed
-if (&Tmp-String-0[0] != "bar") {
+if (!(&Tmp-String-0[0] == "bar")) {
test_fail
}
&Tmp-String-0 == "bar"
}
-if (&Tmp-String-0[0] != "foo") {
+if (!(&Tmp-String-0[0] == "foo")) {
test_fail
}
-if (&Tmp-String-0[1] != "baz") {
+if (!(&Tmp-String-0[1] == "baz")) {
test_fail
}
# Remove via in-place list, too.
#
&request -= "Tmp-String-0 == 'foo'"
-if (&Tmp-String-0[0] != "baz") {
+if (!(&Tmp-String-0[0] == "baz")) {
test_fail
}
# Do operations on sets of inputs.
#
&Tmp-Integer-1 += &Tmp-Group-0.Tmp-Integer-0[*]
-if (&Tmp-Integer-1 != 27) {
+if (!(&Tmp-Integer-1 == 27)) {
test_fail
}
&Tmp-Integer-1 := 0
&Tmp-Integer-1 += &Tmp-Group-1.Tmp-Integer-0[*]
-if (&Tmp-Integer-1 != 27) {
+if (!(&Tmp-Integer-1 == 27)) {
test_fail
}
#
&control += "Tmp-Integer-0 = 9"
-if (&control.Tmp-Integer-0 != 9) {
+if (!(&control.Tmp-Integer-0 == 9)) {
test_fail
}
test_fail
}
-if (&control.Tmp-Group-0.Tmp-Integer-0 != 1) {
+if (!(&control.Tmp-Group-0.Tmp-Integer-0 == 1)) {
test_fail
}
#
&control.Tmp-Group-0.Tmp-Integer-0 += 5
-if (&control.Tmp-Group-0.Tmp-Integer-0 != 6) {
+if (!(&control.Tmp-Group-0.Tmp-Integer-0 == 6)) {
test_fail
}
&Tmp-IP-Address-0 = 127.0.0.1
}
-if (&control.Tmp-Group-0.Tmp-IP-Address-0 != 127.0.0.1) {
+if (!(&control.Tmp-Group-0.Tmp-IP-Address-0 == 127.0.0.1)) {
test_fail
}
&Tmp-Octets-0 = 0xabcdef
}
-if (&control.Tmp-Group-0.Tmp-IP-Address-0 != 127.0.0.1) {
+if (!(&control.Tmp-Group-0.Tmp-IP-Address-0 == 127.0.0.1)) {
test_fail
}
-if (&control.Tmp-Group-0.Tmp-Octets-0 != 0xabcdef) {
+if (!(&control.Tmp-Group-0.Tmp-Octets-0 == 0xabcdef)) {
test_fail
}
&Tmp-String-0 := "foo"
&Tmp-String-0 ^= "bar"
-if (&Tmp-String-0 != "barfoo") {
+if (!(&Tmp-String-0 == "barfoo")) {
test_fail
}
&Tmp-String-0 := "foo"
&Tmp-String-0 += "bar"
-if (&Tmp-String-0 != "foobar") {
+if (!(&Tmp-String-0 == "foobar")) {
test_fail
}
#
&Tmp-String-0 -= "bar"
-if (&Tmp-String-0 != "foo") {
+if (!(&Tmp-String-0 == "foo")) {
test_fail
}
}
# The original value should be unchanged
-if (&Tmp-String-0[0] != "foo") {
+if (!(&Tmp-String-0[0] == "foo")) {
test_fail
}
# and the new value should be there, too
-if (&Tmp-String-0[1] != "bar") {
+if (!(&Tmp-String-0[1] == "bar")) {
test_fail
}
# = not followed by hex and without 2 following chars
&Tmp-String-8 := 'a=Az=y'
-if (<string>"%{escape:%{Tmp-String-0}}" != &Tmp-String-0) {
+if (!(<string>"%{escape:%{Tmp-String-0}}" == &Tmp-String-0)) {
test_fail
}
-if (<string>"%{escape:%{Tmp-String-1}}" != &Tmp-String-3) {
+if (!(<string>"%{escape:%{Tmp-String-1}}" == &Tmp-String-3)) {
test_fail
}
-if (<string>"%{escape:%{Tmp-String-2}}" != &Tmp-String-4) {
+if (!(<string>"%{escape:%{Tmp-String-2}}" == &Tmp-String-4)) {
test_fail
}
-if (<string>"%{unescape:%{Tmp-String-0}}" != &Tmp-String-0) {
+if (!(<string>"%{unescape:%{Tmp-String-0}}" == &Tmp-String-0)) {
test_fail
}
-if (<string>"%{unescape:%{Tmp-String-3}}" != "%{Tmp-String-1}") {
+if (!(<string>"%{unescape:%{Tmp-String-3}}" == "%{Tmp-String-1}")) {
test_fail
}
-if (<string>"%{unescape:%{Tmp-String-4}}" != &Tmp-String-2) {
+if (!(<string>"%{unescape:%{Tmp-String-4}}" == &Tmp-String-2)) {
test_fail
}
-if (<string>"%{escape:%{Tmp-String-6}}" != &Tmp-String-7) {
+if (!(<string>"%{escape:%{Tmp-String-6}}" == &Tmp-String-7)) {
test_fail
}
-if (<string>"%{unescape:%{Tmp-String-7}}" != &Tmp-String-6) {
+if (!(<string>"%{unescape:%{Tmp-String-7}}" == &Tmp-String-6)) {
test_fail
}
-if (<string>"%{unescape:%{Tmp-String-8}}" != &Tmp-String-8) {
+if (!(<string>"%{unescape:%{Tmp-String-8}}" == &Tmp-String-8)) {
test_fail
}
}
-if ("%(length:%{Tmp-String-0})" != 39) {
+if (!("%(length:%{Tmp-String-0})" == 39)) {
test_fail
}
-if ("%(length:%{Tmp-String-1})" != 42) {
+if (!("%(length:%{Tmp-String-1})" == 42)) {
test_fail
}
}
&Tmp-String-8 := "%{string:%{Tmp-Octets-1}}"
-if (&Tmp-String-8 != "0x01\0010x07\0070x0A\n0x0D\r\"\"0xb0\260°") {
+if (!(&Tmp-String-8 == "0x01\0010x07\0070x0A\n0x0D\r\"\"0xb0\260°")) {
test_fail
}
test_fail
}
-if ("%{Tmp-String-0[1]}" != "0x01\0010x07\0070x0A\n0x0D\r\"\"0xb0\260°") {
+if (!("%{Tmp-String-0[1]}" == "0x01\0010x07\0070x0A\n0x0D\r\"\"0xb0\260°")) {
test_fail
}
test_fail
}
-if (&Tmp-String-0[0] != &Tmp-String-0[0]) {
+if (!(&Tmp-String-0[0] == &Tmp-String-0[0])) {
test_fail
}
# This seems weird... double escapes for most things, but single escapes
# for the quotation marks.
#
-if ("%{Tmp-String-2[1]}" != "0x01\0010x07\0070x0A\n0x0D\r''0xb0\260°") {
+if (!("%{Tmp-String-2[1]}" == "0x01\0010x07\0070x0A\n0x0D\r''0xb0\260°")) {
test_fail
}
#
# And again as an attribute reference
#
-if (&Tmp-String-2[1] != "0x01\0010x07\0070x0A\n0x0D\r''0xb0\260°") {
+if (!(&Tmp-String-2[1] == "0x01\0010x07\0070x0A\n0x0D\r''0xb0\260°")) {
test_fail
}
# Other data types
#
&Tmp-String-0 := "%{string:&Tmp-IP-Address-0}"
-if ("%(length:%{Tmp-String-0})" != 17) {
+if (!("%(length:%{Tmp-String-0})" == 17)) {
test_fail
}
&Tmp-Octets-0 = 0x001122334456,
}
-if (&Tmp-Ethernet-0[0] != 00:11:22:33:44:54) {
+if (!(&Tmp-Ethernet-0[0] == 00:11:22:33:44:54)) {
test_fail
}
-if (&Tmp-Ethernet-0[1] != 00:11:22:33:44:55) {
+if (!(&Tmp-Ethernet-0[1] == 00:11:22:33:44:55)) {
test_fail
}
&Tmp-Ethernet-0 = &Tmp-Octets-0[0]
}
-if (&Tmp-Ethernet-0[2] != 00:11:22:33:44:56) {
+if (!(&Tmp-Ethernet-0[2] == 00:11:22:33:44:56)) {
test_fail
}
&Tmp-Ethernet-0 = %{Tmp-Ethernet-1[42]}
}
-if (%{request.Tmp-Ethernet-0[#]} != 3) {
+if (!(%{request.Tmp-Ethernet-0[#]} == 3)) {
test_fail
}
test_fail
}
-if ((&Tmp-String-0[0] != '0') || (&Tmp-String-0[1] != '1') || (&Tmp-String-0[2] != '2') || (&Tmp-String-0[3] != '3')) {
+if (!((&Tmp-String-0[0] == '0')) || (!(&Tmp-String-0[1] == '1')) || (&Tmp-String-0[2] != '2') || (&Tmp-String-0[3] != '3')) {
test_fail
}
}
}
-if (&control.Tmp-String-1 != 'ssid=GHIJKL') {
+if (!(&control.Tmp-String-1 == 'ssid=GHIJKL')) {
test_fail
}
}
}
-if (&control.Tmp-String-1 != 'ssid=GHIJKL') {
+if (!(&control.Tmp-String-1 == 'ssid=GHIJKL')) {
test_fail
}
}
# String
-if (&Tmp-String-1[0] != '39383730') {
+if (!(&Tmp-String-1[0] == '39383730')) {
test_fail
}
# Octets
-if (&Tmp-String-1[1] != '39383731') {
+if (!(&Tmp-String-1[1] == '39383731')) {
test_fail
}
# IP Address
-if (&Tmp-String-1[2] != '39383732') {
+if (!(&Tmp-String-1[2] == '39383732')) {
test_fail
}
# Integer
-if (&Tmp-String-1[3] != '39383734') {
+if (!(&Tmp-String-1[3] == '39383734')) {
test_fail
}
# ifid
-if (&Tmp-String-1[4] != '0000000039383737') {
+if (!(&Tmp-String-1[4] == '0000000039383737')) {
test_fail
}
# ipv6addr
-if (&Tmp-String-1[5] != '00000000000000000000000039383738') {
+if (!(&Tmp-String-1[5] == '00000000000000000000000039383738')) {
test_fail
}
# ipv6addrprefix
-if (&Tmp-String-1[6] != '008000000000000000000000000039383739') {
+if (!(&Tmp-String-1[6] == '008000000000000000000000000039383739')) {
test_fail
}
# byte
-if (&Tmp-String-1[7] != '3a') {
+if (!(&Tmp-String-1[7] == '3a')) {
test_fail
}
}
# short
-if (&Tmp-String-1[0] != '373b') {
+if (!(&Tmp-String-1[0] == '373b')) {
test_fail
}
# ethernet
-if (&Tmp-String-1[1] != '00003938373c') {
+if (!(&Tmp-String-1[1] == '00003938373c')) {
test_fail
}
# integer64
-if (&Tmp-String-1[2] != '100000003938373d') {
+if (!(&Tmp-String-1[2] == '100000003938373d')) {
test_fail
}
# ipv4prefix
-if (&Tmp-String-1[3] != '203938373e') {
+if (!(&Tmp-String-1[3] == '203938373e')) {
test_fail
}
success
}
-if (&User-Name != "bob") {
+if (!(&User-Name == "bob")) {
test_fail
}
#
# Matching "if" conditions
#
-if (&User-Name != "bob") {
+if (!(&User-Name == "bob")) {
test_fail
}
else {
#
# Matching "if" conditions
#
-if (&User-Name != "bob") {
+if (!(&User-Name == "bob")) {
test_fail
}
elsif (&User-Name == "bob") {
#
# Mmmm O(N^2)
#
-if (&Tmp-String-0[*] != &control.Tmp-String-0[*]) {
+if (!(&Tmp-String-0[*] == &control.Tmp-String-0[*])) {
test_fail
}
#
# Integer comparison and normalisation
#
-if (&Tmp-Integer-0 != &control.Tmp-Integer-0) {
+if (!(&Tmp-Integer-0 == &control.Tmp-Integer-0)) {
test_fail
}
#
# XLAT virtual comparisons
#
-if (&control.Tmp-Integer-0[*] != "%{control.Tmp-Integer-0[#]}") {
+if (!(&control.Tmp-Integer-0[*] == "%{control.Tmp-Integer-0[#]}")) {
test_fail
}
#
# Literal comparisons
#
-if (&control.Tmp-String-1[*] != 'boink') {
+if (!(&control.Tmp-String-1[*] == 'boink')) {
test_fail
}
test_fail
}
-if (&control.Tmp-String-1 != "") {
+if (!(&control.Tmp-String-1 == "")) {
test_fail
}
# Checking capture groups are cleared out correctly
if (&User-Name =~ /^([0-9])_%{Tmp-String-0}/) {
- if ("%{0}%{1}%{2}%{3}%{4}%{5}%{6}%{7}" != '1_1') {
+ if (!("%{0}%{1}%{2}%{3}%{4}%{5}%{6}%{7}" == '1_1')) {
test_fail
}
}
# Checking capture groups are cleared out correctly when there are no matches
if (&User-Name =~ /^.%{Tmp-String-0}/) {
- if ("%{0}%{1}%{2}%{3}%{4}%{5}%{6}%{7}" != '1') {
+ if (!("%{0}%{1}%{2}%{3}%{4}%{5}%{6}%{7}" == '1')) {
test_fail
}
}
# Checking full capture group range
if ('a_b_c_d_e_f_g_h_i_j_k_l_m_n_o_p_q_r_s_t_u_v_w_x_y_z_A_B_C_D_E_F' =~ /^(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)$/) {
- if ("%{0}%{1}%{2}%{3}%{4}%{5}%{6}%{7}%{8}%{9}%{10}%{11}%{12}%{13}%{14}%{15}%{16}%{17}%{18}%{19}%{20}%{21}%{22}%{23}%{24}%{25}%{26}%{27}%{28}%{29}%{30}%{31}%{32}" != 'a_b_c_d_e_f_g_h_i_j_k_l_m_n_o_p_q_r_s_t_u_v_w_x_y_z_A_B_C_D_E_FabcdefghijklmnopqrstuvwxyzABCDEF') {
+ if (!("%{0}%{1}%{2}%{3}%{4}%{5}%{6}%{7}%{8}%{9}%{10}%{11}%{12}%{13}%{14}%{15}%{16}%{17}%{18}%{19}%{20}%{21}%{22}%{23}%{24}%{25}%{26}%{27}%{28}%{29}%{30}%{31}%{32}" == 'a_b_c_d_e_f_g_h_i_j_k_l_m_n_o_p_q_r_s_t_u_v_w_x_y_z_A_B_C_D_E_FabcdefghijklmnopqrstuvwxyzABCDEF')) {
test_fail
}
}
# Checking full capture group overun
if ('a_b_c_d_e_f_g_h_i_j_k_l_m_n_o_p_q_r_s_t_u_v_w_x_y_z_A_B_C_D_E_F_G' =~ /^(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)_(.)$/) {
- if ("%{0}%{1}%{2}%{3}%{4}%{5}%{6}%{7}%{8}%{9}%{10}%{11}%{12}%{13}%{14}%{15}%{16}%{17}%{18}%{19}%{20}%{21}%{22}%{23}%{24}%{25}%{26}%{27}%{28}%{29}%{30}%{31}%{32}" != 'a_b_c_d_e_f_g_h_i_j_k_l_m_n_o_p_q_r_s_t_u_v_w_x_y_z_A_B_C_D_E_F_GabcdefghijklmnopqrstuvwxyzABCDEF') {
+ if (!("%{0}%{1}%{2}%{3}%{4}%{5}%{6}%{7}%{8}%{9}%{10}%{11}%{12}%{13}%{14}%{15}%{16}%{17}%{18}%{19}%{20}%{21}%{22}%{23}%{24}%{25}%{26}%{27}%{28}%{29}%{30}%{31}%{32}" == 'a_b_c_d_e_f_g_h_i_j_k_l_m_n_o_p_q_r_s_t_u_v_w_x_y_z_A_B_C_D_E_F_GabcdefghijklmnopqrstuvwxyzABCDEF')) {
test_fail
}
}
# Checking capture groups are cleared out correctly
if (&User-Name =~ /^([0-9])_/) {
- if ("%{0}%{1}%{2}%{3}%{4}%{5}%{6}%{7}" != '1_1') {
+ if (!("%{0}%{1}%{2}%{3}%{4}%{5}%{6}%{7}" == '1_1')) {
test_fail
}
}
# Checking capture groups are cleared out correctly when there are no matches
if (&User-Name =~ /^./) {
- if ("%{0}%{1}%{2}%{3}%{4}%{5}%{6}%{7}" != '1') {
+ if (!("%{0}%{1}%{2}%{3}%{4}%{5}%{6}%{7}" == '1')) {
test_fail
}
}
# uncompiled - ref - named capture groups
if (&User-Name =~ /^(?<one>[0-9])_(?<two>[0-9])?_(?<three>[0-9]*)_(?<four>[0-9]+)_(?<five>[^_])_(?<six>6)_(?<seven>[7-8])%{Tmp-String-1}/) {
&Tmp-String-0 := "%{regex:seven}_%{regex:six}_%{regex:five}_%{regex:four}_%{regex:three}_%{regex:two}_%{regex:one}_%{0}"
- if (&Tmp-String-0 != '7_6_5_4_3_2_1_1_2_3_4_5_6_7') {
+ if (!(&Tmp-String-0 == '7_6_5_4_3_2_1_1_2_3_4_5_6_7')) {
test_fail
}
}
# Checking capture groups are cleared out correctly
if (&User-Name =~ /^(?<one>[0-9])_%{Tmp-String-1}/) {
&Tmp-String-0 := "%{0}%{regex:one}%{regex:two}%{regex:three}%{regex:four}%{regex:five}%{regex:six}%{regex:seven}"
- if (&Tmp-String-0 != '1_1') {
+ if (!(&Tmp-String-0 == '1_1')) {
test_fail
}
}
# Checking capture groups are cleared out correctly when there are no matches
if (&User-Name =~ /^.%{Tmp-String-1}/) {
&Tmp-String-0 := "%{0}%{regex:one}%{regex:two}%{regex:three}%{regex:four}%{regex:five}%{regex:six}%{regex:seven}"
- if (&Tmp-String-0 != '1') {
+ if (!(&Tmp-String-0 == '1')) {
test_fail
}
}
# compiled - ref - named capture groups
if (&User-Name =~ /^(?<one>[0-9])_(?<two>[0-9])?_(?<three>[0-9]*)_(?<four>[0-9]+)_(?<five>[^_])_(?<six>6)_(?<seven>[7-8])/) {
&Tmp-String-0 := "%{regex:seven}_%{regex:six}_%{regex:five}_%{regex:four}_%{regex:three}_%{regex:two}_%{regex:one}_%{0}"
- if (&Tmp-String-0 != '7_6_5_4_3_2_1_1_2_3_4_5_6_7') {
+ if (!(&Tmp-String-0 == '7_6_5_4_3_2_1_1_2_3_4_5_6_7')) {
test_fail
}
}
# compiled - xlat - named capture groups
if ('1_2_3_4_5_6_7' =~ /^(?<one>[0-9])_(?<two>[0-9])?_(?<three>[0-9]*)_(?<four>[0-9]+)_(?<five>[^_])_(?<six>6)_(?<seven>[7-8])/) {
&Tmp-String-0 := "%{regex:seven}_%{regex:six}_%{regex:five}_%{regex:four}_%{regex:three}_%{regex:two}_%{regex:one}_%{0}"
- if (&Tmp-String-0 != '7_6_5_4_3_2_1_1_2_3_4_5_6_7') {
+ if (!(&Tmp-String-0 == '7_6_5_4_3_2_1_1_2_3_4_5_6_7')) {
test_fail
}
}
# compiled - ref - named capture groups (numeric indexes)
if (&User-Name =~ /^(?<one>[0-9])_(?<two>[0-9])?_(?<three>[0-9]*)_(?<four>[0-9]+)_(?<five>[^_])_(?<six>6)_(?<seven>[7-8])/) {
&Tmp-String-0 := "%{7}_%{6}_%{5}_%{4}_%{3}_%{2}_%{1}_%{0}"
- if (&Tmp-String-0 != '7_6_5_4_3_2_1_1_2_3_4_5_6_7') {
+ if (!(&Tmp-String-0 == '7_6_5_4_3_2_1_1_2_3_4_5_6_7')) {
test_fail
}
&Tmp-Integer-7 := 7
&Tmp-String-0 := "%{regex:%{Tmp-Integer-7}}_%{regex:%{Tmp-Integer-6}}_%{regex:%{Tmp-Integer-5}}_%{regex:%{Tmp-Integer-4}}_%{regex:%{Tmp-Integer-3}}_%{regex:%{Tmp-Integer-2}}_%{regex:%{Tmp-Integer-1}}_%{regex:%{Tmp-Integer-0}}"
- if (&Tmp-String-0 != '7_6_5_4_3_2_1_1_2_3_4_5_6_7') {
+ if (!(&Tmp-String-0 == '7_6_5_4_3_2_1_1_2_3_4_5_6_7')) {
test_fail
}
}
}
if (&Vendor-Specific.Cisco.AVPair[1] =~ /bar=(.*)/) {
- if ("%{1}" != 'baz') {
+ if (!("%{1}" == 'baz')) {
test_fail
}
}
}
if (&Vendor-Specific.Cisco.AVPair[*] =~ /bar=(.*)/) {
- if ("%{1}" != 'baz') {
+ if (!("%{1}" == 'baz')) {
test_fail
}
}
&Tmp-IP-Address-3 = 2130706436
}
-if (&NAS-IP-Address != 127.0.0.1) {
+if (!(&NAS-IP-Address == 127.0.0.1)) {
test_fail
}
-if (&Tmp-IP-Address-0 != 127.0.0.1) {
+if (!(&Tmp-IP-Address-0 == 127.0.0.1)) {
test_fail
}
-if (&Tmp-IP-Address-1 != 127.0.0.2) {
+if (!(&Tmp-IP-Address-1 == 127.0.0.2)) {
test_fail
}
-if (&Tmp-IP-Address-2 != 127.0.0.3) {
+if (!(&Tmp-IP-Address-2 == 127.0.0.3)) {
test_fail
}
-if (&Tmp-IP-Address-3 != 127.0.0.4) {
+if (!(&Tmp-IP-Address-3 == 127.0.0.4)) {
test_fail
}
if (!&raw.4) {
test_fail
}
-elsif (&raw.4 != 0x010203) {
+elsif (!(&raw.4 == 0x010203)) {
test_fail
}
&Framed-IP-Address = 198.51.0.1
}
-if (&control.Tmp-Cast-IPv6Prefix != '::198.51.0.0/112') {
+if (!(&control.Tmp-Cast-IPv6Prefix == '::198.51.0.0/112')) {
test_fail
}
-if (&control.Tmp-Cast-IPv4Prefix != '198.51.0.0/16') {
+if (!(&control.Tmp-Cast-IPv4Prefix == '198.51.0.0/16')) {
test_fail
}
-if (&control.Tmp-Cast-IPv6Prefix != ::198.51.0.0/112) {
+if (!(&control.Tmp-Cast-IPv6Prefix == ::198.51.0.0/112)) {
test_fail
}
-if (&control.Tmp-Cast-IPv4Prefix != 198.51.0.0/16) {
+if (!(&control.Tmp-Cast-IPv4Prefix == 198.51.0.0/16)) {
test_fail
}
&Tmp-Cast-IPv4Prefix = 57.56.55.62/32
}
-if (%(length:%{Tmp-String-0}) != 260) {
+if (!(%(length:%{Tmp-String-0}) == 260)) {
test_fail
}
}
# String - bin 0x39383730
-if (&Tmp-uint64-0 != 4) {
+if (!(&Tmp-uint64-0 == 4)) {
test_fail
}
# Octets - bin 0x39383731
-if (&Tmp-Integer-1 != 4) {
+if (!(&Tmp-Integer-1 == 4)) {
test_fail
}
# IP Address - bin 0x39383732
-if (&Tmp-Integer-2 != 4) {
+if (!(&Tmp-Integer-2 == 4)) {
test_fail
}
# String - "hello, world"
-if (&Tmp-Integer-3 != 12) {
+if (!(&Tmp-Integer-3 == 12)) {
test_fail
}
# Integer - bin 0x39383734
-if (&Tmp-Integer-4 != 4) {
+if (!(&Tmp-Integer-4 == 4)) {
test_fail
}
# ifid - bin 0x0000000039383737
-if (&Tmp-Integer-6 != 8) {
+if (!(&Tmp-Integer-6 == 8)) {
test_fail
}
# ipv6addr - bin 0x00000000000000000000000039383738
-if (&Tmp-Integer-7 != 16) {
+if (!(&Tmp-Integer-7 == 16)) {
test_fail
}
# ipv6addrprefix - bin 0x8000000000000000000000000039383739
-if (&Tmp-Integer-8 != 17) {
+if (!(&Tmp-Integer-8 == 17)) {
test_fail
}
# byte - bin 0x3a
-if (&Tmp-Integer-9 != 1) {
+if (!(&Tmp-Integer-9 == 1)) {
test_fail
}
&Tmp-Integer-3 := "%(length:%{Tmp-Cast-IPv4Prefix})"
# short - bin 0x373b
-if (&Tmp-Integer-0 != 2) {
+if (!(&Tmp-Integer-0 == 2)) {
test_fail
}
# ethernet - bin 0x00003938373c
-if (&Tmp-Integer-1 != 6) {
+if (!(&Tmp-Integer-1 == 6)) {
test_fail
}
# integer64 - bin 0x100000003938373d
-if (&Tmp-Integer-2 != 8) {
+if (!(&Tmp-Integer-2 == 8)) {
test_fail
}
# ipv4prefix - bin 0x203938373e
-if (&Tmp-Integer-3 != 5) {
+if (!(&Tmp-Integer-3 == 5)) {
test_fail
}
&control.Tmp-String-0 ^= 'field3'
}
-if ("%{control.Tmp-String-0[0]}" != 'success') {
+if (!("%{control.Tmp-String-0[0]}" == 'success')) {
test_fail
}
-if ("%{control.Tmp-String-0[1]}" != "fail") {
+if (!("%{control.Tmp-String-0[1]}" == "fail")) {
test_fail
}
-if ("%{control.Tmp-String-0[#]}" != 2) {
+if (!("%{control.Tmp-String-0[#]}" == 2)) {
test_fail
}
&Tmp-String-1 = "request.Vendor-Specific.Nokia-SR.MSAP-Interface += 'UNICAST_7360OLT4'"
}
-if ("%{map:%{Tmp-String-0}}" != 1) {
+if (!("%{map:%{Tmp-String-0}}" == 1)) {
test_fail
}
-if (&control.Tmp-String-0 != 'testing123') {
+if (!(&control.Tmp-String-0 == 'testing123')) {
test_fail
}
foreach &Tmp-String-1[*] {
- if ("%{map:%{Foreach-Variable-0}}" != 1) {
+ if (!("%{map:%{Foreach-Variable-0}}" == 1)) {
test_fail
}
}
-if (&Vendor-Specific.Nokia-SR.MSAP-Interface[0] != 'UNICAST_7360OLT3') {
+if (!(&Vendor-Specific.Nokia-SR.MSAP-Interface[0] == 'UNICAST_7360OLT3')) {
test_fail
}
-if (&Vendor-Specific.Nokia-SR.MSAP-Interface[1] != 'UNICAST_7360OLT4') {
+if (!(&Vendor-Specific.Nokia-SR.MSAP-Interface[1] == 'UNICAST_7360OLT4')) {
test_fail
}
#
&Tmp-String-0 := "request.Tmp-Group-0.Tmp-String-1 = 'testing123'"
-if ("%{map:%{Tmp-String-0}}" != 1) {
+if (!("%{map:%{Tmp-String-0}}" == 1)) {
test_fail
}
#
&Tmp-String-0 := "request.Tmp-Group-0.Tmp-String-0 := 'testing123'"
-if ("%{map:%{Tmp-String-0}}" != 1) {
+if (!("%{map:%{Tmp-String-0}}" == 1)) {
test_fail
}
-if ("%{map:%{Tmp-String-0}}" != 1) {
+if (!("%{map:%{Tmp-String-0}}" == 1)) {
test_fail
}
test_fail
}
-if (!&Tmp-Group-0[0].Tmp-String-0 || (&Tmp-Group-0[0].Tmp-String-0 != 'testing123')) {
+if (!&Tmp-Group-0[0].Tmp-String-0 || (!(&Tmp-Group-0[0].Tmp-String-0 == 'testing123'))) {
test_fail
}
-if (!&Tmp-Group-0[0].Tmp-String-1 || (&Tmp-Group-0[0].Tmp-String-1 != 'testing000')) {
+if (!&Tmp-Group-0[0].Tmp-String-1 || (!(&Tmp-Group-0[0].Tmp-String-1 == 'testing000'))) {
test_fail
}
#
&Tmp-String-0 := "IA-PD.IAID = 11"
-if ("%{map:%{Tmp-String-0}}" != 1) {
+if (!("%{map:%{Tmp-String-0}}" == 1)) {
test_fail
}
test_fail
}
-if (&IA-PD.IAID != 11) {
+if (!(&IA-PD.IAID == 11)) {
test_fail
}
# Put "This is a string" into a file and call "md4sum" on it.
# You should get this string.
#
-if (&Tmp-Octets-1 != 0x1f60d5cd85e17bfbdda7c923822f060c) {
+if (!(&Tmp-Octets-1 == 0x1f60d5cd85e17bfbdda7c923822f060c)) {
test_fail
}
-if (&Tmp-Octets-2 != 0x1f60d5cd85e17bfbdda7c923822f060c) {
+if (!(&Tmp-Octets-2 == 0x1f60d5cd85e17bfbdda7c923822f060c)) {
test_fail
}
-if (&Tmp-Octets-3 != 0x1f60d5cd85e17bfbdda7c923822f060c) {
+if (!(&Tmp-Octets-3 == 0x1f60d5cd85e17bfbdda7c923822f060c)) {
test_fail
}
#
# MD5 should also be able to cope with references to octet attributes
#
-if (&Tmp-Octets-4 != 0xac3ed17b3cf19ec38352ec534a932fc6) {
+if (!(&Tmp-Octets-4 == 0xac3ed17b3cf19ec38352ec534a932fc6)) {
test_fail
}
#
# MD5 of null string is d41d8cd98f00b204e9800998ecf8427e
#
-if (&Tmp-Octets-5 != 0x31d6cfe0d16ae931b73c59d7e0c089c0) {
+if (!(&Tmp-Octets-5 == 0x31d6cfe0d16ae931b73c59d7e0c089c0)) {
test_fail
}
# Put "This is a string" into a file and call "md5sum" on it.
# You should get this string.
#
-if (&Tmp-Octets-1 != 0x9ac4dbbc3c0ad2429e61d0df5dc28add) {
+if (!(&Tmp-Octets-1 == 0x9ac4dbbc3c0ad2429e61d0df5dc28add)) {
test_fail
}
-if (&Tmp-Octets-2 != 0x9ac4dbbc3c0ad2429e61d0df5dc28add) {
+if (!(&Tmp-Octets-2 == 0x9ac4dbbc3c0ad2429e61d0df5dc28add)) {
test_fail
}
-if (&Tmp-Octets-3 != 0x9ac4dbbc3c0ad2429e61d0df5dc28add) {
+if (!(&Tmp-Octets-3 == 0x9ac4dbbc3c0ad2429e61d0df5dc28add)) {
test_fail
}
#
# MD5 should also be able to cope with references to octet attributes
#
-if (&Tmp-Octets-4 != 0xc1e7fa505b2fc1fd0da6cac3db6f6f44) {
+if (!(&Tmp-Octets-4 == 0xc1e7fa505b2fc1fd0da6cac3db6f6f44)) {
test_fail
}
#
# MD5 of null string is d41d8cd98f00b204e9800998ecf8427e
#
-if (&Tmp-Octets-5 != 0xd41d8cd98f00b204e9800998ecf8427e) {
+if (!(&Tmp-Octets-5 == 0xd41d8cd98f00b204e9800998ecf8427e)) {
test_fail
}
#
# MD5 HMAC with attribute references
#
-if (&Tmp-Octets-6 != 0x750c783e6ab0b503eaa86e310a5db738) {
+if (!(&Tmp-Octets-6 == 0x750c783e6ab0b503eaa86e310a5db738)) {
test_fail
}
#
# MD5 HMAC with empty key and data
#
-if (&Tmp-Octets-7 != 0x74e6f7298a9c2d168935f58c001bad88) {
+if (!(&Tmp-Octets-7 == 0x74e6f7298a9c2d168935f58c001bad88)) {
test_fail
}
&Tmp-Octets-0 := "%{pack:%{Framed-IP-Address}%{NAS-Port}%{NAS-IP-Address}}"
-if (&Tmp-Octets-0 != 0x7f000001000008407f000002) {
+if (!(&Tmp-Octets-0 == 0x7f000001000008407f000002)) {
test_fail
}
test_fail
}
-if (&Tmp-String-5 != '') {
+if (!(&Tmp-String-5 == '')) {
test_fail
}
}
}
-if ("%{control.Tmp-Integer-0[#]}" != 4) {
+if (!("%{control.Tmp-Integer-0[#]}" == 4)) {
test_fail
}
if (!fail) {
test_fail
}
-if (&Tmp-String-0 != 'foo') {
+if (!(&Tmp-String-0 == 'foo')) {
test_fail
}
}
}
-if (&Tmp-String-0 != 'foo') {
+if (!(&Tmp-String-0 == 'foo')) {
test_fail
}
#
# Check length of output
#
-if (%{strlen:%{Tmp-String-1}} != 3) {
+if (!(%{strlen:%{Tmp-String-1}} == 3)) {
test_fail
}
-if (%{strlen:%{Tmp-String-2}} != 24) {
+if (!(%{strlen:%{Tmp-String-2}} == 24)) {
test_fail
}
#
# Check maximum repetition
#
-if (%{strlen:%{Tmp-String-3}} != 1025) {
+if (!(%{strlen:%{Tmp-String-3}} == 1025)) {
test_fail
}
#
# Check repetition of binary output
#
-if (%(length:%{Tmp-String-5}) != 10) {
+if (!(%(length:%{Tmp-String-5}) == 10)) {
test_fail
}
}
}
-if (&Tmp-Integer-0 != "%{Tmp-Integer-1[#]}") {
+if (!(&Tmp-Integer-0 == "%{Tmp-Integer-1[#]}")) {
test_fail
}
}
}
-if (&Tmp-Integer-0 != "%{Tmp-Integer-1[#]}") {
+if (!(&Tmp-Integer-0 == "%{Tmp-Integer-1[#]}")) {
test_fail
}
return
}
-if (&Tmp-Integer-2 != 1) {
+if (!(&Tmp-Integer-2 == 1)) {
test_fail
}
-if (&Tmp-Integer-3 != 1) {
+if (!(&Tmp-Integer-3 == 1)) {
test_fail
return
}
-if (&Tmp-Integer-4 != 1) {
+if (!(&Tmp-Integer-4 == 1)) {
test_fail
return
}
-if (&Tmp-Integer-5 != 1) {
+if (!(&Tmp-Integer-5 == 1)) {
test_fail
return
}
}
}
-if (&Tmp-Integer-0 != 3) {
+if (!(&Tmp-Integer-0 == 3)) {
test_fail
}
if (!&control.Tmp-Integer-0) {
test_fail
}
-if (&control.Tmp-Integer-0[0] != 2) {
+if (!(&control.Tmp-Integer-0[0] == 2)) {
test_fail
}
# Put "This is a string" into a file and call "sha1sum" on it.
# You should get this string.
#
-if (&Tmp-Octets-2 != 0xcc7edf1ccc4bdf1e0ec8f72b95388b65218ecf0c) {
+if (!(&Tmp-Octets-2 == 0xcc7edf1ccc4bdf1e0ec8f72b95388b65218ecf0c)) {
test_fail
}
-if (&Tmp-Octets-3 != 0xcc7edf1ccc4bdf1e0ec8f72b95388b65218ecf0c) {
+if (!(&Tmp-Octets-3 == 0xcc7edf1ccc4bdf1e0ec8f72b95388b65218ecf0c)) {
test_fail
}
-if (&Tmp-Octets-4 != 0xcc7edf1ccc4bdf1e0ec8f72b95388b65218ecf0c) {
+if (!(&Tmp-Octets-4 == 0xcc7edf1ccc4bdf1e0ec8f72b95388b65218ecf0c)) {
test_fail
}
#
# SHA1 of empty string
#
-if (&Tmp-Octets-5 != 0xda39a3ee5e6b4b0d3255bfef95601890afd80709) {
+if (!(&Tmp-Octets-5 == 0xda39a3ee5e6b4b0d3255bfef95601890afd80709)) {
test_fail
}
#
# SHA1 HMAC with attribute references
#
-if (&Tmp-Octets-6 != 0xeffcdf6ae5eb2fa2d27416d5f184df9c259a7c79) {
+if (!(&Tmp-Octets-6 == 0xeffcdf6ae5eb2fa2d27416d5f184df9c259a7c79)) {
test_fail
}
#
# SHA1 HMAC with empty key and data
#
-if (&Tmp-Octets-7 != 0xfbdb1d1b18aa6c08324b7d64b71fb76370690e1d) {
+if (!(&Tmp-Octets-7 == 0xfbdb1d1b18aa6c08324b7d64b71fb76370690e1d)) {
test_fail
}
# Put "This is a string" into a file and call "sha2_256sum" on it.
# You should get this string.
#
-if (&Tmp-Octets-1 != 0xb3716a1ab53042bb392034f29071e13b0c38aa19b4edd75d9a76022f91189124) {
+if (!(&Tmp-Octets-1 == 0xb3716a1ab53042bb392034f29071e13b0c38aa19b4edd75d9a76022f91189124)) {
test_fail
}
-if (&Tmp-Octets-2 != 0xb3716a1ab53042bb392034f29071e13b0c38aa19b4edd75d9a76022f91189124) {
+if (!(&Tmp-Octets-2 == 0xb3716a1ab53042bb392034f29071e13b0c38aa19b4edd75d9a76022f91189124)) {
test_fail
}
-if (&Tmp-Octets-3 != 0xb3716a1ab53042bb392034f29071e13b0c38aa19b4edd75d9a76022f91189124) {
+if (!(&Tmp-Octets-3 == 0xb3716a1ab53042bb392034f29071e13b0c38aa19b4edd75d9a76022f91189124)) {
test_fail
}
#
# SHA256 should also be able to cope with references to octet attributes
#
-if (&Tmp-Octets-4 != 0xf307e202b881fded70e58017aa0c4d7b29c76ab25d02bf078301a5f6635187eb) {
+if (!(&Tmp-Octets-4 == 0xf307e202b881fded70e58017aa0c4d7b29c76ab25d02bf078301a5f6635187eb)) {
test_fail
}
#
# SHA256 of empty string
#
-if (&Tmp-Octets-5 != 0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855) {
+if (!(&Tmp-Octets-5 == 0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855)) {
test_fail
}
&Tmp-Octets-2 := "%{sha2_512:%{Tmp-String-0}}"
&Tmp-Octets-3 := "%{sha2_512:%{request.Tmp-Octets-0}}"
-if (&Tmp-Octets-1 != 0x56b57df5cce42d4e35c644649798ea23ec16f4f4626e78faf4d2d8f430ea349bcc28cd5532457c82f0aa66bf68988346039fe75b900a92ff94fd53993d45990f) {
+if (!(&Tmp-Octets-1 == 0x56b57df5cce42d4e35c644649798ea23ec16f4f4626e78faf4d2d8f430ea349bcc28cd5532457c82f0aa66bf68988346039fe75b900a92ff94fd53993d45990f)) {
test_fail
}
-if (&Tmp-Octets-2 != 0x56b57df5cce42d4e35c644649798ea23ec16f4f4626e78faf4d2d8f430ea349bcc28cd5532457c82f0aa66bf68988346039fe75b900a92ff94fd53993d45990f) {
+if (!(&Tmp-Octets-2 == 0x56b57df5cce42d4e35c644649798ea23ec16f4f4626e78faf4d2d8f430ea349bcc28cd5532457c82f0aa66bf68988346039fe75b900a92ff94fd53993d45990f)) {
test_fail
}
-if (&Tmp-Octets-3 != 0xde80271eb5e03a1c24dd0cd823a22305a743ee3a54f1de5bf97adbf56984561154bfb6928b1da4ccc3f5dde9f4032ad461937b60b9ace4ad3898cf45c90596d7) {
+if (!(&Tmp-Octets-3 == 0xde80271eb5e03a1c24dd0cd823a22305a743ee3a54f1de5bf97adbf56984561154bfb6928b1da4ccc3f5dde9f4032ad461937b60b9ace4ad3898cf45c90596d7)) {
test_fail
}
test_fail
}
-if (&control.User-Name != 'bob') {
+if (!(&control.User-Name == 'bob')) {
test_fail
}
test_fail
}
-if (&control.User-Name != 'bob') {
+if (!(&control.User-Name == 'bob')) {
test_fail
}
test_fail
}
- if (&User-Name != 'bob') {
+ if (!(&User-Name == 'bob')) {
test_fail
}
test_fail
}
-if (&Tmp-String-0 != "testing1234") {
+if (!(&Tmp-String-0 == "testing1234")) {
test_fail
}
test_fail
}
- if (&User-Name != 'bob') {
+ if (!(&User-Name == 'bob')) {
test_fail
}
test_fail
}
- if (&User-Name != 'bob') {
+ if (!(&User-Name == 'bob')) {
test_fail
}
&Tmp-String-2 := "%{tolower:%{Tmp-String-9}}"
-if (&Tmp-String-0 != "abcde") {
+if (!(&Tmp-String-0 == "abcde")) {
test_fail
}
-if (&Tmp-String-1 != "aabbccdd") {
+if (!(&Tmp-String-1 == "aabbccdd")) {
test_fail
}
&Tmp-String-1 := "%{toupper:AAbbCCdd}"
&Tmp-String-2 := "%{toupper:%{Tmp-String-9}}"
-if (&Tmp-String-0 != "ABCDE") {
+if (!(&Tmp-String-0 == "ABCDE")) {
test_fail
}
-if (&Tmp-String-1 != "AABBCCDD") {
+if (!(&Tmp-String-1 == "AABBCCDD")) {
test_fail
}
3ae4bcef324b9a3f47ba5c835b54a010ca42f3b9cc5368278c148c9b02ea8c4c9f244fd49f
# Actual length of octet string is 4083 bytes
-if (%(length:%{Tmp-Octets-0}) != 4083) {
+if (!(%(length:%{Tmp-Octets-0}) == 4083)) {
test_fail
}
&Tmp-String-0 := "%{1}"
-if ("%(length:%{Tmp-String-0})" != 8166) {
+if (!("%(length:%{Tmp-String-0})" == 8166)) {
test_fail
}
#
&26.24757.84.9.5.7 := 0xab
-if (&26.24757.84.9.5.7 != 0xab) {
+if (!(&26.24757.84.9.5.7 == 0xab)) {
test_fail
}
#
&26.24757.84.9.5.15 := 0xabcdef
-if (&26.24757.84.9.5.15 != 0xabcdef) {
+if (!(&26.24757.84.9.5.15 == 0xabcdef)) {
test_fail
}
test_fail
}
-if (&26.11344.1 != 127.0.0.2) {
+if (!(&26.11344.1 == 127.0.0.2)) {
test_fail
}
test_fail
}
-if (&Vendor-Specific.FreeRADIUS.Proxied-To != 127.0.0.1) {
+if (!(&Vendor-Specific.FreeRADIUS.Proxied-To == 127.0.0.1)) {
test_fail
}
test_fail
}
-if (&26.11344.1 != 127.0.0.1) {
+if (!(&26.11344.1 == 127.0.0.1)) {
test_fail
}
&26.66.1 = 0x01020304
-if (&26.66.1 != 0x01020304) {
+if (!(&26.66.1 == 0x01020304)) {
test_fail
}
&Proxy-State += &Class[2]
}
-if (&Proxy-State != 0x01020304) {
+if (!(&Proxy-State == 0x01020304)) {
test_fail
}
# Must be the same as above
-if (&Proxy-State[0] != 0x01020304) {
+if (!(&Proxy-State[0] == 0x01020304)) {
test_fail
}
-if (&Proxy-State[1] != 0x05060708) {
+if (!(&Proxy-State[1] == 0x05060708)) {
test_fail
}
-if (&Proxy-State[2] != 0x090a0b0c) {
+if (!(&Proxy-State[2] == 0x090a0b0c)) {
test_fail
}
&control !* ANY
}
-if ("%{Tmp-String-0[#]}" != 2) {
+if (!("%{Tmp-String-0[#]}" == 2)) {
test_fail
}
-if (&Tmp-String-0[0] != 'foo') {
+if (!(&Tmp-String-0[0] == 'foo')) {
test_fail
}
}
# Should only remove 'bar'
-if (&Tmp-String-0[0] != 'foo') {
+if (!(&Tmp-String-0[0] == 'foo')) {
test_fail
}
&Tmp-IP-Address-0 := 192.0.2.1
}
-if ((&Tmp-String-0 != 'foobarbaz') || (&Tmp-Integer-0 != 123456789) || (&Tmp-IP-Address-0 != 192.0.2.1)) {
+if (!((&Tmp-String-0 == 'foobarbaz')) || (!(&Tmp-Integer-0 == 123456789)) || (&Tmp-IP-Address-0 != 192.0.2.1)) {
test_fail
}
&request = `/bin/sh -c "echo Tmp-String-0 := foo"`
}
-if (!&Tmp-String-0 || (&Tmp-String-0 != 'foo')) {
+if (!&Tmp-String-0 || (!(&Tmp-String-0 == 'foo'))) {
test_fail
}
&request = `/bin/sh -c 'echo Tmp-String-0 := foo, Tmp-String-1 := bar'`
}
-if (!&Tmp-String-0 || !&Tmp-String-1 || (&Tmp-String-0 != 'foo') || (&Tmp-String-1 != 'bar')) {
+if (!&Tmp-String-0 || !&Tmp-String-1 || (!(&Tmp-String-0 == 'foo')) || (!(&Tmp-String-1 == 'bar'))) {
test_fail
}
&Tmp-Integer-0 == 10
}
-if (&Tmp-Integer-0[0] != 10) {
+if (!(&Tmp-Integer-0[0] == 10)) {
test_fail
}
-if ("%{Tmp-Integer-0[#]}" != 1) {
+if (!("%{Tmp-Integer-0[#]}" == 1)) {
test_fail
}
-if ("%{Tmp-String-0[#]}" != 3) {
+if (!("%{Tmp-String-0[#]}" == 3)) {
test_fail
}
&Tmp-String-0 == 'baz'
}
-if (&Tmp-String-0[0] != 'baz') {
+if (!(&Tmp-String-0[0] == 'baz')) {
test_fail
}
-if ("%{Tmp-String-0[#]}" != 1) {
+if (!("%{Tmp-String-0[#]}" == 1)) {
test_fail
}
&Tmp-Integer-0 < 10
}
-if (&Tmp-Integer-0[0] != 5) {
+if (!(&Tmp-Integer-0[0] == 5)) {
test_fail
}
-if ("%{Tmp-Integer-0[#]}" != 1) {
+if (!("%{Tmp-Integer-0[#]}" == 1)) {
test_fail
}
-if ("%{Tmp-String-0[#]}" != 3) {
+if (!("%{Tmp-String-0[#]}" == 3)) {
test_fail
}
&Tmp-Integer-0 > 10
}
-if (&Tmp-Integer-0[0] != 15) {
+if (!(&Tmp-Integer-0[0] == 15)) {
test_fail
}
-if (&Tmp-Integer-0[1] != 20) {
+if (!(&Tmp-Integer-0[1] == 20)) {
test_fail
}
-if ("%{Tmp-Integer-0[#]}" != 2) {
+if (!("%{Tmp-Integer-0[#]}" == 2)) {
test_fail
}
-if ("%{Tmp-String-0[#]}" != 3) {
+if (!("%{Tmp-String-0[#]}" == 3)) {
test_fail
}
&Tmp-Integer-0 <= 10
}
-if (&Tmp-Integer-0[0] != 5) {
+if (!(&Tmp-Integer-0[0] == 5)) {
test_fail
}
-if (&Tmp-Integer-0[1] != 10) {
+if (!(&Tmp-Integer-0[1] == 10)) {
test_fail
}
-if ("%{Tmp-Integer-0[#]}" != 2) {
+if (!("%{Tmp-Integer-0[#]}" == 2)) {
test_fail
}
-if ("%{Tmp-String-0[#]}" != 3) {
+if (!("%{Tmp-String-0[#]}" == 3)) {
test_fail
}
&Tmp-Integer-0 >= 10
}
-if (&Tmp-Integer-0[0] != 10) {
+if (!(&Tmp-Integer-0[0] == 10)) {
test_fail
}
-if (&Tmp-Integer-0[1] != 15) {
+if (!(&Tmp-Integer-0[1] == 15)) {
test_fail
}
-if (&Tmp-Integer-0[2] != 20) {
+if (!(&Tmp-Integer-0[2] == 20)) {
test_fail
}
-if ("%{Tmp-Integer-0[#]}" != 3) {
+if (!("%{Tmp-Integer-0[#]}" == 3)) {
test_fail
}
-if ("%{Tmp-String-0[#]}" != 3) {
+if (!("%{Tmp-String-0[#]}" == 3)) {
test_fail
}
&Tmp-Integer-0 != 10
}
-if (&Tmp-Integer-0[0] != 5) {
+if (!(&Tmp-Integer-0[0] == 5)) {
test_fail
}
-if (&Tmp-Integer-0[1] != 15) {
+if (!(&Tmp-Integer-0[1] == 15)) {
test_fail
}
-if (&Tmp-Integer-0[2] != 20) {
+if (!(&Tmp-Integer-0[2] == 20)) {
test_fail
}
-if ("%{Tmp-Integer-0[#]}" != 3) {
+if (!("%{Tmp-Integer-0[#]}" == 3)) {
test_fail
}
-if ("%{Tmp-String-0[#]}" != 3) {
+if (!("%{Tmp-String-0[#]}" == 3)) {
test_fail
}
&Tmp-String-0 == &Tmp-String-1[0]
}
-if (&Tmp-String-0[0] != &Tmp-String-1[0]) {
+if (!(&Tmp-String-0[0] == &Tmp-String-1[0])) {
test_fail
}
-if ("%{Tmp-String-0[#]}" != 1) {
+if (!("%{Tmp-String-0[#]}" == 1)) {
test_fail
}
&Tmp-String-0 := 0x626f62
}
-if (&Tmp-String-0 != 'bob') {
+if (!(&Tmp-String-0 == 'bob')) {
test_fail
}
&Tmp-String-0 := '0x626f62'
}
-if (&Tmp-String-0 != '0x626f62') {
+if (!(&Tmp-String-0 == '0x626f62')) {
test_fail
}
&control.Reply-Message += 'c'
}
-if ((&control.Reply-Message[0] != 'a') || (&control.Reply-Message[1] != 'b') || (&control.Reply-Message[2] != 'c')) {
+if (!((&control.Reply-Message[0] == 'a')) || (!(&control.Reply-Message[1] == 'b')) || (&control.Reply-Message[2] != 'c')) {
test_fail
}
&control.Reply-Message[1] := 'd'
}
-if ((&control.Reply-Message[0] != 'a') || (&control.Reply-Message[1] != 'd') || (&control.Reply-Message[2] != 'c')) {
+if (!((&control.Reply-Message[0] == 'a')) || (!(&control.Reply-Message[1] == 'd')) || (&control.Reply-Message[2] != 'c')) {
test_fail
}
&control.Reply-Message[0] := &control.Reply-Message[0]
}
-if ((&control.Reply-Message[0] != 'a') || (&control.Reply-Message[1] != 'd') || (&control.Reply-Message[2] != 'c')) {
+if (!((&control.Reply-Message[0] == 'a')) || (!(&control.Reply-Message[1] == 'd')) || (&control.Reply-Message[2] != 'c')) {
test_fail
}
# Verify we haven't acquired any extra..
-if ("%{control.Reply-Message[#]}" != 3) {
+if (!("%{control.Reply-Message[#]}" == 3)) {
test_fail
}
&control !* ANY
}
-if (&Tmp-String-0[0] != 'foo') {
+if (!(&Tmp-String-0[0] == 'foo')) {
test_fail
}
if (!&Tmp-String-0) {
test_fail
}
-if (&Tmp-String-0 != '') {
+if (!(&Tmp-String-0 == '')) {
test_fail
}
update request {
&Tmp-Octets-0 := "%{Reply-Message}"
}
-if (&Tmp-Octets-0 != "") {
+if (!(&Tmp-Octets-0 == "")) {
test_fail
}
}
# The prepended value should be first followd by the other two
-if (("%{Tmp-String-0[0]}" != 'boink') || ("%{Tmp-String-0[1]}" != 'foo') || ("%{Tmp-String-0[2]}" != 'baz')) {
+if (!(("%{Tmp-String-0[0]}" == 'boink')) || (!("%{Tmp-String-0[1]}" == 'foo')) || ("%{Tmp-String-0[2]}" != 'baz')) {
test_fail
}
-if ("%{Tmp-String-0[#]}" != 3) {
+if (!("%{Tmp-String-0[#]}" == 3)) {
test_fail
}
}
# The attributes should now be "wibble", "foo", "baz", "boink", "foo", "baz"
-if (("%{Tmp-String-0[0]}" != 'wibble') || ("%{Tmp-String-0[1]}" != 'foo') || ("%{Tmp-String-0[2]}" != 'baz') || ("%{Tmp-String-0[3]}" != 'boink') || ("%{Tmp-String-0[4]}" != 'foo') || ("%{Tmp-String-0[5]}" != 'baz')) {
+if (!(("%{Tmp-String-0[0]}" == 'wibble')) || (!("%{Tmp-String-0[1]}" == 'foo')) || ("%{Tmp-String-0[2]}" != 'baz') || ("%{Tmp-String-0[3]}" != 'boink') || ("%{Tmp-String-0[4]}" != 'foo') || ("%{Tmp-String-0[5]}" != 'baz')) {
test_fail
}
-if ("%{Tmp-String-0[#]}" != 6) {
+if (!("%{Tmp-String-0[#]}" == 6)) {
test_fail
}
}
# The control attributes should now be "wibble", "foo", "baz", "boink", "foo", "baz", "initial"
-if (("%{control.Tmp-String-0[0]}" != 'wibble') || ("%{control.Tmp-String-0[1]}" != 'foo') || ("%{control.Tmp-String-0[2]}" != 'baz') || ("%{control.Tmp-String-0[3]}" != 'boink') || ("%{control.Tmp-String-0[4]}" != 'foo') || ("%{control.Tmp-String-0[5]}" != 'baz') || ("%{control.Tmp-String-0[6]}" != 'initial')) {
+if (!(("%{control.Tmp-String-0[0]}" == 'wibble')) || (!("%{control.Tmp-String-0[1]}" == 'foo')) || ("%{control.Tmp-String-0[2]}" != 'baz') || ("%{control.Tmp-String-0[3]}" != 'boink') || ("%{control.Tmp-String-0[4]}" != 'foo') || ("%{control.Tmp-String-0[5]}" != 'baz') || ("%{control.Tmp-String-0[6]}" != 'initial')) {
test_fail
}
-if ("%{control.Tmp-String-0[#]}" != 7) {
+if (!("%{control.Tmp-String-0[#]}" == 7)) {
test_fail
}
&control.Tmp-IP-Address-1 := 192.0.3.1
}
-if (("%{Tmp-IP-Address-0[0]}" != 192.0.2.1) || ("%{Tmp-IP-Address-0[1]}" != 192.0.2.2)) {
+if (!(("%{Tmp-IP-Address-0[0]}" == 192.0.2.1)) || (!("%{Tmp-IP-Address-0[1]}" == 192.0.2.2))) {
test_fail
}
}
# Non Tmp-IP-Address-0 address attributes should still be in the request list
-if ((&Tmp-String-0 != 'foobarbaz') || (&Tmp-Integer-0 != 123456789)) {
+if (!((&Tmp-String-0 == 'foobarbaz')) || (!(&Tmp-Integer-0 == 123456789))) {
test_fail
}
# There should be no Tmp-IP-Address attributes in the request list
-if (&Tmp-IP-Address-0 || ("%{Tmp-IP-Address-0[1]}" != '')) {
+if (&Tmp-IP-Address-0 || (!("%{Tmp-IP-Address-0[1]}" == ''))) {
test_fail
}
# But there should still be some in the control list
-if ((&control.Tmp-IP-Address-0 != 192.0.2.1) || ("%{control.Tmp-IP-Address-0[1]}" != 192.0.2.3)) {
+if (!((&control.Tmp-IP-Address-0 == 192.0.2.1)) || (!("%{control.Tmp-IP-Address-0[1]}" == 192.0.2.3))) {
test_fail
}
&Tmp-IP-Address-0 := 192.0.2.1
}
-if ((&Tmp-String-0 != 'foobarbaz') || (&Tmp-Integer-0 != 123456789) || (&Tmp-IP-Address-0 != 192.0.2.1)) {
+if (!((&Tmp-String-0 == 'foobarbaz')) || (!(&Tmp-Integer-0 == 123456789)) || (&Tmp-IP-Address-0 != 192.0.2.1)) {
test_fail
}
&Tmp-Integer-0 += 13
}
-if (&reply.Tmp-Integer-0[0] != 12) {
+if (!(&reply.Tmp-Integer-0[0] == 12)) {
test_fail
}
-if (&reply.Tmp-Integer-0[1] != 13) {
+if (!(&reply.Tmp-Integer-0[1] == 13)) {
test_fail
}
}
-if (&Tmp-String-1 != &Tmp-String-0) {
+if (!(&Tmp-String-1 == &Tmp-String-0)) {
test_fail
}
-if (&Tmp-String-3 != &Tmp-String-6) {
+if (!(&Tmp-String-3 == &Tmp-String-6)) {
test_fail
}
-if (&Tmp-String-5 != &Tmp-String-8) {
+if (!(&Tmp-String-5 == &Tmp-String-8)) {
test_fail
}
-if (&Tmp-String-7 != &Tmp-String-2) {
+if (!(&Tmp-String-7 == &Tmp-String-2)) {
test_fail
}
-if (&Tmp-String-9 != &Tmp-String-4) {
+if (!(&Tmp-String-9 == &Tmp-String-4)) {
test_fail
}
&request -= &Tmp-String-2[*]
&Tmp-String-2 := "%{urlunquote:%%E,123}"
-if (&Tmp-String-1 != &Tmp-String-0) {
+if (!(&Tmp-String-1 == &Tmp-String-0)) {
test_fail
}
if (!&raw.26) {
test_fail
}
-elsif (&raw.26 != 0x01020304) {
+elsif (!(&raw.26 == 0x01020304)) {
test_fail
}
else {
&Vendor-Specific.WiMAX.Packet-Flow-Descriptor-v2.Classifier.Src-Spec.Port = 6809
}
-if (&Vendor-Specific.WiMAX.Packet-Flow-Descriptor-v2.Classifier.Src-Spec.Port != 6809) {
+if (!(&Vendor-Specific.WiMAX.Packet-Flow-Descriptor-v2.Classifier.Src-Spec.Port == 6809)) {
test_fail
}
&26.24757.84.9.5.7 = 0x01
}
-if (&Vendor-Specific.WiMAX.Packet-Flow-Descriptor-v2.Classifier.Src-Spec.Assigned != 1) {
+if (!(&Vendor-Specific.WiMAX.Packet-Flow-Descriptor-v2.Classifier.Src-Spec.Assigned == 1)) {
test_fail
}
# First choice
#
&Tmp-String-2 := "%{%{Tmp-String-0}:-%{Tmp-String-1}}"
-if (&Tmp-String-2 != 'foo') {
+if (!(&Tmp-String-2 == 'foo')) {
test_fail
}
#
&request -= &Tmp-String-0[*]
&Tmp-String-2 := "%{%{Tmp-String-0}:-%{Tmp-String-1}}"
-if (&Tmp-String-2 != 'bar') {
+if (!(&Tmp-String-2 == 'bar')) {
test_fail
}
&Tmp-IP-Address-0 = 192.0.2.1
&Tmp-IP-Address-0 = 192.0.2.2
}
-if ("%{Tmp-IP-Address-0[#]}" != 2) {
+if (!("%{Tmp-IP-Address-0[#]}" == 2)) {
test_fail
}
-if ((&Tmp-IP-Address-0[0] != 192.0.2.1) || ("%{Tmp-IP-Address-0[1]}" != 192.0.2.2)) {
+if (!((&Tmp-IP-Address-0[0] == 192.0.2.1)) || (!("%{Tmp-IP-Address-0[1]}" == 192.0.2.2))) {
test_fail
}
-if ("%{Tmp-IP-Address-0[*]}" != '192.0.2.1192.0.2.2') {
+if (!("%{Tmp-IP-Address-0[*]}" == '192.0.2.1192.0.2.2')) {
test_fail
}
&Tmp-Integer-0 = "%{Tmp-IP-Address-0[#]}"
}
-if (&Tmp-String-0 != '192.0.2.1,192.0.2.2') {
+if (!(&Tmp-String-0 == '192.0.2.1,192.0.2.2')) {
test_fail
}
-if (&Tmp-Integer-0 != 2) {
+if (!(&Tmp-Integer-0 == 2)) {
test_fail
}
#
&Tmp-String-0 := "%(config:modules.test.boolean)"
-if (&Tmp-String-0 != "no") {
+if (!(&Tmp-String-0 == "no")) {
test_fail
}
&Tmp-String-0 := "test"
&Tmp-Integer-0 := "%(config:modules.%{Tmp-String-0}.integer)"
-if (&Tmp-Integer-0 != 1) {
+if (!(&Tmp-Integer-0 == 1)) {
test_fail
}
#
&Tmp-Octets-0 := 0x520d0103abcdef0206010203040506
-if ("%(decode.dhcpv4:%{Tmp-Octets-0})" != 2) {
+if (!("%(decode.dhcpv4:%{Tmp-Octets-0})" == 2)) {
test_fail
}
-if (&Relay-Agent-Information.Circuit-Id != 0xabcdef) {
+if (!(&Relay-Agent-Information.Circuit-Id == 0xabcdef)) {
test_fail
}
-if (&Relay-Agent-Information.Remote-Id != 0x010203040506) {
+if (!(&Relay-Agent-Information.Remote-Id == 0x010203040506)) {
test_fail
}
# Regression test for double consecutive alternations
&Tmp-uint64-0 := "%{%{Acct-Input-Octets}:-2}%{%{Acct-Input-Gigawords}:-1}"
-if (&Tmp-uint64-0 != 21) {
+if (!(&Tmp-uint64-0 == 21)) {
test_fail
}
test_fail
}
-if ("\%D" != '%D') {
+if (!("\%D" == '%D')) {
test_fail
}
#
# Verify non string types are treated as literals
#
-if ("%{eval:%{Tmp-Integer-0}}" != 4) {
+if (!("%{eval:%{Tmp-Integer-0}}" == 4)) {
test_fail
}
-if ("%{eval:%{Tmp-Integer-0[1]}}" != 8) {
+if (!("%{eval:%{Tmp-Integer-0[1]}}" == 8)) {
test_fail
}
#
# Check double expansion works
#
-if ("%{eval:%{Tmp-String-0}}" != 'foo') {
+if (!("%{eval:%{Tmp-String-0}}" == 'foo')) {
test_fail
}
#
# Using an attribute as a dynamic index for another attribute
#
-if ("%{eval:\%{Tmp-String-1[%{Tmp-Integer-0[2]}]\}}" != 'bar') {
+if (!("%{eval:\%{Tmp-String-1[%{Tmp-Integer-0[2]}]\}}" == 'bar')) {
test_fail
}
# User-Password contains characters that need escaping
&Tmp-String-2 := `/bin/echo %{User-Password}`
-if (&Tmp-String-2 != &User-Password) {
+if (!(&Tmp-String-2 == &User-Password)) {
test_fail
} else {
&User-Password := "hello"
debug_all
-if ("%{Tmp-String-1}" != "1=1,my_attr=2,my_attr=hello") {
+if (!("%{Tmp-String-1}" == "1=1,my_attr=2,my_attr=hello")) {
test_fail
}
-if ("%{Tmp-String-2}" != "") {
+if (!("%{Tmp-String-2}" == "")) {
test_fail
}
-if ("%{Tmp-String-3}" != "hello,goodbye,morning,night,1") {
+if (!("%{Tmp-String-3}" == "hello,goodbye,morning,night,1")) {
test_fail
}
&Tmp-Integer-0 := "%(debug:4)"
# Check debug level is now 4
-if ("%(debug:4)" != 4) {
+if (!("%(debug:4)" == 4)) {
test_fail
}
"%(debug:%{Tmp-Integer-0})"
# Read out the current debug level to verify it changed
-if ("%(debug:%{Tmp-Integer-0})" != "%{Tmp-Integer-0}") {
+if (!("%(debug:%{Tmp-Integer-0})" == "%{Tmp-Integer-0}")) {
test_fail
}
&Tmp-String-1 := "%(interpreter:.name)"
&Tmp-String-2 := "%(interpreter:.type)"
-if (&Tmp-String-0 != "src/tests/keywords/xlat-interpreter") {
+if (!(&Tmp-String-0 == "src/tests/keywords/xlat-interpreter")) {
test_fail
}
-if (&Tmp-String-1 != "&Tmp-String-1") {
+if (!(&Tmp-String-1 == "&Tmp-String-1")) {
test_fail
}
-if (&Tmp-String-2 != "edit") {
+if (!(&Tmp-String-2 == "edit")) {
test_fail
}
-if (&Tmp-Integer-0 != 9) {
+if (!(&Tmp-Integer-0 == 9)) {
test_fail
}
&Tmp-Octets-0 = 0x0706050403020100
}
-if ("%{Tmp-Octets-0}" != '0x0001020304050607') {
+if (!("%{Tmp-Octets-0}" == '0x0001020304050607')) {
test_fail
}
-if ("%{Tmp-Octets-0[0]}" != '0x0001020304050607') {
+if (!("%{Tmp-Octets-0[0]}" == '0x0001020304050607')) {
test_fail
}
-if ("%{Tmp-Octets-0[*]}" != '0x00010203040506070x0706050403020100') {
+if (!("%{Tmp-Octets-0[*]}" == '0x00010203040506070x0706050403020100')) {
test_fail
}
# like every other data type. If we want to *convert* the octets to
# a string, we have to use "%{string:...}"
#
-if ((string)&Tmp-Octets-0 != "0x5c5c") {
+if (!((string)&Tmp-Octets-0 == "0x5c5c")) {
test_fail
}
test_fail
}
-if (&Tmp-String-0 != "\\\\") {
+if (!(&Tmp-String-0 == "\\\\")) {
test_fail
}
#
# Test interpolation between string expansions and strings
#
-if ("%{string:%{Tmp-Octets-4}}%{string:%{Tmp-Octets-5}}" != "test1test2") {
+if (!("%{string:%{Tmp-Octets-4}}%{string:%{Tmp-Octets-5}}" == "test1test2")) {
test_fail
}
-if ("test0%{string:%{Tmp-Octets-4}}%{string:%{Tmp-Octets-5}}" != "test0test1test2") {
+if (!("test0%{string:%{Tmp-Octets-4}}%{string:%{Tmp-Octets-5}}" == "test0test1test2")) {
test_fail
}
-if ("%{string:%{Tmp-Octets-4}}%{string:%{Tmp-Octets-5}}test3" != "test1test2test3") {
+if (!("%{string:%{Tmp-Octets-4}}%{string:%{Tmp-Octets-5}}test3" == "test1test2test3")) {
test_fail
}
test_fail
}
-if (&Tmp-String-2 != "I\000I") {
+if (!(&Tmp-String-2 == "I\000I")) {
test_fail
}
-if (&Tmp-String-3 != "\000") {
+if (!(&Tmp-String-3 == "\000")) {
test_fail
}
#
# Check that newlines really are newlines
-if ("%(length:%{Tmp-String-1})" != 3) {
+if (!("%(length:%{Tmp-String-1})" == 3)) {
test_fail
}