New test case for nested wrong avp (Media-Component-Description -> Media-Sub-Componen...
authorEduardo Ramos Testillano <eduardo.ramos.testillano@ericsson.com>
Sat, 21 Mar 2015 19:15:21 +0000 (20:15 +0100)
committerEduardo Ramos Testillano <eduardo.ramos.testillano@ericsson.com>
Sat, 21 Mar 2015 19:15:21 +0000 (20:15 +0100)
example/diameter/launcher/resources/basic/hex_examples/aar2-bad.hex [new file with mode: 0644]
example/diameter/launcher/resources/basic/hex_examples/readme.txt [new file with mode: 0644]
example/diameter/launcher/resources/basic/xml_examples/aar2.xml [new file with mode: 0644]
example/diameter/launcher/resources/ft-client/tests/experiment2/ProtocolErrors/BadAARtoServer/aar2-bad.hex [new symlink]
example/diameter/launcher/resources/ft-client/tests/experiment2/ProtocolErrors/BadAARtoServer/case_1.tc
example/diameter/launcher/resources/ft-client/tests/experiment2/ProtocolErrors/BadAARtoServer/case_2.tc [new file with mode: 0644]

diff --git a/example/diameter/launcher/resources/basic/hex_examples/aar2-bad.hex b/example/diameter/launcher/resources/basic/hex_examples/aar2-bad.hex
new file mode 100644 (file)
index 0000000..4b5c1ed
--- /dev/null
@@ -0,0 +1 @@
+0100017cc000010901000014000000000000000000000107400000246f6373333b313333323737343433303b313b31333332373734343330000001024000000c01000014000001084000000c4f435333000001284000000c4f4353330000011b4000000c4f435333000001254000000c4f435333000001f8c000000f000028af3132320000000205c0000098000028af00000206c0000010000028af0000000000000207c000002c000028af000001fdc0000010000028af00000037000001ffc000000a000028af00000000000001f8c000000f000028af3132320000000204c0000010000028af0000007f00000203c0000010000028af00000085000001ffc0000010000028af00000002000001ca80000010000032db000000000000020fc0000010000028af00000000000001bb40000028000001c24000000c00000000000001bc4000001136323630333730393900000000000008000000133139322e3136382e302e31000000001e000000145741502e4d4f564953544152
diff --git a/example/diameter/launcher/resources/basic/hex_examples/readme.txt b/example/diameter/launcher/resources/basic/hex_examples/readme.txt
new file mode 100644 (file)
index 0000000..9d01a0c
--- /dev/null
@@ -0,0 +1,10 @@
+Bad messages:
+
+aar-bad.hex: comes from ../xml_examples/aar.xml
+             Consists in a deliberated bad length encoded on grouped Subscription-Id length field (not multiple of 4).
+
+aar2-bad.hex: comes from ../xml_examples/aar2.xml
+             Consists in a deliberated bad length encoded on enumerated Flow-Status avp 2-level nested inside Media-Component-Description:
+                         -> Media-Component-Description  (grouped)
+                            -> Media-Sub-Component       (grouped)
+                               -> Flow-Status            (enumerated)
diff --git a/example/diameter/launcher/resources/basic/xml_examples/aar2.xml b/example/diameter/launcher/resources/basic/xml_examples/aar2.xml
new file mode 100644 (file)
index 0000000..c163fb4
--- /dev/null
@@ -0,0 +1,28 @@
+<message version="1" name="AA-Request" p-bit="yes" application-id="16777236" hop-by-hop-id="0" end-by-end-id="0">
+   <avp name="Session-Id" data="ocs3;1332774430;1;1332774430"/>
+   <avp name="Auth-Application-Id" data="16777236"/>
+   <avp name="Origin-Host" data="OCS3"/>
+   <avp name="Origin-Realm" data="OCS3"/>
+   <avp name="Destination-Realm" data="OCS3"/>
+   <avp name="Destination-Host" data="OCS3"/>
+   <avp name="AF-Application-Identifier" hex-data="313232"/>
+   <avp name="Media-Component-Description">
+      <avp name="Media-Component-Number" data="0"/>
+      <avp name="Media-Sub-Component">
+         <avp name="Flow-Number" data="55"/>
+         <avp name="Flow-Status" data="0" alias="ENABLED-UPLINK"/>
+      </avp>
+      <avp name="AF-Application-Identifier" hex-data="313232"/>
+      <avp name="Max-Requested-Bandwidth-UL" data="127"/>
+      <avp name="Max-Requested-Bandwidth-DL" data="133"/>
+      <avp name="Flow-Status" data="2" alias="ENABLED"/>
+      <avp name="Reservation-Priority" data="0" alias="DEFAULT"/>
+   </avp>
+   <avp name="Service-Info-Status" data="0" alias="FINAL_SERVICE_INFORMATION"/>
+   <avp name="Subscription-Id">
+      <avp name="Subscription-Id-Type" data="0" alias="END_USER_E164"/>
+      <avp name="Subscription-Id-Data" data="626037099"/>
+   </avp>
+   <avp name="Framed-IP-Address" hex-data="3139322e3136382e302e31"/>
+   <avp name="Called-Station-Id" data="WAP.MOVISTAR"/>
+</message>
diff --git a/example/diameter/launcher/resources/ft-client/tests/experiment2/ProtocolErrors/BadAARtoServer/aar2-bad.hex b/example/diameter/launcher/resources/ft-client/tests/experiment2/ProtocolErrors/BadAARtoServer/aar2-bad.hex
new file mode 120000 (symlink)
index 0000000..5a6586d
--- /dev/null
@@ -0,0 +1 @@
+../../../../hex_examples/aar2-bad.hex
\ No newline at end of file
diff --git a/example/diameter/launcher/resources/ft-client/tests/experiment2/ProtocolErrors/BadAARtoServer/case_2.tc b/example/diameter/launcher/resources/ft-client/tests/experiment2/ProtocolErrors/BadAARtoServer/case_2.tc
new file mode 100644 (file)
index 0000000..1727638
--- /dev/null
@@ -0,0 +1,13 @@
+# Bad length encoded on enumerated Flow-Status avp 2-level nested (Media-Component-Description -> Media-Sub-Component -> Flow-Status)
+
+# Send malformed AAR to the server:
+SENDHEX2E aar2-bad.hex
+
+# Wait for message:
+WAIT4MESSAGE
+
+# Check Failed-AVP & Subscription-Id within:
+CHECKPATTERN <avp name="Result-Code" data="5014" alias="DIAMETER_INVALID_AVP_LENGTH"/>
+CHECKPATTERN <avp name="Failed-AVP">( *)<avp name="Media-Component-Description"
+
+# TODO: check that the complete hierarchy to Flow-Status (the real bad avp)