Newer
Older
return ("EutranNeighbourCellMeasInfo:Rsrp of notification not as expected: " + strconv.Itoa(int(notification.EutranNeighbourCellMeasInfo[0].Rsrp)) + " instead of " + strconv.Itoa(int(expectedEutranNeighbourCellMeasInfo.Rsrp)))
}
if notification.EutranNeighbourCellMeasInfo[0].Rsrq != expectedEutranNeighbourCellMeasInfo.Rsrq {
return ("EutranNeighbourCellMeasInfo:Rsrq of notification not as expected: " + strconv.Itoa(int(notification.EutranNeighbourCellMeasInfo[0].Rsrq)) + " instead of " + strconv.Itoa(int(expectedEutranNeighbourCellMeasInfo.Rsrq)))
}
if len(notification.EutranNeighbourCellMeasInfo) > 1 {
return ("EutranNeighbourCellMeasInfo of notification should have only one element")
}
} else {
return ("EutranNeighbourCellMeasInfo of notification is expected")
}
}
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
return ""
}
func validateNrMeasRepUeNotification(notification *rnisClient.NrMeasRepUeNotification, expectedAssocId *rnisClient.AssociateId, expectedServCellMeasInfo *rnisClient.NrMeasRepUeNotificationServCellMeasInfo, expectedNrNeighCellMeasInfo *rnisClient.NrMeasRepUeNotificationNrNeighCellMeasInfo, expectedEutraNeighCellMeasInfo *rnisClient.NrMeasRepUeNotificationEutraNeighCellMeasInfo) string {
if notification.NotificationType != "NrMeasRepUeNotification" {
return ("NotificationType of notification not as expected: " + notification.NotificationType + " instead of " + "NrMeasRepUeNotification")
}
if expectedAssocId != nil {
if notification.AssociateId != nil || len(notification.AssociateId) > 0 {
if notification.AssociateId[0].Type_ != expectedAssocId.Type_ {
return ("AssocId:Type of notification not as expected: " + strconv.Itoa(int(notification.AssociateId[0].Type_)) + " instead of " + strconv.Itoa(int(expectedAssocId.Type_)))
}
if notification.AssociateId[0].Value != expectedAssocId.Value {
return ("AssocId:Value of notification not as expected: " + notification.AssociateId[0].Value + " instead of " + expectedAssocId.Value)
}
if len(notification.AssociateId) > 1 {
return ("AssocId of notification should have only one element")
}
} else {
return ("AssocId of notification is expected")
}
}
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
if expectedServCellMeasInfo != nil {
if notification.ServCellMeasInfo != nil || len(notification.ServCellMeasInfo) > 0 {
if notification.ServCellMeasInfo[0].Nrcgi.NrcellId != expectedServCellMeasInfo.Nrcgi.NrcellId {
return ("ServCellMeasInfo:Nrcgi:NrcellId of notification not as expected: " + notification.ServCellMeasInfo[0].Nrcgi.NrcellId + " instead of " + expectedServCellMeasInfo.Nrcgi.NrcellId)
}
if notification.ServCellMeasInfo[0].Nrcgi.Plmn.Mcc != expectedServCellMeasInfo.Nrcgi.Plmn.Mcc {
return ("ServCellMeasInfo:Nrcgi:Plmn.Mcc of notification not as expected: " + notification.ServCellMeasInfo[0].Nrcgi.Plmn.Mcc + " instead of " + expectedServCellMeasInfo.Nrcgi.Plmn.Mcc)
}
if notification.ServCellMeasInfo[0].Nrcgi.Plmn.Mnc != expectedServCellMeasInfo.Nrcgi.Plmn.Mnc {
return ("ServCellMeasInfo:Nrcgi:Plmn.Mnc of notification not as expected: " + notification.ServCellMeasInfo[0].Nrcgi.Plmn.Mnc + " instead of " + expectedServCellMeasInfo.Nrcgi.Plmn.Mnc)
}
if notification.ServCellMeasInfo[0].SCell.MeasQuantityResultsSsbCell.Rsrp != expectedServCellMeasInfo.SCell.MeasQuantityResultsSsbCell.Rsrp {
return ("ServCellMeasInfo:SCell:MeasQuantityResultsSsbCell.Rsrp of notification not as expected: " + strconv.Itoa(int(notification.ServCellMeasInfo[0].SCell.MeasQuantityResultsSsbCell.Rsrp)) + " instead of " + strconv.Itoa(int(expectedServCellMeasInfo.SCell.MeasQuantityResultsSsbCell.Rsrp)))
}
if notification.ServCellMeasInfo[0].SCell.MeasQuantityResultsSsbCell.Rsrq != expectedServCellMeasInfo.SCell.MeasQuantityResultsSsbCell.Rsrq {
return ("ServCellMeasInfo:SCell:MeasQuantityResultsSsbCell.Rsrq of notification not as expected: " + strconv.Itoa(int(notification.ServCellMeasInfo[0].SCell.MeasQuantityResultsSsbCell.Rsrq)) + " instead of " + strconv.Itoa(int(expectedServCellMeasInfo.SCell.MeasQuantityResultsSsbCell.Rsrq)))
}
if len(notification.ServCellMeasInfo) > 1 {
return ("ServCellMeasInfo of notification should have only one element")
}
} else {
return ("ServCellMeasInfo of notification is expected")
}
}
if expectedNrNeighCellMeasInfo != nil {
if notification.NrNeighCellMeasInfo != nil || len(notification.NrNeighCellMeasInfo) > 0 {

Yann Garcia
committed
if notification.NrNeighCellMeasInfo[0].Nrcgi.NrcellId != expectedNrNeighCellMeasInfo.Nrcgi.NrcellId {
return ("NrNeighCellMeasInfo:Nrcgi of notification not as expected: " + notification.NrNeighCellMeasInfo[0].Nrcgi.NrcellId + " instead of " + expectedNrNeighCellMeasInfo.Nrcgi.NrcellId)
if notification.NrNeighCellMeasInfo[0].MeasQuantityResultsSsbCell.Rsrp != expectedNrNeighCellMeasInfo.MeasQuantityResultsSsbCell.Rsrp {
return ("NrNeighCellMeasInfo:MeasQuantityResultsSsbCell:Rsrp of notification not as expected: " + strconv.Itoa(int(notification.NrNeighCellMeasInfo[0].MeasQuantityResultsSsbCell.Rsrp)) + " instead of " + strconv.Itoa(int(expectedNrNeighCellMeasInfo.MeasQuantityResultsSsbCell.Rsrp)))
}
if notification.NrNeighCellMeasInfo[0].MeasQuantityResultsSsbCell.Rsrq != expectedNrNeighCellMeasInfo.MeasQuantityResultsSsbCell.Rsrq {
return ("NrNeighCellMeasInfo:MeasQuantityResultsSsbCell:Rsrq of notification not as expected: " + strconv.Itoa(int(notification.NrNeighCellMeasInfo[0].MeasQuantityResultsSsbCell.Rsrq)) + " instead of " + strconv.Itoa(int(expectedNrNeighCellMeasInfo.MeasQuantityResultsSsbCell.Rsrq)))
}
if len(notification.NrNeighCellMeasInfo) > 1 {
return ("NrNeighCellMeasInfo of notification should have only one element")
}
} else {
return ("NrNeighCellMeasInfo of notification is expected")
}
}
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
if expectedEutraNeighCellMeasInfo != nil {
if notification.EutraNeighCellMeasInfo != nil || len(notification.EutraNeighCellMeasInfo) > 0 {
if notification.EutraNeighCellMeasInfo[0].Ecgi.CellId != expectedEutraNeighCellMeasInfo.Ecgi.CellId {
return ("EutraNeighCellMeasInfo:Ecgi:CellId of notification not as expected: " + notification.EutraNeighCellMeasInfo[0].Ecgi.CellId + " instead of " + expectedEutraNeighCellMeasInfo.Ecgi.CellId)
}
if notification.EutraNeighCellMeasInfo[0].Ecgi.Plmn.Mcc != expectedEutraNeighCellMeasInfo.Ecgi.Plmn.Mcc {
return ("EutraNeighCellMeasInfo:Ecgi:Plmn:Mcc of notification not as expected: " + notification.EutraNeighCellMeasInfo[0].Ecgi.Plmn.Mcc + " instead of " + expectedEutraNeighCellMeasInfo.Ecgi.Plmn.Mcc)
}
if notification.EutraNeighCellMeasInfo[0].Ecgi.Plmn.Mnc != expectedEutraNeighCellMeasInfo.Ecgi.Plmn.Mnc {
return ("EutraNeighCellMeasInfo:Ecgi:Plmn:Mnc of notification not as expected: " + notification.EutraNeighCellMeasInfo[0].Ecgi.Plmn.Mnc + " instead of " + expectedEutraNeighCellMeasInfo.Ecgi.Plmn.Mnc)
}
if notification.EutraNeighCellMeasInfo[0].Rsrp != expectedEutraNeighCellMeasInfo.Rsrp {
return ("EutraNeighCellMeasInfo:Rsrp of notification not as expected: " + strconv.Itoa(int(notification.EutraNeighCellMeasInfo[0].Rsrp)) + " instead of " + strconv.Itoa(int(expectedEutraNeighCellMeasInfo.Rsrp)))
}
if notification.EutraNeighCellMeasInfo[0].Rsrq != expectedEutraNeighCellMeasInfo.Rsrq {
return ("EutraNeighCellMeasInfo:Rsrq of notification not as expected: " + strconv.Itoa(int(notification.EutraNeighCellMeasInfo[0].Rsrq)) + " instead of " + strconv.Itoa(int(expectedEutraNeighCellMeasInfo.Rsrq)))
}
if len(notification.EutraNeighCellMeasInfo) > 1 {
return ("EutraNeighCellMeasInfo of notification should have only one element")
}
} else {
return ("EutraNeighCellMeasInfo of notification is expected")
}
}