mme: Introduce test TC_ue_cell_reselect_geran_to_eutran
This test allows reproducing an idle mobility GERAN->EUTRAN.
Related: OS#6294
Change-Id: I6f8f077b99e83e6467d2b0c05148b81dbcf2ede4
diff --git a/library/NAS_Templates.ttcn b/library/NAS_Templates.ttcn
index 944d857..d45dc7d 100644
--- a/library/NAS_Templates.ttcn
+++ b/library/NAS_Templates.ttcn
@@ -44,6 +44,9 @@
}
const BIT4 c_EPS_SEC_NONE := '0000'B;
+const BIT4 c_EPS_SEC_IP := '0001'B;
+const BIT4 c_EPS_SEC_IP_CIPH := '0010'B;
+
const BIT4 c_EPS_NAS_PD_EMM := '0111'B;
const BIT4 c_EPS_NAS_PD_ESM := '0010'B;
@@ -58,6 +61,16 @@
content := inp
}
+/* 9.9.3.4A - 10.5.1.2/24.008 */
+template (value) CipheringKeySequenceNumberTV
+ts_CipheringKeySequenceNumberTV(template (value) BIT3 key_seq) := {
+ keySequence := {
+ keySequence := key_seq,
+ spare := '0'B
+ },
+ elementIdentifier := '1000'B
+}
+
private template (value) MobileIdentityLV
ts_NAS_MobileIdLV(template (value) MobileIdentityV mid) := {
lengthIndicator := 0,
@@ -178,6 +191,19 @@
ePS_MobileIdentity := ts_NAS_MobileId_GUTI(guti)
}
+/* 9.9.3.25 Nonce */
+template (value) NonceTV
+ts_NonceTV(template (value) OCT4 nonce) := {
+ elementIdentifier := '55'O,
+ noncevalue := nonce
+}
+function f_ts_NonceTV(template (omit) OCT4 nonce) return template (omit) NonceTV {
+ if (istemplatekind(nonce, "omit")) {
+ return omit;
+ }
+ return ts_NonceTV(nonce);
+}
+
/* 9.9.3.26 P-TMSI signature */
template (value) P_TMSISignatureTV
ts_PTMSI_SignatureTV(template (value) OCT3 ptmsi_sig) := {
@@ -408,6 +434,20 @@
}
}
+/* 8.2.27 Tracking Area Update Complete */
+template (value) PDU_NAS_EPS
+ts_PDU_NAS_EPS_TrackingAreaUpdateComplete(template (value) BIT4 securityHeaderType := c_EPS_SEC_NONE) := {
+ protocolDiscriminator := c_EPS_NAS_PD_EMM,
+ ePS_messages := {
+ ePS_MobilityManagement := {
+ pDU_NAS_EPS_TrackingAreaUpdateComplete := {
+ securityHeaderType := securityHeaderType,
+ messageType := '01001010'B
+ }
+ }
+ }
+}
+
/* 8.2.28 Tracking Area Update Reject */
template (present) PDU_NAS_EPS
tr_PDU_NAS_EPS_TrackingAreaUpdateReject(template (present) EMM_CauseV cause := ?) := {
@@ -429,7 +469,9 @@
template (value) PDU_NAS_EPS
ts_PDU_NAS_EPS_TrackingAreaUpdateRequest(template (value) EPS_MobileIdentityLV old_guti,
template (omit) P_TMSISignatureTV old_ptmsi_sig := omit,
- template (omit) GUTI_TypeTV old_guti_type := omit) := {
+ template (omit) GUTI_TypeTV old_guti_type := omit,
+ template (omit) NonceTV nonce_ue := omit,
+ template (omit) CipheringKeySequenceNumberTV gprs_cksn := omit) := {
protocolDiscriminator := c_EPS_NAS_PD_EMM,
ePS_messages := {
ePS_MobilityManagement := {
@@ -440,10 +482,10 @@
nasKeySetId := ts_NAS_KeySetIdentifierV,
oldGUTI := old_guti,
nonCurrentNative_nasKeySetId := omit,
- gprsCipheringKeySequenceNumber := omit,
+ gprsCipheringKeySequenceNumber := gprs_cksn,
old_P_TMSISignature := old_ptmsi_sig,
additionalGUTI := omit,
- nonce := omit,
+ nonce := nonce_ue,
uENetworkCapability := omit,
lastVisitedRegisteredTAI := omit,
dRXParameter := omit,
diff --git a/library/S1AP_Emulation.ttcn b/library/S1AP_Emulation.ttcn
index e3e3216..955c690 100644
--- a/library/S1AP_Emulation.ttcn
+++ b/library/S1AP_Emulation.ttcn
@@ -72,7 +72,8 @@
};
type union S1APEM_Config {
NAS_Keys set_nas_keys,
- ResetNAScounts reset_nas_counts
+ ResetNAScounts reset_nas_counts,
+ NAS_ALG_INT set_nas_alg_int
};
type enumerated S1APEM_EventUpDown {
@@ -453,6 +454,11 @@
S1apAssociationTable[assoc_id].nus.rx_count := 0;
S1apAssociationTable[assoc_id].nus.tx_count := 0;
}
+ /* Configuration primitive from client */
+ [] S1AP_CLIENT.receive(S1APEM_Config:{set_nas_alg_int:=?}) -> value s1cfg sender vc_conn {
+ var integer assoc_id := f_assoc_id_by_comp(vc_conn);
+ S1apAssociationTable[assoc_id].nus.alg_int := s1cfg.set_nas_alg_int;
+ }
/* S1AP from client: InitialUE */
[] S1AP_CLIENT.receive(tr_S1AP_InitialUE) -> value msg sender vc_conn {
/* create a table entry about this connection */