Commit 885c505e authored by Michael Proestler's avatar Michael Proestler
Browse files

Add AML Test Cases

parent 41ca61bb
Loading
Loading
Loading
Loading
+19 −1
Original line number Diff line number Diff line
@@ -93,7 +93,6 @@ module AtsLIS_Functions {
    }
	}
	
	
	function f_receiveResponse(template HttpMessage p_message) runs on HttpComponent return HttpMessage {
	  var HttpMessage v_response;

@@ -113,4 +112,23 @@ module AtsLIS_Functions {
        return v_response;
	}

	function f_receiveResponsePreamble(template HttpMessage p_message) runs on HttpComponent return HttpMessage {
	  var HttpMessage v_response;

	  alt {
          [] httpPort.receive(p_message) -> value v_response {
             f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
          }
          [] httpPort.receive {
            f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_error);
          }
          [] tc_ac.timeout {
            log("*** " & testcasename() & ": INCONC: Expected message not received ***");
            f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout);
          }
        }
        
        return v_response;
	}

}
+11 −1
Original line number Diff line number Diff line
@@ -44,10 +44,20 @@ module AtsLIS_Pics {
   */
  modulepar boolean PICS_LIS_AML_HTTP := true

  /**
   * @desc Does the IUT support AML via SMS Text?
   */
  modulepar boolean PICS_LIS_AML_TEXT_SMS := true

  /**
   * @desc Does the IUT support AML via SMS Text?
   */
  modulepar boolean PICS_LIS_AML_DATA_SMS := true

  /**
   * @desc HTTP post URI for LIS protocol
   */
  modulepar charstring PICS_PSAP_LIS_URI := "/";
  modulepar charstring PICS_LIS_URI := "/";

  
  /**
+15 −0
Original line number Diff line number Diff line
@@ -59,4 +59,19 @@ module AtsLIS_Pixits {
   */
  modulepar DoubleList PX_DEVICE_NUMBER_POINT_POS := { 43.623013, 7.046185 }; // ALICE01
  

  /** Advanced Mobile Location */

  /**
  * @desc The number of the mobile used for sending SMS
  */
  modulepar charstring PX_AML_MOBILE_NUMBER := "0043123456789";

  /**
  * @desc The number of the LIS to receive SMS
  */
  modulepar charstring PX_AML_LIS_ENDPOINT_NUMBER := "0043987654321";
  
  modulepar charstring PX_AML_MESSAGE := "A\"ML=1;lt=+54.76397;lg=-0.18305;rd=50;top=20130717141935;lc=90;pm=W;si=123456789012345;ei=1234567890123456;mcc=234;mnc=30;ml=128"

} // End of module AtsLIS_Pixits 
+100 −69
Original line number Diff line number Diff line
@@ -412,7 +412,7 @@ module AtsLIS_TestCases {
         	 presence := omit
        }
                       
        v_response := f_receiveResponse(mw_http_location_response(mdw_location_response));
        v_response := f_receiveResponsePreamble(mw_http_location_response(mdw_location_response));
        
        var template charstring v_uri_pattern := "(http[s]#(0,1))://([^/\\s]+)/(?+)";
        var charstring v_uri;
