Commit b961bd8b authored by Michael Proestler's avatar Michael Proestler
Browse files

Add LIS/ECRF Security Test Cases

parent 2b7be269
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -2,6 +2,11 @@ module AtsECRF_Pics {
  
  type record of charstring request_uri_list;
  
  /**
  * @desc Does the IUT support mutual tls authentication?
  */
  modulepar boolean PICS_ECRF_TLS_AUTHENTICATION := true

  /**
  * @desc Does the IUT support FindService
  */
+90 −0
Original line number Diff line number Diff line
@@ -1465,6 +1465,96 @@ module AtsECRF_TestCases {
        // Postamble
        f_cf_01_down();
    } // End of testcase TC_ECRF_SIP_BV_09
  }

  group Security {

    testcase TC_ECRF_TLS_BI_01() runs on HttpComponent system TestAdapter {
        // Test control        
        f_check_statements({
          { name := "PICS_ECRF_TLS_AUTHENTICATION", val := PICS_ECRF_TLS_AUTHENTICATION }        
        })

        // Preamble
        f_cf_01_http_up();
        f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); 

        // Test Body
        @try {          
          f_sendFindServiceRequest(
              m_find_service_request(
                                {
                                  m_location(
                                              PX_LOCATION_ID,
                                              { m_extension_point(encvalue_unichar(valueof(m_point(PX_POINT_IN_G1, PX_SRS_NAME, "point1")))) },
                                              "geodetic-2d" // TODO Use a Pixit
                                              )
                                },
                                { },
                                PX_E_POLICE_SERVICE_URN,
                                true
                              )
          );

          log("The IUT should reject the connection.");
          // Should not get here since connection should have been refused
          f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);

        } @catch(err) {
          if (match(err, pattern "*There is no connection alive*")) {
              f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);     
          }     
        }
                

        // Postamble
        f_cf_01_http_down();
    }

    testcase TC_ECRF_TLS_BI_02() runs on HttpSipComponent system TestAdapter {
        // Local Variables
        var CSeq v_cSeq_s := {
          fieldName := CSEQ_E,
          seqNumber := 0,
          method := "SUBSCRIBE"
        };

        var SipUrl v_subscription_target :=  f_initSipUrl(c_serviceProfile_SUBSCRIPTION_SERVICE);

        // Test control        
        f_check_statements({
          { name := "PICS_ECRF_TLS_AUTHENTICATION", val := PICS_ECRF_TLS_AUTHENTICATION }        
        })

        // Preamble
        f_cf_01_up();                          
        f_init_userprofile(c_userProfile_ESINetSubscriber);        
        f_init_interfaceprofile(c_interfaceProfile_SUT_ECRF);
        
        // Preamble         
        LibIms_Steps.f_setHeadersSUBSCRIBE(v_cSeq_s, v_subscription_target, f_initSipUrl(c_serviceProfile_SUBSCRIBER));                                
        
        // Test Body
        template SUBSCRIBE_Request request := m_SUBSCRIBE_ServiceState_Request_Event(
          v_subscription_target, vc_callId ,v_cSeq_s, vc_from, vc_to, vc_via, omit
        );

        @try {
          f_SendSUBSCRIBE(request);

          log("The IUT should reject the connection."); 
          // Should not get here since connection should have been refused
          f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
        
        } @catch(err) {
          if (match(err, pattern "*There is no connection alive*")) {
              f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);     
          }     
        }
            
        // Postamble
        f_cf_01_down();
    }

  }

+5 −1
Original line number Diff line number Diff line
module AtsLIS_Pics {

  /**
  * @desc Does the IUT support mutual tls authentication?
  */
  modulepar boolean PICS_LIS_TLS_AUTHENTICATION := true

  /**
   * @desc Does the IUT support HELD by Value?
   */
  modulepar boolean PICS_LIS_HELD_BY_VALUE := true;


  /**
   * @desc Does the IUT support HELD by Reference?
   */
+74 −1
Original line number Diff line number Diff line
@@ -1347,4 +1347,77 @@ module AtsLIS_TestCases {

  } // End of group AdvancedMobileLocation

  group Security {

    testcase TC_LIS_TLS_BI_01() runs on HttpComponent system TestAdapter {
        // Test control        
        f_check_pics({ values := {PICS_LIS_TLS_AUTHENTICATION }, names := {"PICS_LIS_TLS_AUTHENTICATION"}});

        // Preamble
        f_cf_01_http_up();
        f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); 

        // Test Body
        @try {          
          f_sendRequest(m_locationRequest({encvalue_unichar(valueof(m_device({ PX_DEVICE_NUMBER[PX_DEVICE_NUMBER_POINT] })))}));

          log("The IUT should reject the connection");
          // Should not get here since connection should have been refused
          f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);

        } @catch(err) {
          if (match(err, pattern "*There is no connection alive*")) {
              f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);     
          }     
        }
                

        // Postamble
        f_cf_01_http_down();
    }

    testcase TC_ECRF_TLS_BI_02() runs on HttpSipComponent system TestAdapter {
        // Local Variables
        var CSeq v_cSeq_s := {
          fieldName := CSEQ_E,
          seqNumber := 0,
          method := "SUBSCRIBE"
        };

        var SipUrl v_subscription_target :=  f_initSipUrl(c_serviceProfile_SUBSCRIPTION_SERVICE);

        // Test control        
        f_check_pics({ values := {PICS_LIS_TLS_AUTHENTICATION }, names := {"PICS_LIS_TLS_AUTHENTICATION"}});

        // Preamble
        f_cf_01_up();                          
        f_init_userprofile(c_userProfile_ESINetSubscriber);        
        f_init_interfaceprofile(c_interfaceProfile_SUT_ECRF);
        
        // Preamble         
        LibIms_Steps.f_setHeadersSUBSCRIBE(v_cSeq_s, v_subscription_target, f_initSipUrl(c_serviceProfile_SUBSCRIBER));                                
        
        // Test Body
        template SUBSCRIBE_Request request := m_SUBSCRIBE_ServiceState_Request_Event(
          v_subscription_target, vc_callId ,v_cSeq_s, vc_from, vc_to, vc_via, omit
        );

        @try {
          f_SendSUBSCRIBE(request);

          log("The IUT should reject the connection."); 
          // Should not get here since connection should have been refused
          f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
        
        } @catch(err) {
          if (match(err, pattern "*There is no connection alive*")) {
              f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);     
          }     
        }
            
        // Postamble
        f_cf_01_down();
    }
  }

} // End of module AtsLIS_TestCases