Commit 2a99277f authored by YannGarcia's avatar YannGarcia
Browse files

Add Security tests for AtsPSAP

parent ebcf3756
Loading
Loading
Loading
Loading
+33913 −1912

File changed.

Preview size limit exceeded, changes collapsed.

+1 −0
Original line number Diff line number Diff line
@@ -3,6 +3,7 @@ suite := AtsBCF
sources := \
            AtsBCF_Steps.ttcn \
            AtsBCF_Pics.ttcn \
            AtsBCF_Pixits.ttcn \
            AtsBCF_TestCases.ttcn \
            AtsBCF_TestControl.ttcn

+4 −0
Original line number Diff line number Diff line
module AtsPSAP_Pics {
  
  /**
   * @desc Does IUT configured to use TLS?
   */
  modulepar boolean PICS_PSAP_USE_TLS := true;
  
  /**
   * @desc Does IUT configured for UDP?
+91 −5
Original line number Diff line number Diff line
@@ -122,8 +122,8 @@ module AtsPSAP_TestCases {
        var CSeq v_cSeq_s := p_cSeq_s;
        
        // Test control
        if ((not PICS_PSAP_S_SIP_UDP1) or (not PICS_PSAP_E_SIP_URN3) or not(PICS_PSAP_B_SDP_ULA1) or PICS_PSAP_S_SIP_REGISTRATION) {
          log("*** " & testcasename() & ": PICS_PSAP_S_SIP_UDP1 and PICS_PSAP_E_SIP_URN3 and PICS_PSAP_B_SDP_ULA1 and NOT PICS_PSAP_S_SIP_REGISTRATION required for executing the TC ***");
        if ((not PICS_PSAP_USE_TLS) or (not PICS_PSAP_S_SIP_UDP1) or (not PICS_PSAP_E_SIP_URN3) or not(PICS_PSAP_B_SDP_ULA1) or PICS_PSAP_S_SIP_REGISTRATION) {
          log("*** " & testcasename() & ": PICS_PSAP_USE_TLS and PICS_PSAP_S_SIP_UDP1 and PICS_PSAP_E_SIP_URN3 and PICS_PSAP_B_SDP_ULA1 and NOT PICS_PSAP_S_SIP_REGISTRATION required for executing the TC ***");
          setverdict(inconc);
          stop;
        }
@@ -265,8 +265,8 @@ module AtsPSAP_TestCases {
        var CSeq v_cSeq_s := p_cSeq_s;
        
        // Test control
        if ((not PICS_PSAP_S_SIP_UDP1) or (not PICS_PSAP_E_SIP_URN3) or not(PICS_PSAP_B_SDP_ULA1) or not(PICS_PSAP_S_SIP_REGISTRATION)) {
          log("*** " & testcasename() & ": PICS_PSAP_S_SIP_UDP1 and PICS_PSAP_E_SIP_URN3 and PICS_PSAP_B_SDP_ULA1 and PICS_PSAP_S_SIP_REGISTRATION required for executing the TC ***");
        if ((not PICS_PSAP_USE_TLS) or (not PICS_PSAP_S_SIP_UDP1) or (not PICS_PSAP_E_SIP_URN3) or not(PICS_PSAP_B_SDP_ULA1) or not(PICS_PSAP_S_SIP_REGISTRATION)) {
          log("*** " & testcasename() & ": PICS_PSAP_USE_TLS and PICS_PSAP_S_SIP_UDP1 and PICS_PSAP_E_SIP_URN3 and PICS_PSAP_B_SDP_ULA1 and PICS_PSAP_S_SIP_REGISTRATION required for executing the TC ***");
          setverdict(inconc);
          stop;
        }
@@ -2216,7 +2216,7 @@ module AtsPSAP_TestCases {
    } // End of group f_TC_PSAP_SIP_CANCEL_BV_01
    
    /**
     * @desc "IUT successfully handles an incoming SIP INFO"
     * @desc "IUT rejects requests without a certificate"
     */
    testcase TC_PSAP_SIP_INFO_BV_01(
                                      in CSeq p_cSeq_s
@@ -2373,6 +2373,92 @@ module AtsPSAP_TestCases {
      
    } // End of group f_TC_PSAP_SIP_INFO_BV_01
    
    /**
     * @desc "IUT successfully handles an incoming SIP MESSAGE"
     */
    testcase TC_PSAP_TLS_BI_01(
                                      in CSeq p_cSeq_s
                                      ) runs on HttpImsComponent system TestAdapter {
        // Local variables
        var ImsComponent v_caller;
        var ImsComponent v_call_taker;
        var CSeq v_cSeq_s := p_cSeq_s;
        
        // Test control
        if ((PICS_PSAP_USE_TLS)) {
          log("*** " & testcasename() & ": PICS_PSAP_TLS not required (unsecured connection) for executing the TC ***");
          setverdict(inconc);
          stop;
        }
        
        // Test component configuration
        f_cf_02_up(v_caller, v_call_taker);
        
        // Test adapter configuration
        
        // Preamble
        
        // Test Body
        f_incCSeq(v_cSeq_s); v_caller.start(f_TC_PSAP_TLS_BI_01_caller(v_cSeq_s));
        f_serverSyncNClientsAndStop(1, {c_prDone, c_tbDone, c_poDone});
        
        // Postamble
        f_cf_02_down(v_caller, v_call_taker);
      
    } // End of testcase TC_PSAP_TLS_BI_01
    
    group f_TC_PSAP_TLS_BI_01 {
      
      function f_TC_PSAP_TLS_BI_01_caller(
                                          in CSeq p_cSeq_s
                                          ) runs on ImsComponent {
        // Local variables
        
        // Test control
        
        // Test component configuration
        f_init_userprofile(c_userProfile_UE1atSUThome);
        f_initSipUrl(c_userProfile_UE1atSUThome);
        f_init_interfaceprofile(c_interfaceProfile_IMS_SUT_PCSCF1);
        
        // Test adapter configuration
        
        // Preamble
        f_IMS_preamble_woRegistration(p_cSeq_s);
        LibIms_Steps.f_setHeadersMESSAGE(p_cSeq_s, f_initSipUrl(c_serviceProfile_EMERGENCY), f_initSipUrl(c_userProfile_UE1atSUThome));
        f_init_sdp_userprofile(vc_sdp_local, c_userProfile_UE1atSUThome, c_userProfile_Huawei);

        // Test Body
        f_SendMESSAGE(m_MESSAGE_Request_IMS_Ng112(vc_requestUri,
                                                  vc_callId,
                                                  vc_cSeq,
                                                  vc_from,
                                                  vc_to,
                                                  vc_via,
                                                  m_Require_100rel,
                                                  -,
                                                  m_Supported_100rel,
                                                  m_MBody_SDP(vc_sdp_local),
                                                  m_geolocation({ scheme:= "https", components := {other := "//lis1.gridgears.plugtests.net/locref?ref=660bc838-882e-4683-8241-af26bb5960d8" }, urlParameters := omit, headers := omit }, omit), // TODO Add a LIS component to do a request for location by reference
                                                  m_geolocation_routing,
                                                  { fieldName := USER_AGENT_E, userAgentBody := { "ETSI_Conf_testing" } }
                                                  ));
        tc_resp.start;
        alt {
          [] a_awaitingResponse(p_Response) {
            f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_error);
          }
          [] timeout {
            f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
          }
        }
        
        // Postamble
        f_clientSyncAndVerdictPostamble(c_poDone, e_success);
      } // End of function f_TC_PSAP_TLS_BI_01_caller
      
    } // End of testcase TC_PSAP_TLS_BI_01
    
  } // End of group psap_role 
  
} // End of module AtsPSAP_TestCases 
+1 −0
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@ suite := AtsPSAP

sources := \
            AtsPSAP_Steps.ttcn \
            AtsPSAP_Pics.ttcn \
            AtsPSAP_TestCases.ttcn \
            AtsPSAP_TestControl.ttcn

Loading