@@ -600,68 +600,6 @@ module AtsLIS_TestCases {
  
  } // End of Group Errors

 group Subscriptions {

   function f_TC_LIS_SIP_BV_01() runs on ImsComponent {
        var CSeq v_cSeq_s := {
          fieldName := CSEQ_E,
          seqNumber := 5,
          method := "SUBSCRIBE"
        };
               
        
          // Test component configuration
        f_init_userprofile(c_userProfile_UE1atSUThome);
        f_initSipUrl(c_userProfile_UE1atSUThome);
        f_init_interfaceprofile(c_interfaceProfile_IMS_SUT_BCF);
        
        LibIms_Steps.f_setHeadersSUBSCRIBE(v_cSeq_s, f_initSipUrl(c_userProfile_UE1atSUThome), f_initSipUrl(c_serviceProfile_EMERGENCY));        

        // Preamble        
        template SUBSCRIBE_Request request := m_SUBSCRIBE_Request_Event(
          vc_requestUri, vc_callId ,v_cSeq_s, vc_from, vc_to, vc_via, omit, m_Event_presence          
        );

        log("gg-request:");
        log(request);

        f_SendSUBSCRIBE(request);
        f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);

        // Test Body
        f_awaitingResponse(mw_Response_Base(c_statusLine200, vc_callId, vc_cSeq));
        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);

        // Postamble
         f_clientSyncAndVerdictPostamble(c_poDone, e_success);
   }

    /**
     * @desc "IUT responds to a SIP Subscribe for presence event package with an 200 OK" 
     */
    testcase TC_LIS_SIP_BV_01() runs on HttpImsComponent system TestAdapter {             
        // Local variables
        var ImsComponent v_subscriber;
        
        // Test control
        f_check_pics({ values := {PICS_LIS_SIP_SUBSCRIPTION}, names := {"PICS_LIS_SIP_SUBSCRIPTION"}});
        
        // Test component configuration      
        f_cf_01_sip_up(v_subscriber);        
        // Preamble
         
        v_subscriber.start(f_TC_LIS_SIP_BV_01());
                

        // Test Body                                
         f_serverSyncNClientsAndStop(1, {c_prDone, c_tbDone, c_poDone});
                                           
        // Postamble
        f_cf_01_sip_down(v_subscriber);
    } // End of testcase TC_LIS_HELD_BI_02
  }


  group AdvancedMobileLocation {
    
    /**
@@ -720,7 +658,7 @@ module AtsLIS_TestCases {
        var charstring url_params := "&v=3" & v_device_number & v_location_latitude & v_location_longitude & "&location_time=1476189444435&location_accuracy=10.4&location_source=GPS&location_certainty=83&device_imei=354773072099116&device_imsi=234159176307582&cell_network_mcc=234&cell_network_mnc=15"
		    
        f_sendAdvancedMobileLocation(url_params);    
        f_receiveResponse(mw_http_response(
        f_receiveResponsePreamble(mw_http_response(
          {
            version_major := 1,
            version_minor := 1,
@@ -761,7 +699,100 @@ module AtsLIS_TestCases {
        // Postamble
        f_cf_01_http_down();
    } // End of testcase TC_LIS_AML_BV_02

    /**
     * @desc "IUT successfully responds with a Circle for provided AML Data via SMS Text "
     */
    testcase TC_LIS_AML_BV_03() runs on HttpComponent system TestAdapter {                             
        // Test control
        f_check_pics({ values := {PICS_LIS_AML_TEXT_SMS, PICS_LIS_HELD_BY_VALUE, PICS_LIS_GEOMETRY_CIRCLE }, names := {"PICS_LIS_AML_TEXT_SMS", "PICS_LIS_HELD_BY_VALUE", "PICS_LIS_GEOMETRY_CIRCLE"}});
        
        // Test component configuration
        f_cf_01_http_up();
        
        // Preamble
		    f_sendRequest(m_locationRequest({encvalue_unichar(valueof(m_device({ "<uri>tel:" & PX_AML_MOBILE_NUMBER & "</uri>"})))}));
        f_receiveResponsePreamble(mw_http_error_response(mw_error_type("locationUnknown")));        

        f_checkUserInfo("Send Text SMS containing '" & AtsLIS_Pixits.PX_AML_MESSAGE & "' from " & AtsLIS_Pixits.PX_AML_MOBILE_NUMBER & " to " & AtsLIS_Pixits.PX_AML_LIS_ENDPOINT_NUMBER, 60.0);                

        var float v_latitude := str2float(regexp(AtsLIS_Pixits.PX_AML_MESSAGE, charstring:"(?+)lt=([+\-0-9.]+);?+", 1));
        var float v_longitude := str2float(regexp(AtsLIS_Pixits.PX_AML_MESSAGE, charstring:"(?+)lg=([+\-0-9.]+);?+", 1));
        var float v_radius := str2float(regexp(AtsLIS_Pixits.PX_AML_MESSAGE, charstring:"(?+)rd=([+\-0-9.]+);?+", 1));

        // Test Body
        tc_ac.start;                                                                                                   
		    f_sendRequest(m_locationRequest({encvalue_unichar(valueof(m_device({ "<uri>tel:" & PX_AML_MOBILE_NUMBER & "</uri>"})))}));
                   
        template Circle mw_expected_circle := mw_circle(mw_center_group_pos_1((v_latitude - PX_DOUBLE_CMP_EPSILON .. v_latitude + PX_DOUBLE_CMP_EPSILON), (v_longitude - PX_DOUBLE_CMP_EPSILON .. v_longitude + PX_DOUBLE_CMP_EPSILON)), mw_radius(PX_CIRCLE_UOM, (v_radius - PX_DOUBLE_CMP_EPSILON .. v_radius + PX_DOUBLE_CMP_EPSILON)), PX_SRS_NAME);

        template LocationResponseType mdw_location_response modifies mw_location_response := {
          locationUriSet := omit,
          presence := {
            tuple_list := {
              	{          		
                  	status := {                	
    	                geopriv := mw_geopriv({ circle := mw_expected_circle})	                
        	      	}                     
          		}
            }
          }
        }         

                            
        f_receiveResponse(mw_http_location_response(mdw_location_response));     
			                                     
        // Postamble
        f_cf_01_http_down();
    } // End of testcase TC_LIS_AML_BV_03


    /**
     * @desc "IUT successfully responds with a Circle for provided AML Data via SMS Data "
     */
    testcase TC_LIS_AML_BV_04() runs on HttpComponent system TestAdapter {                             
        // Test control
        f_check_pics({ values := {PICS_LIS_AML_DATA_SMS, PICS_LIS_HELD_BY_VALUE, PICS_LIS_GEOMETRY_CIRCLE }, names := {"PICS_LIS_AML_DATA_SMS", "PICS_LIS_HELD_BY_VALUE", "PICS_LIS_GEOMETRY_CIRCLE"}});
        
        // Test component configuration
        f_cf_01_http_up();
        
        // Preamble
		    f_sendRequest(m_locationRequest({encvalue_unichar(valueof(m_device({ "<uri>tel:" & PX_AML_MOBILE_NUMBER & "</uri>"})))}));
        f_receiveResponsePreamble(mw_http_error_response(mw_error_type("locationUnknown")));        

        f_checkUserInfo("Send Data SMS containing '" & AtsLIS_Pixits.PX_AML_MESSAGE & "' from " & AtsLIS_Pixits.PX_AML_MOBILE_NUMBER & " to " & AtsLIS_Pixits.PX_AML_LIS_ENDPOINT_NUMBER, 60.0);                

        var float v_latitude := str2float(regexp(AtsLIS_Pixits.PX_AML_MESSAGE, charstring:"(?+)lt=([+\-0-9.]+);?+", 1));
        var float v_longitude := str2float(regexp(AtsLIS_Pixits.PX_AML_MESSAGE, charstring:"(?+)lg=([+\-0-9.]+);?+", 1));
        var float v_radius := str2float(regexp(AtsLIS_Pixits.PX_AML_MESSAGE, charstring:"(?+)rd=([+\-0-9.]+);?+", 1));

        // Test Body
        tc_ac.start;                                                                                                   
		    f_sendRequest(m_locationRequest({encvalue_unichar(valueof(m_device({ "<uri>tel:" & PX_AML_MOBILE_NUMBER & "</uri>"})))}));
                   
        template Circle mw_expected_circle := mw_circle(mw_center_group_pos_1((v_latitude - PX_DOUBLE_CMP_EPSILON .. v_latitude + PX_DOUBLE_CMP_EPSILON), (v_longitude - PX_DOUBLE_CMP_EPSILON .. v_longitude + PX_DOUBLE_CMP_EPSILON)), mw_radius(PX_CIRCLE_UOM, (v_radius - PX_DOUBLE_CMP_EPSILON .. v_radius + PX_DOUBLE_CMP_EPSILON)), PX_SRS_NAME);

        template LocationResponseType mdw_location_response modifies mw_location_response := {
          locationUriSet := omit,
          presence := {
            tuple_list := {
              	{          		
                  	status := {                	
    	                geopriv := mw_geopriv({ circle := mw_expected_circle})	                
        	      	}                     
          		}
            }
          }
        }         

                            
        f_receiveResponse(mw_http_location_response(mdw_location_response));     
			                                     
        // Postamble
        f_cf_01_http_down();
    } // End of testcase TC_LIS_AML_BV_04

  } // End of group AdvancedMobileLocation

} // End of module AtsLIS_TestCases