Commits

Paweł Wieczorek  committed d6e3571 Draft

cleaning

  • Participants
  • Parent commits d5fda6d

Comments (0)

Files changed (1)

File tests/data/Testdata_messages.ml

 module Valid_messages = struct
     open Util
 
-    let message_001 = prepare_valid_message "basic invite RFC3261.4"
-        [ "INVITE sip:bob@biloxi.com SIP/2.0" 
-        ; "Via: SIP/2.0/UDP pc33.atlanta.com;branch=z9hG4bK776asdhds" 
-        ; "Max-Forwards: 70" 
-        ; "To: Bob <sip:bob@biloxi.com>" 
-        ; "From: Alice <sip:alice@atlanta.com>;tag=1928301774" 
-        ; "Call-ID: a84b4c76e66710@pc33.atlanta.com" 
-        ; "CSeq: 314159 INVITE"
-        ; "Contact: <sip:alice@pc33.atlanta.com>"
-        ; "Content-Type: application/sdp"
-        ; "Content-Length: 142"
-        ; ""
-        ; String.repeat "a" 142
-        ]
+    let messages = 
+        [ prepare_valid_message "basic invite RFC3261.4"
+            [ "INVITE sip:bob@biloxi.com SIP/2.0" 
+            ; "Via: SIP/2.0/UDP pc33.atlanta.com;branch=z9hG4bK776asdhds" 
+            ; "Max-Forwards: 70" 
+            ; "To: Bob <sip:bob@biloxi.com>" 
+            ; "From: Alice <sip:alice@atlanta.com>;tag=1928301774" 
+            ; "Call-ID: a84b4c76e66710@pc33.atlanta.com" 
+            ; "CSeq: 314159 INVITE"
+            ; "Contact: <sip:alice@pc33.atlanta.com>"
+            ; "Content-Type: application/sdp"
+            ; "Content-Length: 142"
+            ; ""
+            ; String.repeat "a" 142
+            ]
 
-        [ descr_max_forwards 70
-        ; descr_sip_version SIP_2_0
-        ; descr_content_length 142
+            [ descr_max_forwards 70
+            ; descr_sip_version SIP_2_0
+            ; descr_content_length 142
 
-        ; descr_mime_fields "Via"
-            [ "SIP/2.0/UDP pc33.atlanta.com;branch=z9hG4bK776asdhds" 
+            ; descr_mime_fields "Via"
+                [ "SIP/2.0/UDP pc33.atlanta.com;branch=z9hG4bK776asdhds" 
+                ]
             ]
-        ]
 
 
-    let message_002 = prepare_valid_message "invite with multipart body RFC3261.23.4.2"
-        [ "INVITE sip:bob@biloxi.com SIP/2.0"
-        ; "Via: SIP/2.0/UDP pc33.atlanta.com;branch=z9hG4bKnashds8"
-        ; "To: Bob <sip:bob@biloxi.com>"
-        ; "From: Alice <sip:alice@atlanta.com>;tag=1928301774"
-        ; "Call-ID: a84b4c76e66710"
-        ; "CSeq: 314159 INVITE"
-        ; "Max-Forwards: 70"
-        ; "Date: Thu, 21 Feb 2002 13:02:03 GMT"
-        ; "Contact: <sip:alice@pc33.atlanta.com>"
-        ; "Content-Type: multipart/signed;"
-        ; "protocol=\"application/pkcs7-signature\";"
-        ; "micalg=sha1; boundary=boundary42"
-        ; "Content-Length: 568"
-        ; ""
-        ; "--boundary42"
-        ; "Content-Type: message/sip"
-        ; ""
-        ; "INVITE sip:bob@biloxi.com SIP/2.0"
-        ; "Via: SIP/2.0/UDP pc33.atlanta.com;branch=z9hG4bKnashds8"
-        ; "To: Bob <bob@biloxi.com>"
-        ; "From: Alice <alice@atlanta.com>;tag=1928301774"
-        ; "Call-ID: a84b4c76e66710"
-        ; "CSeq: 314159 INVITE"
-        ; "Max-Forwards: 70"
-        ; "Date: Thu, 21 Feb 2002 13:02:03 GMT"
-        ; "Contact: <sip:alice@pc33.atlanta.com>"
-        ; "Content-Type: application/sdp"
-        ; "Content-Length: 147"
-        ; ""
-        ; "v=0"
-        ; "o=UserA 2890844526 2890844526 IN IP4 here.com"
-        ; "s=Session SDP"
-        ; "c=IN IP4 pc33.atlanta.com"
-        ; "t=0 0"
-        ; "m=audio 49172 RTP/AVP 0"
-        ; "a=rtpmap:0 PCMU/8000"
-        ; ""
-        ; "--boundary42"
-        ; "Content-Type: application/pkcs7-signature; name=smime.p7s"
-        ; "Content-Transfer-Encoding: base64"
-        ; "Content-Disposition: attachment; filename=smime.p7s;"
-        ; " handling=required"
-        ; "ghyHhHUujhJhjH77n8HHGTrfvbnj756tbB9HG4VQpfyF467GhIGfHfYT6"
-        ; "4VQpfyF467GhIGfHfYT6jH77n8HHGghyHhHUujhJh756tbB9HGTrfvbnj"
-        ; "n8HHGTrfvhJhjH776tbB9HG4VQbnj7567GhIGfHfYT6ghyHhHUujpfyF4"
-        ; "7GhIGfHfYT64VQbnj756"
-        ; ""
-        ; "--boundary42-"
-        ]
+        ; prepare_valid_message "invite with multipart body RFC3261.23.4.2"
+            [ "INVITE sip:bob@biloxi.com SIP/2.0"
+            ; "Via: SIP/2.0/UDP pc33.atlanta.com;branch=z9hG4bKnashds8"
+            ; "To: Bob <sip:bob@biloxi.com>"
+            ; "From: Alice <sip:alice@atlanta.com>;tag=1928301774"
+            ; "Call-ID: a84b4c76e66710"
+            ; "CSeq: 314159 INVITE"
+            ; "Max-Forwards: 70"
+            ; "Date: Thu, 21 Feb 2002 13:02:03 GMT"
+            ; "Contact: <sip:alice@pc33.atlanta.com>"
+            ; "Content-Type: multipart/signed;"
+            ; "protocol=\"application/pkcs7-signature\";"
+            ; "micalg=sha1; boundary=boundary42"
+            ; "Content-Length: 568"
+            ; ""
+            ; "--boundary42"
+            ; "Content-Type: message/sip"
+            ; ""
+            ; "INVITE sip:bob@biloxi.com SIP/2.0"
+            ; "Via: SIP/2.0/UDP pc33.atlanta.com;branch=z9hG4bKnashds8"
+            ; "To: Bob <bob@biloxi.com>"
+            ; "From: Alice <alice@atlanta.com>;tag=1928301774"
+            ; "Call-ID: a84b4c76e66710"
+            ; "CSeq: 314159 INVITE"
+            ; "Max-Forwards: 70"
+            ; "Date: Thu, 21 Feb 2002 13:02:03 GMT"
+            ; "Contact: <sip:alice@pc33.atlanta.com>"
+            ; "Content-Type: application/sdp"
+            ; "Content-Length: 147"
+            ; ""
+            ; "v=0"
+            ; "o=UserA 2890844526 2890844526 IN IP4 here.com"
+            ; "s=Session SDP"
+            ; "c=IN IP4 pc33.atlanta.com"
+            ; "t=0 0"
+            ; "m=audio 49172 RTP/AVP 0"
+            ; "a=rtpmap:0 PCMU/8000"
+            ; ""
+            ; "--boundary42"
+            ; "Content-Type: application/pkcs7-signature; name=smime.p7s"
+            ; "Content-Transfer-Encoding: base64"
+            ; "Content-Disposition: attachment; filename=smime.p7s;"
+            ; " handling=required"
+            ; "ghyHhHUujhJhjH77n8HHGTrfvbnj756tbB9HG4VQpfyF467GhIGfHfYT6"
+            ; "4VQpfyF467GhIGfHfYT6jH77n8HHGghyHhHUujhJh756tbB9HGTrfvbnj"
+            ; "n8HHGTrfvhJhjH776tbB9HG4VQbnj7567GhIGfHfYT6ghyHhHUujpfyF4"
+            ; "7GhIGfHfYT64VQbnj756"
+            ; ""
+            ; "--boundary42-"
+            ]
 
-        [ descr_max_forwards 70
-        ; descr_sip_version SIP_2_0
-        ; descr_content_length 568
-        ]
+            [ descr_max_forwards 70
+            ; descr_sip_version SIP_2_0
+            ; descr_content_length 568
+            ]
 
-    let message_003 = prepare_valid_message "basic invite RFC3261.4, but as SIP/1.0"
-        [ "INVITE sip:bob@biloxi.com SIP/1.0" 
-        ; "Via: SIP/2.0/UDP pc33.atlanta.com;branch=z9hG4bK776asdhds" 
-        ; "Max-Forwards: 70" 
-        ; "To: Bob <sip:bob@biloxi.com>" 
-        ; "From: Alice <sip:alice@atlanta.com>;tag=1928301774" 
-        ; "Call-ID: a84b4c76e66710@pc33.atlanta.com" 
-        ; "CSeq: 314159 INVITE"
-        ; "Contact: <sip:alice@pc33.atlanta.com>"
-        ; "Content-Type: application/sdp"
-        ; "Content-Length: 142"
-        ; ""
-        ; String.repeat "a" 142
-        ]
+        ; prepare_valid_message "basic invite RFC3261.4, but as SIP/1.0"
+            [ "INVITE sip:bob@biloxi.com SIP/1.0" 
+            ; "Via: SIP/2.0/UDP pc33.atlanta.com;branch=z9hG4bK776asdhds" 
+            ; "Max-Forwards: 70" 
+            ; "To: Bob <sip:bob@biloxi.com>" 
+            ; "From: Alice <sip:alice@atlanta.com>;tag=1928301774" 
+            ; "Call-ID: a84b4c76e66710@pc33.atlanta.com" 
+            ; "CSeq: 314159 INVITE"
+            ; "Contact: <sip:alice@pc33.atlanta.com>"
+            ; "Content-Type: application/sdp"
+            ; "Content-Length: 142"
+            ; ""
+            ; String.repeat "a" 142
+            ]
 
-        [ descr_max_forwards 70
-        ; descr_sip_version SIP_1_0
-        ; descr_content_length 142
+            [ descr_max_forwards 70
+            ; descr_sip_version SIP_1_0
+            ; descr_content_length 142
 
-        ; descr_mime_fields "Via"
-            [ "SIP/2.0/UDP pc33.atlanta.com;branch=z9hG4bK776asdhds" 
+            ; descr_mime_fields "Via"
+                [ "SIP/2.0/UDP pc33.atlanta.com;branch=z9hG4bK776asdhds" 
+                ]
             ]
-        ]
 
-    let message_004 = prepare_valid_message "basic invite RFC3261.4, but as SIP/1.5"
-        [ "INVITE sip:bob@biloxi.com SIP/1.5" 
-        ; "Via: SIP/2.0/UDP pc33.atlanta.com;branch=z9hG4bK776asdhds" 
-        ; "Max-Forwards: 70" 
-        ; "To: Bob <sip:bob@biloxi.com>" 
-        ; "From: Alice <sip:alice@atlanta.com>;tag=1928301774" 
-        ; "Call-ID: a84b4c76e66710@pc33.atlanta.com" 
-        ; "CSeq: 314159 INVITE"
-        ; "Contact: <sip:alice@pc33.atlanta.com>"
-        ; "Content-Type: application/sdp"
-        ; "Content-Length: 142"
-        ; ""
-        ; String.repeat "a" 142
-        ]
+        ; prepare_valid_message "basic invite RFC3261.4, but as SIP/1.5"
+            [ "INVITE sip:bob@biloxi.com SIP/1.5" 
+            ; "Via: SIP/2.0/UDP pc33.atlanta.com;branch=z9hG4bK776asdhds" 
+            ; "Max-Forwards: 70" 
+            ; "To: Bob <sip:bob@biloxi.com>" 
+            ; "From: Alice <sip:alice@atlanta.com>;tag=1928301774" 
+            ; "Call-ID: a84b4c76e66710@pc33.atlanta.com" 
+            ; "CSeq: 314159 INVITE"
+            ; "Contact: <sip:alice@pc33.atlanta.com>"
+            ; "Content-Type: application/sdp"
+            ; "Content-Length: 142"
+            ; ""
+            ; String.repeat "a" 142
+            ]
 
-        [ descr_max_forwards 70
-        ; descr_sip_version (UnknownSipVersion "1.5")
-        ; descr_content_length 142
+            [ descr_max_forwards 70
+            ; descr_sip_version (UnknownSipVersion "1.5")
+            ; descr_content_length 142
 
-        ; descr_mime_fields "Via"
-            [ "SIP/2.0/UDP pc33.atlanta.com;branch=z9hG4bK776asdhds" 
+            ; descr_mime_fields "Via"
+                [ "SIP/2.0/UDP pc33.atlanta.com;branch=z9hG4bK776asdhds" 
+                ]
             ]
-        ]
+    ]
 
-    let messages =
-        [ message_001
-        ; message_002
-        ; message_003
-        ; message_004
-        ]
 end
 
 
 module Invalid_messages = struct
     open Util
 
-    let message_001 = prepare_invalid_message "basic invite RFC3261.4, without the Contact header"
-        [ "INVITE sip:bob@biloxi.com SIP/2.0" 
-        ; "Via: SIP/2.0/UDP pc33.atlanta.com;branch=z9hG4bK776asdhds" 
-        ; "Max-Forwards: 70" 
-        ; "To: Bob <sip:bob@biloxi.com>" 
-        ; "From: Alice <sip:alice@atlanta.com>;tag=1928301774" 
-        ; "Call-ID: a84b4c76e66710@pc33.atlanta.com" 
-        ; "CSeq: 314159 INVITE"
-        ; "Content-Type: application/sdp"
-        ; "Content-Length: 142"
-        ; ""
+    let messages =
+        [ prepare_invalid_message "basic invite RFC3261.4, without the Contact header"
+            [ "INVITE sip:bob@biloxi.com SIP/2.0" 
+            ; "Via: SIP/2.0/UDP pc33.atlanta.com;branch=z9hG4bK776asdhds" 
+            ; "Max-Forwards: 70" 
+            ; "To: Bob <sip:bob@biloxi.com>" 
+            ; "From: Alice <sip:alice@atlanta.com>;tag=1928301774" 
+            ; "Call-ID: a84b4c76e66710@pc33.atlanta.com" 
+            ; "CSeq: 314159 INVITE"
+            ; "Content-Type: application/sdp"
+            ; "Content-Length: 142"
+            ; ""
+            ; String.repeat "a" 142
+            ]
+
+        ; prepare_invalid_message "basic invite RFC3261.4, without the Call-ID header"
+            [ "INVITE sip:bob@biloxi.com SIP/2.0" 
+            ; "Via: SIP/2.0/UDP pc33.atlanta.com;branch=z9hG4bK776asdhds" 
+            ; "Max-Forwards: 70" 
+            ; "To: Bob <sip:bob@biloxi.com>" 
+            ; "From: Alice <sip:alice@atlanta.com>;tag=1928301774" 
+            ; "CSeq: 314159 INVITE"
+            ; "Contact: <sip:alice@pc33.atlanta.com>"
+            ; "Content-Type: application/sdp"
+            ; "Content-Length: 142"
+            ; ""
+            ; String.repeat "a" 142
+            ]
+
+        ; prepare_invalid_message "basic invite RFC3261.4, without the CSeq header"
+            [ "INVITE sip:bob@biloxi.com SIP/2.0" 
+            ; "Via: SIP/2.0/UDP pc33.atlanta.com;branch=z9hG4bK776asdhds" 
+            ; "Max-Forwards: 70" 
+            ; "To: Bob <sip:bob@biloxi.com>" 
+            ; "From: Alice <sip:alice@atlanta.com>;tag=1928301774" 
+            ; "Call-ID: a84b4c76e66710@pc33.atlanta.com" 
+            ; "Contact: <sip:alice@pc33.atlanta.com>"
+            ; "Content-Type: application/sdp"
+            ; "Content-Length: 142"
+            ; ""
+            ; String.repeat "a" 142
+            ]
+
+        ; prepare_invalid_message "basic invite RFC3261.4, without the Max-forwards header"
+            [ "INVITE sip:bob@biloxi.com SIP/2.0" 
+            ; "Via: SIP/2.0/UDP pc33.atlanta.com;branch=z9hG4bK776asdhds" 
+            ; "To: Bob <sip:bob@biloxi.com>" 
+            ; "From: Alice <sip:alice@atlanta.com>;tag=1928301774" 
+            ; "Call-ID: a84b4c76e66710@pc33.atlanta.com" 
+            ; "CSeq: 314159 INVITE"
+            ; "Contact: <sip:alice@pc33.atlanta.com>"
+            ; "Content-Type: application/sdp"
+            ; "Content-Length: 142"
+            ; ""
+            ; String.repeat "a" 142
+            ]
+
+        ; prepare_invalid_message "basic invite RFC3261.4, without MIME"
+            [ "INVITE sip:bob@biloxi.com SIP/2.0" 
+            ; ""
+            ]
+
+        ; prepare_invalid_message "basic invite RFC3261.4, as HTTP/1.1 message"
+            [ "INVITE sip:bob@biloxi.com HTTP/1.1" 
+            ; "Via: SIP/2.0/UDP pc33.atlanta.com;branch=z9hG4bK776asdhds" 
+            ; "Max-Forwards: 70" 
+            ; "To: Bob <sip:bob@biloxi.com>" 
+            ; "From: Alice <sip:alice@atlanta.com>;tag=1928301774" 
+            ; "Call-ID: a84b4c76e66710@pc33.atlanta.com" 
+            ; "CSeq: 314159 INVITE"
+            ; "Contact: <sip:alice@pc33.atlanta.com>"
+            ; "Content-Type: application/sdp"
+            ; "Content-Length: 142"
+            ; ""
+            ; String.repeat "a" 142
+            ]
         ]
 
-    let message_002 = prepare_invalid_message "basic invite RFC3261.4, without the Call-ID header"
-        [ "INVITE sip:bob@biloxi.com SIP/2.0" 
-        ; "Via: SIP/2.0/UDP pc33.atlanta.com;branch=z9hG4bK776asdhds" 
-        ; "Max-Forwards: 70" 
-        ; "To: Bob <sip:bob@biloxi.com>" 
-        ; "From: Alice <sip:alice@atlanta.com>;tag=1928301774" 
-        ; "CSeq: 314159 INVITE"
-        ; "Contact: <sip:alice@pc33.atlanta.com>"
-        ; "Content-Type: application/sdp"
-        ; "Content-Length: 142"
-        ; ""
-        ; String.repeat "a" 142
-        ]
-
-    let message_003 = prepare_invalid_message "basic invite RFC3261.4, without the CSeq header"
-        [ "INVITE sip:bob@biloxi.com SIP/2.0" 
-        ; "Via: SIP/2.0/UDP pc33.atlanta.com;branch=z9hG4bK776asdhds" 
-        ; "Max-Forwards: 70" 
-        ; "To: Bob <sip:bob@biloxi.com>" 
-        ; "From: Alice <sip:alice@atlanta.com>;tag=1928301774" 
-        ; "Call-ID: a84b4c76e66710@pc33.atlanta.com" 
-        ; "Contact: <sip:alice@pc33.atlanta.com>"
-        ; "Content-Type: application/sdp"
-        ; "Content-Length: 142"
-        ; ""
-        ; String.repeat "a" 142
-        ]
-
-    let message_004 = prepare_invalid_message "basic invite RFC3261.4, without the Max-forwards header"
-        [ "INVITE sip:bob@biloxi.com SIP/2.0" 
-        ; "Via: SIP/2.0/UDP pc33.atlanta.com;branch=z9hG4bK776asdhds" 
-        ; "To: Bob <sip:bob@biloxi.com>" 
-        ; "From: Alice <sip:alice@atlanta.com>;tag=1928301774" 
-        ; "Call-ID: a84b4c76e66710@pc33.atlanta.com" 
-        ; "CSeq: 314159 INVITE"
-        ; "Contact: <sip:alice@pc33.atlanta.com>"
-        ; "Content-Type: application/sdp"
-        ; "Content-Length: 142"
-        ; ""
-        ; String.repeat "a" 142
-        ]
-
-    let message_005 = prepare_invalid_message "basic invite RFC3261.4, without MIME"
-        [ "INVITE sip:bob@biloxi.com SIP/2.0" 
-        ; ""
-        ]
-
-    let messages =
-        [ message_001
-        ; message_002
-        ; message_003
-        ; message_004
-        ; message_005
-        ]
 
 end