From 470b8bff3ff2cd4e485bf54cb4c6bfe7e285793e Mon Sep 17 00:00:00 2001 From: tim-ywliu <68043973+tim-ywliu@users.noreply.github.com> Date: Thu, 8 Jun 2023 12:23:53 +0800 Subject: [PATCH] Logger refactor (#451) * update NFs' hash and config * update test case in test/ (#449) * update webconsole's hash, fix testNon3GPP panic (#450) * update webconsole's hash * fix testNon3GPP panic * update n3iwf module hash * update upf's commit hash --------- Co-authored-by: brianchennn <46628572+brianchennn@users.noreply.github.com> Co-authored-by: Ian Chen --- NFs/amf | 2 +- NFs/ausf | 2 +- NFs/n3iwf | 2 +- NFs/nrf | 2 +- NFs/nssf | 2 +- NFs/pcf | 2 +- NFs/smf | 2 +- NFs/udm | 2 +- NFs/udr | 2 +- NFs/upf | 2 +- {config/TLS => cert}/amf.key | 0 {config/TLS => cert}/amf.pem | 0 {config/TLS => cert}/ausf.key | 0 {config/TLS => cert}/ausf.pem | 0 {config/TLS => cert}/n3iwf.key | 0 {config/TLS => cert}/n3iwf.pem | 0 {config/TLS => cert}/nrf.key | 0 {config/TLS => cert}/nrf.pem | 0 {config/TLS => cert}/nssf.key | 0 {config/TLS => cert}/nssf.pem | 0 {config/TLS => cert}/pcf.key | 0 {config/TLS => cert}/pcf.pem | 0 {config/TLS => cert}/smf.key | 0 {config/TLS => cert}/smf.pem | 0 {config/TLS => cert}/udm.key | 0 {config/TLS => cert}/udm.pem | 0 {config/TLS => cert}/udr.key | 0 {config/TLS => cert}/udr.pem | 0 config/amfcfg.yaml | 70 +-- config/ausfcfg.yaml | 17 +- config/n3iwfcfg.test.yaml | 28 +- config/n3iwfcfg.yaml | 27 +- config/nrfcfg.yaml | 17 +- config/nssfcfg.yaml | 17 +- config/pcfcfg.yaml | 17 +- config/smfcfg.yaml | 70 +-- config/udmcfg.yaml | 17 +- config/udrcfg.yaml | 17 +- config/uerouting.yaml | 16 +- config/upfcfg.yaml | 1 + config/webuicfg.yaml | 13 +- force_kill.sh | 7 +- run.sh | 7 +- test.sh | 2 +- test/app/app.go | 15 +- .../AMF/TestAmf/smfProfile.go | 9 +- test/go.mod | 86 ++- test/go.sum | 144 +++-- test/nasTestpacket/NasPdu.go | 57 +- test/ngapTestpacket/build.go | 34 +- test/ngsetup_test.go | 378 +++++++------ test/non3gpp_test.go | 13 +- test/ranUe.go | 4 +- test/registration_test.go | 507 +++++++++++++++++- test/ueRanEmulator/main.go | 5 +- test/ulclsession_test.go | 9 +- webconsole | 2 +- 57 files changed, 1069 insertions(+), 557 deletions(-) rename {config/TLS => cert}/amf.key (100%) rename {config/TLS => cert}/amf.pem (100%) rename {config/TLS => cert}/ausf.key (100%) rename {config/TLS => cert}/ausf.pem (100%) rename {config/TLS => cert}/n3iwf.key (100%) rename {config/TLS => cert}/n3iwf.pem (100%) rename {config/TLS => cert}/nrf.key (100%) rename {config/TLS => cert}/nrf.pem (100%) rename {config/TLS => cert}/nssf.key (100%) rename {config/TLS => cert}/nssf.pem (100%) rename {config/TLS => cert}/pcf.key (100%) rename {config/TLS => cert}/pcf.pem (100%) rename {config/TLS => cert}/smf.key (100%) rename {config/TLS => cert}/smf.pem (100%) rename {config/TLS => cert}/udm.key (100%) rename {config/TLS => cert}/udm.pem (100%) rename {config/TLS => cert}/udr.key (100%) rename {config/TLS => cert}/udr.pem (100%) diff --git a/NFs/amf b/NFs/amf index e839de03..7907d3c0 160000 --- a/NFs/amf +++ b/NFs/amf @@ -1 +1 @@ -Subproject commit e839de03774f7c5b06dbaaa368ea6f0813a4d0d9 +Subproject commit 7907d3c02971963713128ce4fb47a5341bb01a7a diff --git a/NFs/ausf b/NFs/ausf index 536ba3cb..64f47ebe 160000 --- a/NFs/ausf +++ b/NFs/ausf @@ -1 +1 @@ -Subproject commit 536ba3cba22a4205c55e167fa8226a005c7ada6b +Subproject commit 64f47ebe5444e6c9c41e1b596ea1c535f13434e4 diff --git a/NFs/n3iwf b/NFs/n3iwf index f56277d6..22988ee2 160000 --- a/NFs/n3iwf +++ b/NFs/n3iwf @@ -1 +1 @@ -Subproject commit f56277d6db75e37d75743ea0cac8158a5acf7d39 +Subproject commit 22988ee2772890f19a6d7888431fa885fa35cddc diff --git a/NFs/nrf b/NFs/nrf index 059f35e5..db4c0f90 160000 --- a/NFs/nrf +++ b/NFs/nrf @@ -1 +1 @@ -Subproject commit 059f35e51383b8a419b3ebc6503ab1bbdcb2c77d +Subproject commit db4c0f9040966febbd64222085314b813aeb8e76 diff --git a/NFs/nssf b/NFs/nssf index 04037a7a..28cd7936 160000 --- a/NFs/nssf +++ b/NFs/nssf @@ -1 +1 @@ -Subproject commit 04037a7a806515c0527a74c55ed1f35e076ec527 +Subproject commit 28cd7936472b44db5e717662434e5a56972061aa diff --git a/NFs/pcf b/NFs/pcf index 97ddbbd6..17f2a8fc 160000 --- a/NFs/pcf +++ b/NFs/pcf @@ -1 +1 @@ -Subproject commit 97ddbbd6d9264ee2aea678bc5c1170b8a7f919c6 +Subproject commit 17f2a8fcc3380512f87a5c1214a0693a6af9650a diff --git a/NFs/smf b/NFs/smf index 5d5daa88..8eb6843b 160000 --- a/NFs/smf +++ b/NFs/smf @@ -1 +1 @@ -Subproject commit 5d5daa889b575a892e7c6f60fc4991b098099972 +Subproject commit 8eb6843b404dfb3935b3cf09c564c6db8d494480 diff --git a/NFs/udm b/NFs/udm index 68f208f8..f9aad0ef 160000 --- a/NFs/udm +++ b/NFs/udm @@ -1 +1 @@ -Subproject commit 68f208f8544112ab891bede8fe1c195183e24059 +Subproject commit f9aad0efdd62e0599c9451620263954c11d4e6ef diff --git a/NFs/udr b/NFs/udr index ea22acef..a8ef9d9f 160000 --- a/NFs/udr +++ b/NFs/udr @@ -1 +1 @@ -Subproject commit ea22acef0b3c35f82895ebc7f3f6ca8371497aee +Subproject commit a8ef9d9f223ead58dfb227732161c23b7acf15e9 diff --git a/NFs/upf b/NFs/upf index e05c3433..4474dc86 160000 --- a/NFs/upf +++ b/NFs/upf @@ -1 +1 @@ -Subproject commit e05c343369b13e4798d4002abdb9fbefd6d0eeab +Subproject commit 4474dc86cf7f9851283d4c1895f0b61356b7711e diff --git a/config/TLS/amf.key b/cert/amf.key similarity index 100% rename from config/TLS/amf.key rename to cert/amf.key diff --git a/config/TLS/amf.pem b/cert/amf.pem similarity index 100% rename from config/TLS/amf.pem rename to cert/amf.pem diff --git a/config/TLS/ausf.key b/cert/ausf.key similarity index 100% rename from config/TLS/ausf.key rename to cert/ausf.key diff --git a/config/TLS/ausf.pem b/cert/ausf.pem similarity index 100% rename from config/TLS/ausf.pem rename to cert/ausf.pem diff --git a/config/TLS/n3iwf.key b/cert/n3iwf.key similarity index 100% rename from config/TLS/n3iwf.key rename to cert/n3iwf.key diff --git a/config/TLS/n3iwf.pem b/cert/n3iwf.pem similarity index 100% rename from config/TLS/n3iwf.pem rename to cert/n3iwf.pem diff --git a/config/TLS/nrf.key b/cert/nrf.key similarity index 100% rename from config/TLS/nrf.key rename to cert/nrf.key diff --git a/config/TLS/nrf.pem b/cert/nrf.pem similarity index 100% rename from config/TLS/nrf.pem rename to cert/nrf.pem diff --git a/config/TLS/nssf.key b/cert/nssf.key similarity index 100% rename from config/TLS/nssf.key rename to cert/nssf.key diff --git a/config/TLS/nssf.pem b/cert/nssf.pem similarity index 100% rename from config/TLS/nssf.pem rename to cert/nssf.pem diff --git a/config/TLS/pcf.key b/cert/pcf.key similarity index 100% rename from config/TLS/pcf.key rename to cert/pcf.key diff --git a/config/TLS/pcf.pem b/cert/pcf.pem similarity index 100% rename from config/TLS/pcf.pem rename to cert/pcf.pem diff --git a/config/TLS/smf.key b/cert/smf.key similarity index 100% rename from config/TLS/smf.key rename to cert/smf.key diff --git a/config/TLS/smf.pem b/cert/smf.pem similarity index 100% rename from config/TLS/smf.pem rename to cert/smf.pem diff --git a/config/TLS/udm.key b/cert/udm.key similarity index 100% rename from config/TLS/udm.key rename to cert/udm.key diff --git a/config/TLS/udm.pem b/cert/udm.pem similarity index 100% rename from config/TLS/udm.pem rename to cert/udm.pem diff --git a/config/TLS/udr.key b/cert/udr.key similarity index 100% rename from config/TLS/udr.key rename to cert/udr.key diff --git a/config/TLS/udr.pem b/cert/udr.pem similarity index 100% rename from config/TLS/udr.pem rename to cert/udr.pem diff --git a/config/amfcfg.yaml b/config/amfcfg.yaml index cf64598e..37dbeb0e 100644 --- a/config/amfcfg.yaml +++ b/config/amfcfg.yaml @@ -1,19 +1,20 @@ info: - version: 1.0.3 + version: 1.0.9 description: AMF initial local configuration configuration: amfName: AMF # the name of this AMF ngapIpList: # the IP list of N2 interfaces on this AMF - 127.0.0.18 + ngapPort: 38412 # the SCTP port listened by NGAP sbi: # Service-based interface information scheme: http # the protocol for sbi (http or https) registerIPv4: 127.0.0.18 # IP used to register to NRF bindingIPv4: 127.0.0.18 # IP used to bind the service port: 8000 # port used to bind the service tls: # the local path of TLS key - pem: config/TLS/amf.pem # AMF TLS Certificate - key: config/TLS/amf.key # AMF TLS Private key + pem: cert/amf.pem # AMF TLS Certificate + key: cert/amf.key # AMF TLS Private key serviceNameList: # the SBI services provided by this AMF, refer to TS 29.518 - namf-comm # Namf_Communication service - namf-evts # Namf_EventExposure service @@ -30,7 +31,7 @@ configuration: - plmnId: # Public Land Mobile Network ID, = mcc: 208 # Mobile Country Code (3 digits string, digit: 0~9) mnc: 93 # Mobile Network Code (2 or 3 digits string, digit: 0~9) - tac: 1 # Tracking Area Code (uinteger, range: 0~16777215) + tac: 000001 # Tracking Area Code (3 bytes hex string, range: 000000~FFFFFF) plmnSupportList: # the PLMNs (Public land mobile network) list supported by this AMF - plmnId: # Public Land Mobile Network ID, = mcc: 208 # Mobile Country Code (3 digits string, digit: 0~9) @@ -53,20 +54,27 @@ configuration: networkName: # the name of this core network full: free5GC short: free - locality: area1 # Name of the location where a set of AMF, SMF and UPFs are located - networkFeatureSupport5GS: # 5gs Network Feature Support IE, refer to TS 24.501 - enable: true # append this IE in Registration accept or not - length: 1 # IE content length (uinteger, range: 1~3) - imsVoPS: 0 # IMS voice over PS session indicator (uinteger, range: 0~1) - emc: 0 # Emergency service support indicator for 3GPP access (uinteger, range: 0~3) - emf: 0 # Emergency service fallback indicator for 3GPP access (uinteger, range: 0~3) - iwkN26: 0 # Interworking without N26 interface indicator (uinteger, range: 0~1) - mpsi: 0 # MPS indicator (uinteger, range: 0~1) - emcN3: 0 # Emergency service support indicator for Non-3GPP access (uinteger, range: 0~1) - mcsi: 0 # MCS indicator (uinteger, range: 0~1) + ngapIE: # Optional NGAP IEs + mobilityRestrictionList: # Mobility Restriction List IE, refer to TS 38.413 + enable: true # append this IE in related message or not + maskedIMEISV: # Masked IMEISV IE, refer to TS 38.413 + enable: true # append this IE in related message or not + redirectionVoiceFallback: # Redirection Voice Fallback IE, refer to TS 38.413 + enable: false # append this IE in related message or not + nasIE: # Optional NAS IEs + networkFeatureSupport5GS: # 5gs Network Feature Support IE, refer to TS 24.501 + enable: true # append this IE in Registration accept or not + length: 1 # IE content length (uinteger, range: 1~3) + imsVoPS: 0 # IMS voice over PS session indicator (uinteger, range: 0~1) + emc: 0 # Emergency service support indicator for 3GPP access (uinteger, range: 0~3) + emf: 0 # Emergency service fallback indicator for 3GPP access (uinteger, range: 0~3) + iwkN26: 0 # Interworking without N26 interface indicator (uinteger, range: 0~1) + mpsi: 0 # MPS indicator (uinteger, range: 0~1) + emcN3: 0 # Emergency service support indicator for Non-3GPP access (uinteger, range: 0~1) + mcsi: 0 # MCS indicator (uinteger, range: 0~1) t3502Value: 720 # timer value (seconds) at UE side t3512Value: 3600 # timer value (seconds) at UE side - non3gppDeregistrationTimerValue: 3240 # timer value (seconds) at UE side + non3gppDeregTimerValue: 3240 # timer value (seconds) at UE side # retransmission timer for paging message t3513: enable: true # true or false @@ -97,23 +105,15 @@ configuration: enable: true # true or false expireTime: 6s # default is 6 seconds maxRetryTimes: 4 # the max number of retransmission + locality: area1 # Name of the location where a set of AMF, SMF, PCF and UPFs are located + sctp: # set the sctp server setting , once this field is set, please also add maxInputStream, maxOsStream, maxAttempts, maxInitTimeOut + numOstreams: 3 # the maximum out streams of each sctp connection + maxInstreams: 5 # the maximum in streams of each sctp connection + maxAttempts: 2 # the maximum attempts of each sctp connection + maxInitTimeout: 2 # the maximum init timeout of each sctp connection + defaultUECtxReq: false # the default value of UE Context Request to decide when triggering Initial Context Setup procedure -# the kind of log output -# debugLevel: how detailed to output, value: trace, debug, info, warn, error, fatal, panic -# ReportCaller: enable the caller report or not, value: true or false -logger: - AMF: - debugLevel: info - ReportCaller: false - NAS: - debugLevel: info - ReportCaller: false - FSM: - debugLevel: info - ReportCaller: false - NGAP: - debugLevel: info - ReportCaller: false - Aper: - debugLevel: info - ReportCaller: false +logger: # log output setting + enable: true # true or false + level: info # how detailed to output, value: trace, debug, info, warn, error, fatal, panic + reportCaller: false # enable the caller report or not, value: true or false diff --git a/config/ausfcfg.yaml b/config/ausfcfg.yaml index ae3a77db..5145ffea 100644 --- a/config/ausfcfg.yaml +++ b/config/ausfcfg.yaml @@ -1,5 +1,5 @@ info: - version: 1.0.2 + version: 1.0.3 description: AUSF initial local configuration configuration: @@ -9,8 +9,8 @@ configuration: bindingIPv4: 127.0.0.9 # IP used to bind the service port: 8000 # Port used to bind the service tls: # the local path of TLS key - pem: config/TLS/ausf.pem # AUSF TLS Certificate - key: config/TLS/ausf.key # AUSF TLS Private key + pem: cert/ausf.pem # AUSF TLS Certificate + key: cert/ausf.key # AUSF TLS Private key serviceNameList: # the SBI services provided by this AUSF, refer to TS 29.509 - nausf-auth # Nausf_UEAuthentication service nrfUri: http://127.0.0.10:8000 # a valid URI of NRF @@ -22,10 +22,7 @@ configuration: groupId: ausfGroup001 # ID for the group of the AUSF eapAkaSupiImsiPrefix: false # including "imsi-" prefix or not when using the SUPI to do EAP-AKA' authentication -# the kind of log output -# debugLevel: how detailed to output, value: trace, debug, info, warn, error, fatal, panic -# ReportCaller: enable the caller report or not, value: true or false -logger: - AUSF: - debugLevel: info - ReportCaller: false +logger: # log output setting + enable: true # true or false + level: info # how detailed to output, value: trace, debug, info, warn, error, fatal, panic + reportCaller: false # enable the caller report or not, value: true or false diff --git a/config/n3iwfcfg.test.yaml b/config/n3iwfcfg.test.yaml index e2b52ee7..df5cfbcc 100644 --- a/config/n3iwfcfg.test.yaml +++ b/config/n3iwfcfg.test.yaml @@ -1,5 +1,5 @@ info: - version: 1.0.4 + version: 1.0.5 description: N3IWF initial local configuration configuration: @@ -27,9 +27,8 @@ configuration: # --- N2 Interfaces --- AMFSCTPAddresses: # the IP list of N2 interfaces (SCTP) on AMF when using NGAP - IP: - - 10.200.200.1 + - 10.200.200.1 Port: 38412 - NASTCPPort: 20000 # TCP port which the NAS listens on # --- Nwu Interfaces --- @@ -45,9 +44,9 @@ configuration: FQDN: n3iwf.free5gc.org # FQDN of this N3IWF # --- Security --- - PrivateKey: config/TLS/n3iwf.key # Private key file path - CertificateAuthority: config/TLS/n3iwf.pem # Certificate Authority (CA) file path - Certificate: config/TLS/n3iwf.pem # Certificate file path + PrivateKey: cert/n3iwf.key # Private key file path + CertificateAuthority: cert/n3iwf.pem # Certificate Authority (CA) file path + Certificate: cert/n3iwf.pem # Certificate file path # sending dead peer detection message LivenessCheck: @@ -55,16 +54,7 @@ configuration: transFreq: 60s # frequency of transmission maxRetryTimes: 4 # the max number of DPD response of UE -# the kind of log output -# debugLevel: how detailed to output, value: trace, debug, info, warn, error, fatal, panic -# ReportCaller: enable the caller report or not, value: true or false -logger: - N3IWF: # The default log level is DEBUG to print SA keys. Please change it to INFO when deployed. - debugLevel: debug - ReportCaller: false - NGAP: - debugLevel: info - ReportCaller: false - Aper: - debugLevel: info - ReportCaller: false +logger: # log output setting + enable: true # true or false + level: info # how detailed to output, value: trace, debug, info, warn, error, fatal, panic + reportCaller: false # enable the caller report or not, value: true or false diff --git a/config/n3iwfcfg.yaml b/config/n3iwfcfg.yaml index eab056ca..9ba83dc0 100644 --- a/config/n3iwfcfg.yaml +++ b/config/n3iwfcfg.yaml @@ -1,5 +1,5 @@ info: - version: 1.0.4 + version: 1.0.5 description: N3IWF initial local configuration configuration: @@ -27,7 +27,7 @@ configuration: # --- N2 Interfaces --- AMFSCTPAddresses: # the IP list of N2 interfaces (SCTP) on AMF when using NGAP - IP: - - 127.0.0.18 + - 127.0.0.18 Port: 38412 NASTCPPort: 20000 # TCP port which the NAS listens on @@ -44,9 +44,9 @@ configuration: FQDN: n3iwf.free5gc.org # FQDN of this N3IWF # --- Security --- - PrivateKey: config/TLS/n3iwf.key # Private key file path - CertificateAuthority: config/TLS/n3iwf.pem # Certificate Authority (CA) file path - Certificate: config/TLS/n3iwf.pem # Certificate file path + PrivateKey: cert/n3iwf.key # Private key file path + CertificateAuthority: cert/n3iwf.pem # Certificate Authority (CA) file path + Certificate: cert/n3iwf.pem # Certificate file path # sending dead peer detection message LivenessCheck: @@ -54,16 +54,7 @@ configuration: transFreq: 60s # frequency of transmission maxRetryTimes: 4 # the max number of DPD response of UE -# the kind of log output -# debugLevel: how detailed to output, value: trace, debug, info, warn, error, fatal, panic -# ReportCaller: enable the caller report or not, value: true or false -logger: - N3IWF: # The default log level is DEBUG to print SA keys. Please change it to INFO when deployed. - debugLevel: debug - ReportCaller: false - NGAP: - debugLevel: info - ReportCaller: false - Aper: - debugLevel: info - ReportCaller: false +logger: # log output setting + enable: true # true or false + level: info # how detailed to output, value: trace, debug, info, warn, error, fatal, panic + reportCaller: false # enable the caller report or not, value: true or false diff --git a/config/nrfcfg.yaml b/config/nrfcfg.yaml index ba8de3c7..8f96b6d0 100644 --- a/config/nrfcfg.yaml +++ b/config/nrfcfg.yaml @@ -10,9 +10,9 @@ configuration: registerIPv4: 127.0.0.10 # IP used to serve NFs or register to another NRF bindingIPv4: 127.0.0.10 # IP used to bind the service port: 8000 # port used to bind the service - # cert: config/cert/nrf.pem # NRF Certificate - # rootcert: config/cert/root.pem # Root Certificate - # oauth: false # OAuth2 + tls: # the local path of TLS key + pem: cert/nrf.pem # NRF TLS Certificate + key: cert/nrf.key # NRF TLS Private key DefaultPlmnId: mcc: 208 # Mobile Country Code (3 digits string, digit: 0~9) mnc: 93 # Mobile Network Code (2 or 3 digits string, digit: 0~9) @@ -20,10 +20,7 @@ configuration: - nnrf-nfm # Nnrf_NFManagement service - nnrf-disc # Nnrf_NFDiscovery service -# the kind of log output -# debugLevel: how detailed to output, value: trace, debug, info, warn, error, fatal, panic -# ReportCaller: enable the caller report or not, value: true or false -logger: - NRF: - debugLevel: info - ReportCaller: false +logger: # log output setting + enable: true # true or false + level: info # how detailed to output, value: trace, debug, info, warn, error, fatal, panic + reportCaller: false # enable the caller report or not, value: true or false diff --git a/config/nssfcfg.yaml b/config/nssfcfg.yaml index a04d84e0..692654a7 100644 --- a/config/nssfcfg.yaml +++ b/config/nssfcfg.yaml @@ -1,5 +1,5 @@ info: - version: 1.0.1 + version: 1.0.2 description: NSSF initial local configuration configuration: @@ -10,8 +10,8 @@ configuration: bindingIPv4: 127.0.0.31 # IP used to bind the service port: 8000 # Port used to bind the service tls: # the local path of TLS key - pem: config/TLS/nssf.pem # NSSF TLS Certificate - key: config/TLS/nssf.key # NSSF TLS Private key + pem: cert/nssf.pem # NSSF TLS Certificate + key: cert/nssf.key # NSSF TLS Private key serviceNameList: # the SBI services provided by this SMF, refer to TS 29.531 - nnssf-nsselection # Nnssf_NSSelection service - nnssf-nssaiavailability # Nnssf_NSSAIAvailability service @@ -346,10 +346,7 @@ configuration: sst: 1 # Slice/Service Type (uinteger, range: 0~255) sd: 000003 # Slice Differentiator (3 bytes hex string, range: 000000~FFFFFF) -# the kind of log output -# debugLevel: how detailed to output, value: trace, debug, info, warn, error, fatal, panic -# ReportCaller: enable the caller report or not, value: true or false -logger: - NSSF: - debugLevel: info - ReportCaller: false +logger: # log output setting + enable: true # true or false + level: info # how detailed to output, value: trace, debug, info, warn, error, fatal, panic + reportCaller: false # enable the caller report or not, value: true or false diff --git a/config/pcfcfg.yaml b/config/pcfcfg.yaml index 4cdb63bb..01d76d91 100644 --- a/config/pcfcfg.yaml +++ b/config/pcfcfg.yaml @@ -1,5 +1,5 @@ info: - version: 1.0.1 + version: 1.0.2 description: PCF initial local configuration configuration: @@ -10,8 +10,8 @@ configuration: bindingIPv4: 127.0.0.7 # IP used to bind the service port: 8000 # port used to bind the service tls: # the local path of TLS key - pem: config/TLS/pcf.pem # PCF TLS Certificate - key: config/TLS/pcf.key # PCF TLS Private key + pem: cert/pcf.pem # PCF TLS Certificate + key: cert/pcf.key # PCF TLS Private key timeFormat: 2019-01-02 15:04:05 # time format of this PCF defaultBdtRefId: BdtPolicyId- # BDT Reference ID, indicating transfer policies of background data transfer. nrfUri: http://127.0.0.10:8000 # a valid URI of NRF @@ -29,10 +29,7 @@ configuration: url: mongodb://localhost:27017 # a valid URL of the mongodb locality: area1 # Name of the location where a set of AMF, SMF, PCF and UPFs are located -# the kind of log output -# debugLevel: how detailed to output, value: trace, debug, info, warn, error, fatal, panic -# ReportCaller: enable the caller report or not, value: true or false -logger: - PCF: - debugLevel: info - ReportCaller: false +logger: # log output setting + enable: true # true or false + level: info # how detailed to output, value: trace, debug, info, warn, error, fatal, panic + reportCaller: false # enable the caller report or not, value: true or false diff --git a/config/smfcfg.yaml b/config/smfcfg.yaml index 7b2392f2..e6bb65a2 100644 --- a/config/smfcfg.yaml +++ b/config/smfcfg.yaml @@ -1,5 +1,5 @@ info: - version: 1.0.2 + version: 1.0.7 description: SMF initial local configuration configuration: @@ -7,16 +7,16 @@ configuration: sbi: # Service-based interface information scheme: http # the protocol for sbi (http or https) registerIPv4: 127.0.0.2 # IP used to register to NRF - bindingIPv4: 127.0.0.2 # IP used to bind the service + bindingIPv4: 127.0.0.2 # IP used to bind the service port: 8000 # Port used to bind the service tls: # the local path of TLS key - key: config/TLS/smf.key # SMF TLS Certificate - pem: config/TLS/smf.pem # SMF TLS Private key + key: cert/smf.key # SMF TLS Certificate + pem: cert/smf.pem # SMF TLS Private key serviceNameList: # the SBI services provided by this SMF, refer to TS 29.502 - nsmf-pdusession # Nsmf_PDUSession service - nsmf-event-exposure # Nsmf_EventExposure service - nsmf-oam # OAM service - snssaiInfos: # the S-NSSAI (Single Network Slice Selection Assistance Information) list supported by this SMF + snssaiInfos: # the S-NSSAI (Single Network Slice Selection Assistance Information) list supported by this AMF - sNssai: # S-NSSAI (Single Network Slice Selection Assistance Information) sst: 1 # Slice/Service Type (uinteger, range: 0~255) sd: 010203 # Slice Differentiator (3 bytes hex string, range: 000000~FFFFFF) @@ -24,6 +24,7 @@ configuration: - dnn: internet # Data Network Name dns: # the IP address of DNS ipv4: 8.8.8.8 + ipv6: 2001:4860:4860::8888 - sNssai: # S-NSSAI (Single Network Slice Selection Assistance Information) sst: 1 # Slice/Service Type (uinteger, range: 0~255) sd: 112233 # Slice Differentiator (3 bytes hex string, range: 000000~FFFFFF) @@ -31,19 +32,24 @@ configuration: - dnn: internet # Data Network Name dns: # the IP address of DNS ipv4: 8.8.8.8 + ipv6: 2001:4860:4860::8888 plmnList: # the list of PLMN IDs that this SMF belongs to (optional, remove this key when unnecessary) - - mcc: "208" # Mobile Country Code (3 digits string, digit: 0~9) - mnc: "93" # Mobile Network Code (2 or 3 digits string, digit: 0~9) - locality: area1 # Name of the location where a set of AMF, SMF and UPFs are located + - mcc: 208 # Mobile Country Code (3 digits string, digit: 0~9) + mnc: 93 # Mobile Network Code (2 or 3 digits string, digit: 0~9) + locality: area1 # Name of the location where a set of AMF, SMF, PCF and UPFs are located pfcp: # the IP address of N4 interface on this SMF (PFCP) - addr: 127.0.0.1 + # addr config is deprecated in smf config v1.0.3, please use the following config + nodeID: 127.0.0.1 # the Node ID of this SMF + listenAddr: 127.0.0.1 # the IP/FQDN of N4 interface on this SMF (PFCP) + externalAddr: 127.0.0.1 # the IP/FQDN of N4 interface on this SMF (PFCP) userplaneInformation: # list of userplane information upNodes: # information of userplane node (AN or UPF) gNB1: # the name of the node type: AN # the type of the node (AN or UPF) - UPF: # the name of the node + UPF: # the name of the node type: UPF # the type of the node (AN or UPF) - nodeID: 127.0.0.8 # the IP/FQDN of N4 interface on this UPF (PFCP) + nodeID: 127.0.0.8 # the Node ID of this UPF + addr: 127.0.0.8 # the IP/FQDN of N4 interface on this UPF (PFCP) sNssaiUpfInfos: # S-NSSAI information list for this UPF - sNssai: # S-NSSAI (Single Network Slice Selection Assistance Information) sst: 1 # Slice/Service Type (uinteger, range: 0~255) @@ -52,6 +58,8 @@ configuration: - dnn: internet pools: - cidr: 10.60.0.0/16 + staticPools: + - cidr: 10.60.100.0/24 - sNssai: # S-NSSAI (Single Network Slice Selection Assistance Information) sst: 1 # Slice/Service Type (uinteger, range: 0~255) sd: 112233 # Slice Differentiator (3 bytes hex string, range: 000000~FFFFFF) @@ -59,32 +67,32 @@ configuration: - dnn: internet pools: - cidr: 10.61.0.0/16 + staticPools: + - cidr: 10.61.100.0/24 interfaces: # Interface list for this UPF - interfaceType: N3 # the type of the interface (N3 or N9) endpoints: # the IP address of this N3/N9 interface on this UPF - 127.0.0.8 - networkInstance: internet # Data Network Name (DNN) + networkInstances: # Data Network Name (DNN) + - internet links: # the topology graph of userplane, A and B represent the two nodes of each link - A: gNB1 B: UPF + # retransmission timer for pdu session modification command + t3591: + enable: true # true or false + expireTime: 16s # default is 6 seconds + maxRetryTimes: 3 # the max number of retransmission + # retransmission timer for pdu session release command + t3592: + enable: true # true or false + expireTime: 16s # default is 6 seconds + maxRetryTimes: 3 # the max number of retransmission nrfUri: http://127.0.0.10:8000 # a valid URI of NRF + #urrPeriod: 10 # default usage report period in seconds + #urrThreshold: 1000 # default usage report threshold in bytes -# the kind of log output -# debugLevel: how detailed to output, value: trace, debug, info, warn, error, fatal, panic -# ReportCaller: enable the caller report or not, value: true or false -logger: - SMF: - debugLevel: info - ReportCaller: false - NAS: - debugLevel: info - ReportCaller: false - NGAP: - debugLevel: info - ReportCaller: false - Aper: - debugLevel: info - ReportCaller: false - PFCP: - debugLevel: info - ReportCaller: false +logger: # log output setting + enable: true # true or false + level: info # how detailed to output, value: trace, debug, info, warn, error, fatal, panic + reportCaller: false # enable the caller report or not, value: true or false diff --git a/config/udmcfg.yaml b/config/udmcfg.yaml index d774b26a..28acd22b 100644 --- a/config/udmcfg.yaml +++ b/config/udmcfg.yaml @@ -1,5 +1,5 @@ info: - version: 1.0.2 + version: 1.0.3 description: UDM initial local configuration configuration: @@ -15,8 +15,8 @@ configuration: bindingIPv4: 127.0.0.3 # IP used to bind the service port: 8000 # Port used to bind the service tls: # the local path of TLS key - pem: config/TLS/udm.pem # UDM TLS Certificate - key: config/TLS/udm.key # UDM TLS Private key + pem: cert/udm.pem # UDM TLS Certificate + key: cert/udm.key # UDM TLS Private key nrfUri: http://127.0.0.10:8000 # a valid URI of NRF # test data set from TS33501-f60 Annex C.4 @@ -28,10 +28,7 @@ configuration: PrivateKey: F1AB1074477EBCC7F554EA1C5FC368B1616730155E0041AC447D6301975FECDA PublicKey: 0472DA71976234CE833A6907425867B82E074D44EF907DFB4B3E21C1C2256EBCD15A7DED52FCBB097A4ED250E036C7B9C8C7004C4EEDC4F068CD7BF8D3F900E3B4 -# the kind of log output -# debugLevel: how detailed to output, value: trace, debug, info, warn, error, fatal, panic -# ReportCaller: enable the caller report or not, value: true or false -logger: - UDM: - debugLevel: info - ReportCaller: false +logger: # log output setting + enable: true # true or false + level: info # how detailed to output, value: trace, debug, info, warn, error, fatal, panic + reportCaller: false # enable the caller report or not, value: true or false diff --git a/config/udrcfg.yaml b/config/udrcfg.yaml index 34d8534e..64d95dfd 100644 --- a/config/udrcfg.yaml +++ b/config/udrcfg.yaml @@ -1,5 +1,5 @@ info: - version: 1.0.1 + version: 1.0.2 description: UDR initial local configuration configuration: @@ -9,17 +9,14 @@ configuration: bindingIPv4: 127.0.0.4 # IP used to bind the service port: 8000 # port used to bind the service tls: # the local path of TLS key - pem: config/TLS/udr.pem # UDR TLS Certificate - key: config/TLS/udr.key # UDR TLS Private key + pem: cert/udr.pem # UDR TLS Certificate + key: cert/udr.key # UDR TLS Private key mongodb: name: free5gc # Database name in MongoDB url: mongodb://localhost:27017 # URL of MongoDB nrfUri: http://127.0.0.10:8000 # a valid URI of NRF -# the kind of log output -# debugLevel: how detailed to output, value: trace, debug, info, warn, error, fatal, panic -# ReportCaller: enable the caller report or not, value: true or false -logger: - UDR: - debugLevel: info - ReportCaller: false +logger: # log output setting + enable: true # true or false + level: info # how detailed to output, value: trace, debug, info, warn, error, fatal, panic + reportCaller: false # enable the caller report or not, value: true or false diff --git a/config/uerouting.yaml b/config/uerouting.yaml index fdb11373..f39184be 100644 --- a/config/uerouting.yaml +++ b/config/uerouting.yaml @@ -1,11 +1,11 @@ info: - version: 1.0.1 + version: 1.0.7 description: Routing information for UE ueRoutingInfo: # the list of UE routing information UE1: # Group Name members: - - imsi-2089300007487 # Subscription Permanent Identifier of the UE + - imsi-208930000007487 # Subscription Permanent Identifier of the UE topology: # Network topology for this group (Uplink: A->B, Downlink: B->A) # default path derived from this topology # node name should be consistent with smfcfg.yaml @@ -21,7 +21,7 @@ ueRoutingInfo: # the list of UE routing information UE2: # Group Name members: - - imsi-2089300007486 # Subscription Permanent Identifier of the UE + - imsi-208930000007486 # Subscription Permanent Identifier of the UE topology: # Network topology for this group (Uplink: A->B, Downlink: B->A) # default path derived from this topology # node name should be consistent with smfcfg.yaml @@ -35,3 +35,13 @@ ueRoutingInfo: # the list of UE routing information # The UPF's name should be consistent with smfcfg.yaml path: [BranchingUPF, AnchorUPF2] +routeProfile: # Maintains the mapping between RouteProfileID and ForwardingPolicyID of UPF + MEC1: # Route Profile identifier + forwardingPolicyID: 10 # Forwarding Policy ID of the route profile + +pfdDataForApp: # PFDs for an Application + - applicationId: edge # Application identifier + pfds: # PFDs for the Application + - pfdID: pfd1 # PFD identifier + flowDescriptions: # Represents a 3-tuple with protocol, server ip and server port for UL/DL application traffic + - permit out ip from 10.60.0.1 8080 to any diff --git a/config/upfcfg.yaml b/config/upfcfg.yaml index 938f2df1..cf142751 100644 --- a/config/upfcfg.yaml +++ b/config/upfcfg.yaml @@ -17,6 +17,7 @@ gtpu: type: N3 # name: upf.5gc.nctu.me # ifname: gtpif + # mtu: 1400 # The DNN list supported by UPF dnnList: diff --git a/config/webuicfg.yaml b/config/webuicfg.yaml index f837ab76..ed7aff34 100644 --- a/config/webuicfg.yaml +++ b/config/webuicfg.yaml @@ -1,5 +1,5 @@ info: - version: 1.0.0 + version: 1.0.1 description: WebUI initial local configuration configuration: @@ -7,10 +7,7 @@ configuration: name: free5gc # name of the mongodb url: mongodb://localhost:27017 # a valid URL of the mongodb -# the kind of log output -# debugLevel: how detailed to output, value: trace, debug, info, warn, error, fatal, panic -# ReportCaller: enable the caller report or not, value: true or false -logger: - WEBUI: - debugLevel: info - ReportCaller: false +logger: # log output setting + enable: true # true or false + level: info # how detailed to output, value: trace, debug, info, warn, error, fatal, panic + reportCaller: false # enable the caller report or not, value: true or false diff --git a/force_kill.sh b/force_kill.sh index 0bee0776..37d9471f 100755 --- a/force_kill.sh +++ b/force_kill.sh @@ -9,9 +9,12 @@ done sudo killall tcpdump sudo ip link del upfgtp sudo ip link del ipsec0 -sudo ip link del xfrmi-default +XFRMI_LIST=($(ip link | grep xfrmi | awk -F'[:,@]' '{print $2}')) +for XFRMI_IF in "${XFRMI_LIST[@]}" +do + sudo ip link del $XFRMI_IF +done sudo rm /dev/mqueue/* sudo rm -f /tmp/free5gc_unix_sock mongo --eval "db.NfProfile.drop();db.applicationData.influenceData.subsToNotify.drop();db.applicationData.subsToNotify.drop();db.policyData.subsToNotify.drop();db.exposureData.subsToNotify.drop()" free5gc mongosh --eval "db.NfProfile.drop();db.applicationData.influenceData.subsToNotify.drop();db.applicationData.subsToNotify.drop();db.policyData.subsToNotify.drop();db.exposureData.subsToNotify.drop()" free5gc - diff --git a/run.sh b/run.sh index 9a90f270..6fbef50e 100755 --- a/run.sh +++ b/run.sh @@ -102,7 +102,7 @@ if [ $PCAP_MODE -ne 0 ]; then PID_LIST+=($SUDO_TCPDUMP_PID $TCPDUMP_PID) fi -sudo -E ./bin/upf -c ./config/upfcfg.yaml -l ${LOG_PATH}upf.log -lc ${LOG_PATH}${LOG_NAME} & +sudo -E ./bin/upf -c ./config/upfcfg.yaml -l ${LOG_PATH}${LOG_NAME} & SUDO_UPF_PID=$! sleep 0.1 UPF_PID=$(pgrep -P $SUDO_UPF_PID) @@ -110,7 +110,6 @@ PID_LIST+=($SUDO_UPF_PID $UPF_PID) mongo --eval "db.NfProfile.drop();db.applicationData.influenceData.subsToNotify.drop();db.applicationData.subsToNotify.drop();db.policyData.subsToNotify.drop();db.exposureData.subsToNotify.drop()" free5gc mongosh --eval "db.NfProfile.drop();db.applicationData.influenceData.subsToNotify.drop();db.applicationData.subsToNotify.drop();db.policyData.subsToNotify.drop();db.exposureData.subsToNotify.drop()" free5gc - sleep 0.1 NF_LIST="nrf amf smf udr pcf udm nssf ausf" @@ -118,13 +117,13 @@ NF_LIST="nrf amf smf udr pcf udm nssf ausf" export GIN_MODE=release for NF in ${NF_LIST}; do - ./bin/${NF} -c ./config/${NF}cfg.yaml -l ${LOG_PATH}${NF}.log -lc ${LOG_PATH}${LOG_NAME} & + ./bin/${NF} -c ./config/${NF}cfg.yaml -l ${LOG_PATH}${LOG_NAME} & PID_LIST+=($!) sleep 0.1 done if [ $N3IWF_ENABLE -ne 0 ]; then - sudo ./bin/n3iwf -c ./config/n3iwfcfg.yaml -l ${LOG_PATH}n3iwf.log -lc ${LOG_PATH}${LOG_NAME} & + sudo ./bin/n3iwf -c ./config/n3iwfcfg.yaml -l ${LOG_PATH}${LOG_NAME} & SUDO_N3IWF_PID=$! sleep 1 N3IWF_PID=$(pgrep -P $SUDO_N3IWF_PID) diff --git a/test.sh b/test.sh index f148fc0d..8f2e5a58 100755 --- a/test.sh +++ b/test.sh @@ -77,7 +77,7 @@ function terminate() removeN3iwfInterfaces sudo ip link del veth2 sudo killall n3iwf - killall test.test + ps aux | grep test.test | awk '{print $2}' | xargs sudo kill -SIGUSR1 fi sleep 5 diff --git a/test/app/app.go b/test/app/app.go index 522988e9..3a3d49cc 100644 --- a/test/app/app.go +++ b/test/app/app.go @@ -1,16 +1,9 @@ package app -import ( - "github.com/urfave/cli" -) - type NetworkFunction interface { - Initialize(c *cli.Context) error - GetCliCmd() (flags []cli.Flag) - FilterCli(c *cli.Context) (args []string) - //setLogLevel() - Exec(*cli.Context) error - Start() + SetLogEnable(enable bool) + SetLogLevel(level string) + SetReportCaller(reportCaller bool) + Start(tlsKeyLogPath string) Terminate() - SetLogLevel() } diff --git a/test/consumerTestdata/AMF/TestAmf/smfProfile.go b/test/consumerTestdata/AMF/TestAmf/smfProfile.go index caa2925b..f9a3302b 100644 --- a/test/consumerTestdata/AMF/TestAmf/smfProfile.go +++ b/test/consumerTestdata/AMF/TestAmf/smfProfile.go @@ -6,9 +6,9 @@ import ( "github.com/free5gc/openapi/models" ) -func BuildSmfNfProfile() (string, models.NfProfile) { - uuId := uuid.New().String() - profile := models.NfProfile{ +func BuildSmfNfProfile() (uuId string, profile models.NfProfile) { + uuId = uuid.New().String() + profile = models.NfProfile{ NfInstanceId: uuId, NfType: models.NfType_SMF, NfStatus: models.NfStatus_REGISTERED, @@ -62,5 +62,6 @@ func BuildSmfNfProfile() (string, models.NfProfile) { }, }, } - return uuId, profile + return + } diff --git a/test/go.mod b/test/go.mod index 9407d897..16b95307 100644 --- a/test/go.mod +++ b/test/go.mod @@ -1,30 +1,31 @@ module test -go 1.14 +go 1.17 require ( git.cs.nctu.edu.tw/calee/sctp v1.1.0 github.com/antihax/optional v1.0.0 github.com/calee0219/fatal v0.0.1 github.com/davecgh/go-spew v1.1.1 - github.com/free5gc/amf v0.0.0-00010101000000-000000000000 + github.com/free5gc/amf v0.0.0 github.com/free5gc/aper v1.0.4 - github.com/free5gc/ausf v0.0.0-00010101000000-000000000000 - github.com/free5gc/n3iwf v0.0.0-00010101000000-000000000000 - github.com/free5gc/nas v1.0.7 + github.com/free5gc/ausf v0.0.0 + github.com/free5gc/n3iwf v0.0.0 + github.com/free5gc/nas v1.1.1 github.com/free5gc/ngap v1.0.6 - github.com/free5gc/nrf v0.0.0-00010101000000-000000000000 - github.com/free5gc/nssf v0.0.0-00010101000000-000000000000 - github.com/free5gc/openapi v1.0.6-0.20221120170212-ee7254ad5999 - github.com/free5gc/pcf v0.0.0-00010101000000-000000000000 - github.com/free5gc/smf v0.0.0-00010101000000-000000000000 - github.com/free5gc/udm v0.0.0-00010101000000-000000000000 - github.com/free5gc/udr v0.0.0-00010101000000-000000000000 - github.com/free5gc/util v1.0.3 + github.com/free5gc/nrf v0.0.0 + github.com/free5gc/nssf v0.0.0 + github.com/free5gc/openapi v1.0.6 + github.com/free5gc/pcf v0.0.0 + github.com/free5gc/smf v0.0.0 + github.com/free5gc/udm v0.0.0 + github.com/free5gc/udr v0.0.0 + github.com/free5gc/util v1.0.5-0.20230511064842-2e120956883b + github.com/gin-gonic/gin v1.9.0 github.com/go-ping/ping v0.0.0-20210506233800-ff8be3320020 github.com/google/uuid v1.3.0 github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 - github.com/stretchr/testify v1.7.0 + github.com/stretchr/testify v1.8.1 github.com/urfave/cli v1.22.5 github.com/vishvananda/netlink v1.1.0 go.mongodb.org/mongo-driver v1.8.4 @@ -33,6 +34,63 @@ require ( gopkg.in/yaml.v2 v2.4.0 ) +require ( + github.com/aead/cmac v0.0.0-20160719120800-7af84192f0b1 // indirect + github.com/antonfisher/nested-logrus-formatter v1.3.1 // indirect + github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d // indirect + github.com/bronze1man/radius v0.0.0-20190516032554-afd8baec892d // indirect + github.com/bytedance/sonic v1.8.0 // indirect + github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect + github.com/cpuguy83/go-md2man/v2 v2.0.1 // indirect + github.com/cydev/zero v0.0.0-20160322155811-4a4535dd56e7 // indirect + github.com/evanphx/json-patch v0.5.2 // indirect + github.com/free5gc/pfcp v1.0.6 // indirect + github.com/free5gc/tlv v1.0.2-0.20230131124215-8b6ebd69bf93 // indirect + github.com/gin-contrib/cors v1.3.1 // indirect + github.com/gin-contrib/sse v0.1.0 // indirect + github.com/go-playground/locales v0.14.1 // indirect + github.com/go-playground/universal-translator v0.18.1 // indirect + github.com/go-playground/validator/v10 v10.11.2 // indirect + github.com/go-stack/stack v1.8.0 // indirect + github.com/goccy/go-json v0.10.0 // indirect + github.com/golang-jwt/jwt v3.2.1+incompatible // indirect + github.com/golang/protobuf v1.5.2 // indirect + github.com/golang/snappy v0.0.1 // indirect + github.com/google/gopacket v1.1.19 // indirect + github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542 // indirect + github.com/json-iterator/go v1.1.12 // indirect + github.com/klauspost/compress v1.13.6 // indirect + github.com/klauspost/cpuid/v2 v2.0.9 // indirect + github.com/leodido/go-urn v1.2.1 // indirect + github.com/mattn/go-isatty v0.0.17 // indirect + github.com/mitchellh/mapstructure v1.4.3 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/pelletier/go-toml/v2 v2.0.6 // indirect + github.com/pkg/errors v0.9.1 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/russross/blackfriday/v2 v2.1.0 // indirect + github.com/sirupsen/logrus v1.8.1 // indirect + github.com/tim-ywliu/nested-logrus-formatter v1.3.2 // indirect + github.com/twitchyliquid64/golang-asm v0.15.1 // indirect + github.com/ugorji/go/codec v1.2.9 // indirect + github.com/vishvananda/netns v0.0.0-20211101163701-50045581ed74 // indirect + github.com/wmnsk/go-gtp v0.8.0 // indirect + github.com/xdg-go/pbkdf2 v1.0.0 // indirect + github.com/xdg-go/scram v1.0.2 // indirect + github.com/xdg-go/stringprep v1.0.2 // indirect + github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d // indirect + golang.org/x/arch v0.0.0-20210923205945-b76863e36670 // indirect + golang.org/x/crypto v0.5.0 // indirect + golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect + golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 // indirect + golang.org/x/text v0.7.0 // indirect + google.golang.org/appengine v1.6.7 // indirect + google.golang.org/protobuf v1.28.1 // indirect + gopkg.in/h2non/gock.v1 v1.1.2 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect +) + replace ( github.com/free5gc/amf => ../NFs/amf github.com/free5gc/ausf => ../NFs/ausf diff --git a/test/go.sum b/test/go.sum index cc903276..5ff3abef 100644 --- a/test/go.sum +++ b/test/go.sum @@ -53,17 +53,25 @@ github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+Ce github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bronze1man/radius v0.0.0-20190516032554-afd8baec892d h1:3Yh8YMWPvo93EMc2Buc+1rHw+G0m+b1cOMg8TypHth8= github.com/bronze1man/radius v0.0.0-20190516032554-afd8baec892d/go.mod h1:iZQ+zY4h2qv73M/PDpuqo6//w8M1n+uKS/nlMpRoS2o= +github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM= +github.com/bytedance/sonic v1.8.0 h1:ea0Xadu+sHlu7x5O3gKhRpQ1IKiMrSiHttPF0ybECuA= +github.com/bytedance/sonic v1.8.0/go.mod h1:i736AoUSYt75HyZLoJW9ERYxcy6eaN6h4BZXU064P/U= github.com/calee0219/fatal v0.0.1 h1:oWcLpGM3It4Q/PZ+P96TzTz5KvSHCmhGXhZJuI5onSE= github.com/calee0219/fatal v0.0.1/go.mod h1:LD4ehT5zbja+zJG6QhHToilfoCh+XByVfdUV71b//Yc= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F32mSOjUmXrMHnKwZdA8wcEefY7UVqBKYGjpdQY= +github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 h1:qSGYFH7+jGhDF8vLC+iwCD4WpbV1EBDSzWkJODFLams= +github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311/go.mod h1:b583jCggY9gE99b6G5LEC39OIiVsWj+R97kbl5odCEk= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d h1:U+s90UTSYgptZMwQh2aRr3LuazLJIa+Pg3Kc1ylSYVY= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/cpuguy83/go-md2man/v2 v2.0.1 h1:r/myEWzV9lfsM1tFLgDyu0atFtJ1fXn261LKYj/3DxU= +github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/cydev/zero v0.0.0-20160322155811-4a4535dd56e7 h1:OQoU2eJO+adwX0gBaIede9S+aL6aQU/0aKwktWKyl8s= github.com/cydev/zero v0.0.0-20160322155811-4a4535dd56e7/go.mod h1:XGbwUcTsr1d7ezSp77rqp7aaYHlX+01wCaIFUNMRY6g= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -77,27 +85,29 @@ github.com/evanphx/json-patch v0.5.2 h1:xVCHIVMUu1wtM/VkR9jVZ45N3FhZfYMMYGorLCR8 github.com/evanphx/json-patch v0.5.2/go.mod h1:ZWS5hhDbVDyob71nXKNL0+PWn6ToqBHMikGIFbs31qQ= github.com/free5gc/aper v1.0.4 h1:Ufbf5lzbXBOhSdUSaIdAhFMOjggsX4p6eWMrpzrrD60= github.com/free5gc/aper v1.0.4/go.mod h1:3K/m47BIPR2xhBkuHD1unp2LnArVtt3iTI4De0bCqpI= -github.com/free5gc/nas v1.0.7 h1:c+UXWENvJgTr/QZl50SyX+ZZzUdazGHHZ9ZGtnnwG5A= -github.com/free5gc/nas v1.0.7/go.mod h1:qPj0gxFk81cH9zIkg4hm3ID0hkYofBlzZzcciBnJxwY= +github.com/free5gc/nas v1.1.0/go.mod h1:fjWwpyp7/wOyL72HTkjvIe9YTCfGyZosjITsI5sXyuU= +github.com/free5gc/nas v1.1.1 h1:xUsqOOrb3kH38TQCzwZY7WN6WJkIerjERNjORDtnCbo= +github.com/free5gc/nas v1.1.1/go.mod h1:fjWwpyp7/wOyL72HTkjvIe9YTCfGyZosjITsI5sXyuU= github.com/free5gc/ngap v1.0.6 h1:f9sKqHMNrFZVo9Kp8hAyrCXSoI8l746N5O+DFn7vKHA= github.com/free5gc/ngap v1.0.6/go.mod h1:TG1kwwU/EyIlJ3bxY591rdxpD5ZeYnLZTzoWjcfvrBM= github.com/free5gc/openapi v1.0.4/go.mod h1:KRCnnp0GeK0Bl4gnrX79cQAidKXNENf8VRdG0y9R0Fc= -github.com/free5gc/openapi v1.0.5/go.mod h1:KRCnnp0GeK0Bl4gnrX79cQAidKXNENf8VRdG0y9R0Fc= -github.com/free5gc/openapi v1.0.6-0.20221120170212-ee7254ad5999 h1:vsp9fEwWHrqVipHKn1N5i/LJl5jwmNdCHX1BJm9Vk7M= -github.com/free5gc/openapi v1.0.6-0.20221120170212-ee7254ad5999/go.mod h1:cQRBF7Px8638imOacsQon1YHtMwSM6MUdZCtFtTPKmo= -github.com/free5gc/pfcp v1.0.4 h1:11ous/chOya/bG0bHAHHEUc7JUB2g6svABock8Ta2Zs= -github.com/free5gc/pfcp v1.0.4/go.mod h1:6S74Z5fSH1ch7MFG3aaWakQMc1WFCND8oIRNl5/ZamU= -github.com/free5gc/tlv v1.0.1 h1:DTMe/NG2T7JOJ7zAlbah/dfFw28s8HWlShUAEt1bV7g= -github.com/free5gc/tlv v1.0.1/go.mod h1:iN0eGdk8BKu0EUruKXuB8kIV+br/QjzNyewguZlfOgA= -github.com/free5gc/util v1.0.3 h1:or/gqHCAi3j2YKd+nzViRnc/tl1tuuJAYxCao6IbOAU= -github.com/free5gc/util v1.0.3/go.mod h1:DL1Dnryh//Ps5B+hfXbhU1R07fVfrmPs4uuTO4g9yTg= +github.com/free5gc/openapi v1.0.6 h1:ytRjU/YZRI8UhKKyfajXSyGB6s1YDFkJ1weeAGJ8LXw= +github.com/free5gc/openapi v1.0.6/go.mod h1:iw/N0E+FlX44EEx24IBi2EdZW8v+bkj3ETWPGnlK9DI= +github.com/free5gc/pfcp v1.0.6 h1:dKEVyZWozF1G+yk1JXw/1ggtIRI0v362say/Q6VDZTE= +github.com/free5gc/pfcp v1.0.6/go.mod h1:WzpW7Zxhx5WONMumNKRWbPn7pl/iTYp2FqRLNiOWUjs= +github.com/free5gc/tlv v1.0.2-0.20230131124215-8b6ebd69bf93 h1:QPSSI5zw4goiIfxem9doVyMqTO8iKLQ536pzpET5Y+Q= +github.com/free5gc/tlv v1.0.2-0.20230131124215-8b6ebd69bf93/go.mod h1:KbbQJIgGaA2jIwnTJgJ/lE3JSDEp3898S6c4TEq0Vyg= +github.com/free5gc/util v1.0.5-0.20230306071612-a52909216bd2/go.mod h1:fgV0hXf5arxAWs8D9LfrrfNByZ1IDCWYlgBzncy5GtE= +github.com/free5gc/util v1.0.5-0.20230511064842-2e120956883b h1:XMw3j+4AEXLeL/uyiZ7/qYE1X7Ul05RTwWBhzxCLi+0= +github.com/free5gc/util v1.0.5-0.20230511064842-2e120956883b/go.mod h1:l2Jrml4vojDomW5jdDJhIS60KdbrE9uPYhyAq/7OnF4= github.com/gin-contrib/cors v1.3.1 h1:doAsuITavI4IOcd0Y19U4B+O0dNWihRyX//nn4sEmgA= github.com/gin-contrib/cors v1.3.1/go.mod h1:jjEJ4268OPZUcU7k9Pm653S7lXUGcqMADzFA61xsmDk= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= github.com/gin-gonic/gin v1.5.0/go.mod h1:Nd6IXA8m5kNZdNEHMBd93KT+mdY3+bewLgRvmCsR2Do= -github.com/gin-gonic/gin v1.7.3 h1:aMBzLJ/GMEYmv1UWs2FFTcPISLrQH2mRgL9Glz8xows= -github.com/gin-gonic/gin v1.7.3/go.mod h1:jD2toBW3GZUr5UMcdrwQA10I7RuaFOl/SGeDjXkfUtY= +github.com/gin-gonic/gin v1.7.7/go.mod h1:axIBovoeJpVj8S3BwE0uPMTeReE4+AfFtqpqaZ1qq1U= +github.com/gin-gonic/gin v1.9.0 h1:OjyFBKICoexlu99ctXNR2gg+c5pKrKMuyjgARg9qeY8= +github.com/gin-gonic/gin v1.9.0/go.mod h1:W1Me9+hsUSyj3CePGrd1/QrKJMSJ1Tu/0hFEH89961k= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= @@ -109,18 +119,24 @@ github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-ping/ping v0.0.0-20210506233800-ff8be3320020 h1:mdi6AbCEoKCA1xKCmp7UtRB5fvGFlP92PvlhxgdvXEw= github.com/go-ping/ping v0.0.0-20210506233800-ff8be3320020/go.mod h1:KmHOjTUmJh/l04ukqPoBWPEZr9jwN05h5NXQl5C+DyY= -github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= +github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= +github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.12.1/go.mod h1:IUMDtCfWo/w/mtMfIE/IG2K+Ey3ygWanZIBtBW0W2TM= -github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q= github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= +github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= +github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= github.com/go-playground/universal-translator v0.16.0/go.mod h1:1AnU7NaIRDWWzGEKwgtJRd2xk99HeFyHw3yid4rvQIY= -github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no= github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= -github.com/go-playground/validator/v10 v10.4.1 h1:pH2c5ADXtd66mxoE0Zm9SUhxE20r7aM3F26W0hOn+GE= +github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= +github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4= +github.com/go-playground/validator/v10 v10.11.2 h1:q3SHpufmypg+erIExEKUmsgmhDTyhcJ38oeKGACXohU= +github.com/go-playground/validator/v10 v10.11.2/go.mod h1:NieE624vt4SCTJtD87arVLvdmjPAeV8BQlHtMnw9D7s= github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/goccy/go-json v0.10.0 h1:mXKd9Qw4NuzShiRlOXKews24ufknHO7gx30lsDyokKA= +github.com/goccy/go-json v0.10.0/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/golang-jwt/jwt v3.2.1+incompatible h1:73Z+4BJcrTC+KczS6WvTPvRGOp1WmfEP4Q1lOd9Z/+c= github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= @@ -165,8 +181,9 @@ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= +github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gopacket v1.1.19 h1:ves8RnFZPGiFnTS0uPQStjwru6uO6h+nlr9j6fL7kF8= github.com/google/gopacket v1.1.19/go.mod h1:iJ8V8n6KS+z2U1A8pUwu8bW5SyEMkXJB8Yo/Vo+TKTo= @@ -198,8 +215,9 @@ github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCV github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.11 h1:uVUAXhF2To8cbw/3xN3pxj6kk7TYKs98NIrTqPlMWAQ= github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= @@ -209,29 +227,39 @@ github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8 github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.13.6 h1:P76CopJELS0TiO2mebmnzgWaajssP/EszplttgQxcgc= github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= +github.com/klauspost/cpuid/v2 v2.0.9 h1:lgaqFMSdTdQYdZ04uHyN2d/eKdOMyi2YLSvlQIBFYa4= +github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= -github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= +github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/leodido/go-urn v1.1.0/go.mod h1:+cyI34gQWZcE1eQU7NVgKkkzdXDQHr1dBMtdAPozLkw= -github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= +github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= +github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= -github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng= +github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/mitchellh/mapstructure v1.4.1 h1:CpVNEelQCZBooIPDn+AR3NpivK/TIKU8bDxdASFVQag= github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/mapstructure v1.4.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/mapstructure v1.4.3 h1:OVowDSCllw/YjdLkam3/sm7wEtOy59d8ndGgCcyj8cs= +github.com/mitchellh/mapstructure v1.4.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw= github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8= github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= @@ -241,6 +269,9 @@ github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32 h1:W6apQkHrMkS0Muv8G/TipAy github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32/go.mod h1:9wM+0iRr9ahx58uYLpLIr5fm8diHn0JbqRycJi6w0Ms= github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= +github.com/pelletier/go-toml/v2 v2.0.6 h1:nrzqCb7j9cDFj2coyLNLaZuJTLjWjlaz6nvTvIwycIU= +github.com/pelletier/go-toml/v2 v2.0.6/go.mod h1:eumQOmlWiOPt5WriQQqoM5y18pDHwha2N+QD+EUNTek= +github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -263,9 +294,12 @@ github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsT github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q= +github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= +github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8= +github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo= +github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= +github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= @@ -278,26 +312,35 @@ github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIK github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4= github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= -github.com/tim-ywliu/event v0.1.0 h1:lLh1lkm5CZtnAbQInEPufEF4yVST9THmvSSP2TYP1Ms= -github.com/tim-ywliu/event v0.1.0/go.mod h1:A9ErEElAsxOGdM0DoJa4KUBFOq/L0aKZHSYGJwJ7lqU= +github.com/tim-ywliu/nested-logrus-formatter v1.3.2 h1:jugNJ2/CNCI79SxOJCOhwUHeN3O7/7/bj+ZRGOFlCSw= +github.com/tim-ywliu/nested-logrus-formatter v1.3.2/go.mod h1:oGPmcxZB65j9Wo7mCnQKSrKEJtVDqyjD666SGmyStXI= +github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= +github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= -github.com/ugorji/go/codec v1.1.7 h1:2SvQaVZ1ouYrrKKwoSk2pzd4A9evlKJb9oTL+OaLUSs= github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= +github.com/ugorji/go/codec v1.2.9 h1:rmenucSohSTiyL09Y+l2OCk+FrMxGMzho2+tjr5ticU= +github.com/ugorji/go/codec v1.2.9/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= github.com/urfave/cli v1.22.5 h1:lNq9sAHXK2qfdI8W+GRItjCEkI+2oR4d+MEHy1CKXoU= github.com/urfave/cli v1.22.5/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/vishvananda/netlink v1.1.0 h1:1iyaYNBLmP6L0220aDnYQpo1QEV4t4hJ+xEEhhJH8j0= github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYppBueQtXaqoE= -github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df h1:OviZH7qLw/7ZovXvuNyL3XQl8UFofeikI1NW1Gypu7k= github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17pCcGlemwknint6hfoeCVQrEMVwxRLRjXpq+BU= +github.com/vishvananda/netns v0.0.0-20211101163701-50045581ed74 h1:gga7acRE695APm9hlsSMoOoE65U4/TcqNj90mc69Rlg= +github.com/vishvananda/netns v0.0.0-20211101163701-50045581ed74/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0= github.com/wmnsk/go-gtp v0.8.0 h1:KbvPh2nRGrB67w3k80YhIv6NkjKsZn20i0B5wCjhdDs= github.com/wmnsk/go-gtp v0.8.0/go.mod h1:Y0reWDB701yW31+HeZcHfO6dLVRfn/f017vH+7syqrg= github.com/xdg-go/pbkdf2 v1.0.0 h1:Su7DPu48wXMwC3bs7MCNG+z4FhcyEuz5dlvchbq0B0c= @@ -319,6 +362,8 @@ go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +golang.org/x/arch v0.0.0-20210923205945-b76863e36670 h1:18EFjUmQOcUvxNYSkA6jO9VAiXCnxFY6NyDX0bHDmkU= +golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= @@ -326,8 +371,10 @@ golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201216223049-8b5274cf687f/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 h1:7I4JAnoQBe7ZtJcBaYHi5UtiO8tQHbUSXxL+pnGRANg= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= +golang.org/x/crypto v0.5.0 h1:U/0M97KRkSFvyD/3FSmdP5W5swImpNgle/EHFhOsQPE= +golang.org/x/crypto v0.5.0/go.mod h1:NK/OQwhpMQP3MwtdjgLlYHnH9ebylxKWv3e0fK+mkQU= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -391,8 +438,9 @@ golang.org/x/net v0.0.0-20200904194848-62affa334b73/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210501142056-aec3718b3fa0/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211008194852-3b03d305991f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= +golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -400,8 +448,9 @@ golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4Iltr golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20210810183815-faf39c7919d5 h1:Ati8dO7+U7mxpkPSxBZQEvzHVUYB/MqCklCN8ig5w/o= golang.org/x/oauth2 v0.0.0-20210810183815-faf39c7919d5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 h1:RerP+noqYHUQ8CMRcPlC2nvTa4dcBIjegkuWdcUDuqg= +golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -438,6 +487,7 @@ golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200217220822-9197077df867/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -454,14 +504,18 @@ golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -471,6 +525,9 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= +golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -545,8 +602,9 @@ google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7 google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.6 h1:lMO5rYAqUxkmaj76jAkRUvt5JZgFymx/+Q5Mzfivuhc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= +google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= @@ -600,13 +658,15 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= +google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= gopkg.in/go-playground/validator.v9 v9.29.1/go.mod h1:+c9/zcJMFNgbLvly1L1V+PpxWdVbfP1avr/N00E2vyQ= @@ -620,8 +680,9 @@ gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= @@ -630,5 +691,6 @@ honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= diff --git a/test/nasTestpacket/NasPdu.go b/test/nasTestpacket/NasPdu.go index d2e24e5e..c5c3bb18 100644 --- a/test/nasTestpacket/NasPdu.go +++ b/test/nasTestpacket/NasPdu.go @@ -5,7 +5,6 @@ import ( "encoding/base64" "encoding/hex" "fmt" - "net" "github.com/free5gc/nas" "github.com/free5gc/nas/logger" @@ -239,57 +238,11 @@ func GetPduSessionModificationRequest(pduSessionId uint8) []byte { pduSessionModificationRequest.SetMessageType(nas.MsgTypePDUSessionModificationRequest) pduSessionModificationRequest.PDUSessionID.SetPDUSessionID(pduSessionId) pduSessionModificationRequest.PTI.SetPTI(0x00) - - rules := nasType.QoSRules{ - nasType.QoSRule{ - Identifier: 0, - DQR: false, - Operation: nasType.OperationCodeCreateNewQoSRule, - Precedence: 200, - PacketFilterList: nasType.PacketFilterList{ - nasType.PacketFilter{ - Identifier: 0x01, - Direction: nasType.PacketFilterDirectionBidirectional, - Components: nasType.PacketFilterComponentList{ - &nasType.PacketFilterIPv4RemoteAddress{ - Address: net.ParseIP("192.168.0.0").To4(), - Mask: net.IPMask{255, 255, 255, 0}, - }, - &nasType.PacketFilterIPv4LocalAddress{ - Address: net.ParseIP("10.60.0.0").To4(), - Mask: net.IPMask{255, 255, 255, 0}, - }, - &nasType.PacketFilterRemotePortRange{ - LowLimit: 3000, - HighLimit: 6000, - }, - }, - }, - }, - }, - } - if qosRuleBytes, err := rules.MarshalBinary(); err == nil { - pduSessionModificationRequest.RequestedQosRules = nasType.NewRequestedQosRules(0x7A) - pduSessionModificationRequest.RequestedQosRules.SetLen(uint16(len(qosRuleBytes))) - pduSessionModificationRequest.RequestedQosRules.SetQoSRules(qosRuleBytes) - } - - qosFlowDescs := nasType.QoSFlowDescs{ - nasType.QoSFlowDesc{ - OperationCode: nasType.OperationCodeCreateNewQoSFlowDescription, - Parameters: nasType.QoSFlowParameterList{ - &nasType.QoSFlow5QI{ - FiveQI: 5, - }, - }, - }, - } - - if qosFlowDescsBytes, err := qosFlowDescs.MarshalBinary(); err == nil { - pduSessionModificationRequest.RequestedQosFlowDescriptions = nasType.NewRequestedQosFlowDescriptions(0x79) - pduSessionModificationRequest.RequestedQosFlowDescriptions.SetLen(uint16(len(qosFlowDescsBytes))) - pduSessionModificationRequest.RequestedQosFlowDescriptions.SetQoSFlowDescriptions(qosFlowDescsBytes) - } + // pduSessionModificationRequest.RequestedQosFlowDescriptions = nasType.NewRequestedQosFlowDescriptions(nasMessage. + // PDUSessionModificationRequestRequestedQosFlowDescriptionsType) + // pduSessionModificationRequest.RequestedQosFlowDescriptions.SetLen(6) + // pduSessionModificationRequest.RequestedQosFlowDescriptions.SetQoSFlowDescriptions([]uint8{0x09, 0x20, 0x41, 0x01, + // 0x01, 0x09}) m.GsmMessage.PDUSessionModificationRequest = pduSessionModificationRequest diff --git a/test/ngapTestpacket/build.go b/test/ngapTestpacket/build.go index c5ea31bf..601e8ac9 100644 --- a/test/ngapTestpacket/build.go +++ b/test/ngapTestpacket/build.go @@ -1064,25 +1064,27 @@ func BuildHandoverRequestAcknowledge(amfUeNgapID, ranUeNgapID int64) (pdu ngapTy handoverRequestAcknowledgeIEs.List = append(handoverRequestAcknowledgeIEs.List, ie) - //PDU Session Resource Failed to setup List - ie = ngapType.HandoverRequestAcknowledgeIEs{} - ie.Id.Value = ngapType.ProtocolIEIDPDUSessionResourceFailedToSetupListHOAck - ie.Criticality.Value = ngapType.CriticalityPresentIgnore - ie.Value.Present = ngapType.HandoverRequestAcknowledgeIEsPresentPDUSessionResourceFailedToSetupListHOAck - ie.Value.PDUSessionResourceFailedToSetupListHOAck = new(ngapType.PDUSessionResourceFailedToSetupListHOAck) + /* + //PDU Session Resource Failed to setup List + ie = ngapType.HandoverRequestAcknowledgeIEs{} + ie.Id.Value = ngapType.ProtocolIEIDPDUSessionResourceFailedToSetupListHOAck + ie.Criticality.Value = ngapType.CriticalityPresentIgnore + ie.Value.Present = ngapType.HandoverRequestAcknowledgeIEsPresentPDUSessionResourceFailedToSetupListHOAck + ie.Value.PDUSessionResourceFailedToSetupListHOAck = new(ngapType.PDUSessionResourceFailedToSetupListHOAck) - pDUSessionResourceFailedToSetupListHOAck := ie.Value.PDUSessionResourceFailedToSetupListHOAck + pDUSessionResourceFailedToSetupListHOAck := ie.Value.PDUSessionResourceFailedToSetupListHOAck - //PDU Session Resource Failed to setup Item - pDUSessionResourceFailedToSetupItemHOAck := ngapType.PDUSessionResourceFailedToSetupItemHOAck{} - pDUSessionResourceFailedToSetupItemHOAck.PDUSessionID.Value = 11 - pDUSessionResourceFailedToSetupItemHOAck.HandoverResourceAllocationUnsuccessfulTransfer = - GetHandoverResourceAllocationUnsuccessfulTransfer() + //PDU Session Resource Failed to setup Item + pDUSessionResourceFailedToSetupItemHOAck := ngapType.PDUSessionResourceFailedToSetupItemHOAck{} + pDUSessionResourceFailedToSetupItemHOAck.PDUSessionID.Value = 11 + pDUSessionResourceFailedToSetupItemHOAck.HandoverResourceAllocationUnsuccessfulTransfer = + GetHandoverResourceAllocationUnsuccessfulTransfer() - pDUSessionResourceFailedToSetupListHOAck.List = - append(pDUSessionResourceFailedToSetupListHOAck.List, pDUSessionResourceFailedToSetupItemHOAck) + pDUSessionResourceFailedToSetupListHOAck.List = + append(pDUSessionResourceFailedToSetupListHOAck.List, pDUSessionResourceFailedToSetupItemHOAck) - handoverRequestAcknowledgeIEs.List = append(handoverRequestAcknowledgeIEs.List, ie) + handoverRequestAcknowledgeIEs.List = append(handoverRequestAcknowledgeIEs.List, ie) + */ //Target To Source TransparentContainer ie = ngapType.HandoverRequestAcknowledgeIEs{} @@ -3258,7 +3260,7 @@ func buildPDUSessionResourceModifyResponseTransfer() (data ngapType.PDUSessionRe qosFlowAddOrModifyResponseItem := ngapType.QosFlowAddOrModifyResponseItem{ QosFlowIdentifier: ngapType.QosFlowIdentifier{ - Value: 5, + Value: 1, }, } diff --git a/test/ngsetup_test.go b/test/ngsetup_test.go index 9b8e1dba..60fc56f9 100644 --- a/test/ngsetup_test.go +++ b/test/ngsetup_test.go @@ -3,8 +3,9 @@ package test_test import ( "fmt" "os" + "os/signal" "strings" - "sync" + "syscall" "testing" "time" @@ -34,22 +35,11 @@ import ( "github.com/free5gc/udm/pkg/suci" udr_factory "github.com/free5gc/udr/pkg/factory" udr_service "github.com/free5gc/udr/pkg/service" - logger_util "github.com/free5gc/util/logger" "github.com/free5gc/util/mongoapi" ) var initFlag bool = true -var NFs = []app.NetworkFunction{ - &nrf_service.NRF{}, - &amf_service.AMF{}, - &smf_service.SMF{}, - &udr_service.UDR{}, - &pcf_service.PCF{}, - &udm_service.UDM{}, - &nssf_service.NSSF{}, - &ausf_service.AUSF{}, - //&n3iwf_service.N3IWF{}, -} +var NFs = []app.NetworkFunction{} func init() { var testID string = "" @@ -78,38 +68,53 @@ func init() { if err := nrfConfig(); err != nil { fmt.Printf("NRF Config failed: %v\n", err) } + nrfApp, _ := nrf_service.NewApp(nrf_factory.NrfConfig) + NFs = append(NFs, nrfApp) if err := amfConfig(testID); err != nil { fmt.Printf("AMF Config failed: %v\n", err) } + amfApp, _ := amf_service.NewApp(amf_factory.AmfConfig) + NFs = append(NFs, amfApp) if err := smfConfig(testID); err != nil { fmt.Printf("SMF Config failed: %v\n", err) } + smfApp, _ := smf_service.NewApp(smf_factory.SmfConfig) + NFs = append(NFs, smfApp) if err := udrConfig(); err != nil { fmt.Printf("UDR Config failed: %v\n", err) } + udrApp, _ := udr_service.NewApp(udr_factory.UdrConfig) + NFs = append(NFs, udrApp) if err := pcfConfig(); err != nil { fmt.Printf("PCF Config failed: %v\n", err) } + pcfApp, _ := pcf_service.NewApp(pcf_factory.PcfConfig) + NFs = append(NFs, pcfApp) if err := udmConfig(); err != nil { fmt.Printf("UDM Config failed: %v\n", err) } + udmApp, _ := udm_service.NewApp(udm_factory.UdmConfig) + NFs = append(NFs, udmApp) if err := nssfConfig(); err != nil { fmt.Printf("NSSF Config failed: %v\n", err) } + nssfApp, _ := nssf_service.NewApp(nssf_factory.NssfConfig) + NFs = append(NFs, nssfApp) if err := ausfConfig(); err != nil { fmt.Printf("AUSF Config failed: %v\n", err) } + ausfApp, _ := ausf_service.NewApp(ausf_factory.AusfConfig) + NFs = append(NFs, ausfApp) - for _, service := range NFs { - service.SetLogLevel() - go service.Start() + for _, app := range NFs { + go app.Start("") time.Sleep(200 * time.Millisecond) } } else { @@ -204,9 +209,10 @@ func TestCN(t *testing.T) { defer beforeClose(ue) - wg := sync.WaitGroup{} - wg.Add(1) - wg.Wait() + // subscribe os signal + c := make(chan os.Signal, 1) + signal.Notify(c, os.Signal(syscall.SIGUSR1)) + <-c } func beforeClose(ue *test.RanUeContext) { @@ -217,9 +223,9 @@ func beforeClose(ue *test.RanUeContext) { } func nrfConfig() error { - nrf_factory.NrfConfig = nrf_factory.Config{ + nrf_factory.NrfConfig = &nrf_factory.Config{ Info: &nrf_factory.Info{ - Version: "1.0.1", + Version: "1.0.2", Description: "NRF initial test configuration", }, Configuration: &nrf_factory.Configuration{ @@ -230,9 +236,9 @@ func nrfConfig() error { RegisterIPv4: "127.0.0.10", BindingIPv4: "127.0.0.10", Port: 8000, - Tls: &nrf_factory.Tls{ - Pem: "config/TLS/nrf.pem", - Key: "config/TLS/nrf.key", + Cert: &nrf_factory.Cert{ + Pem: "cert/nrf.pem", + Key: "cert/nrf.key", }, }, DefaultPlmnId: models.PlmnId{ @@ -244,18 +250,13 @@ func nrfConfig() error { "nnrf-disc", }, }, - Logger: &logger_util.Logger{ - NRF: &logger_util.LogSetting{ - DebugLevel: "info", - ReportCaller: false, - }, + Logger: &nrf_factory.Logger{ + Enable: true, + Level: "info", + ReportCaller: false, }, } - if err := nrf_factory.CheckConfigVersion(); err != nil { - return err - } - if _, err := nrf_factory.NrfConfig.Validate(); err != nil { return err } @@ -276,9 +277,9 @@ func amfConfig(testID string) error { cipheringOrder = []string{"NEA0"} } - amf_factory.AmfConfig = amf_factory.Config{ + amf_factory.AmfConfig = &amf_factory.Config{ Info: &amf_factory.Info{ - Version: "1.0.3", + Version: "1.0.9", Description: "AMF initial test configuration", }, Configuration: &amf_factory.Configuration{ @@ -290,8 +291,8 @@ func amfConfig(testID string) error { BindingIPv4: "127.0.0.18", Port: 8000, Tls: &amf_factory.Tls{ - Pem: "config/TLS/amf.pem", - Key: "config/TLS/amf.key", + Pem: "cert/amf.pem", + Key: "cert/amf.key", }, }, ServiceNameList: []string{ @@ -313,7 +314,7 @@ func amfConfig(testID string) error { Mcc: "208", Mnc: "93", }, - Tac: "1", + Tac: "000001", }}, PlmnSupportList: []amf_factory.PlmnSupportItem{{ PlmnId: &models.PlmnId{ @@ -340,20 +341,33 @@ func amfConfig(testID string) error { Full: "free5GC", Short: "free", }, - NetworkFeatureSupport5GS: &amf_factory.NetworkFeatureSupport5GS{ - Enable: true, - Length: 1, - ImsVoPS: 0, - Emc: 0, - Emf: 0, - IwkN26: 0, - Mpsi: 0, - EmcN3: 0, - Mcsi: 0, + NgapIE: &amf_factory.NgapIE{ + MobilityRestrictionList: &amf_factory.MobilityRestrictionList{ + Enable: true, + }, + MaskedIMEISV: &amf_factory.MaskedIMEISV{ + Enable: true, + }, + RedirectionVoiceFallback: &amf_factory.RedirectionVoiceFallback{ + Enable: false, + }, }, - T3502Value: 720, - T3512Value: 3600, - Non3gppDeregistrationTimerValue: 3240, + NasIE: &amf_factory.NasIE{ + NetworkFeatureSupport5GS: &amf_factory.NetworkFeatureSupport5GS{ + Enable: true, + Length: 1, + ImsVoPS: 0, + Emc: 0, + Emf: 0, + IwkN26: 0, + Mpsi: 0, + EmcN3: 0, + Mcsi: 0, + }, + }, + T3502Value: 720, + T3512Value: 3600, + Non3gppDeregTimerValue: 3240, T3513: amf_factory.TimerValue{ Enable: true, ExpireTime: 6000000000, @@ -385,34 +399,13 @@ func amfConfig(testID string) error { MaxRetryTimes: 4, }, }, - Logger: &logger_util.Logger{ - AMF: &logger_util.LogSetting{ - DebugLevel: "info", - ReportCaller: false, - }, - NAS: &logger_util.LogSetting{ - DebugLevel: "info", - ReportCaller: false, - }, - FSM: &logger_util.LogSetting{ - DebugLevel: "info", - ReportCaller: false, - }, - NGAP: &logger_util.LogSetting{ - DebugLevel: "info", - ReportCaller: false, - }, - Aper: &logger_util.LogSetting{ - DebugLevel: "info", - ReportCaller: false, - }, + Logger: &amf_factory.Logger{ + Enable: true, + Level: "info", + ReportCaller: false, }, } - if err := amf_factory.CheckConfigVersion(); err != nil { - return err - } - if _, err := amf_factory.AmfConfig.Validate(); err != nil { return err } @@ -421,9 +414,15 @@ func amfConfig(testID string) error { } func smfConfig(testID string) error { - smf_factory.SmfConfig = smf_factory.Config{ + var dnaiList []string + + if testID == "TestAFInfluenceOnTrafficRouting" { + dnaiList = []string{"edge"} + } + + smf_factory.SmfConfig = &smf_factory.Config{ Info: &smf_factory.Info{ - Version: "1.0.2", + Version: "1.0.7", Description: "SMF initial single test configuration", }, Configuration: &smf_factory.Configuration{ @@ -434,8 +433,8 @@ func smfConfig(testID string) error { BindingIPv4: "127.0.0.2", Port: 8000, Tls: &smf_factory.Tls{ - Pem: "config/TLS/smf.pem", - Key: "config/TLS/smf.key", + Pem: "cert/smf.pem", + Key: "cert/smf.key", }, }, ServiceNameList: []string{ @@ -443,12 +442,12 @@ func smfConfig(testID string) error { "nsmf-event-exposure", "nsmf-oam", }, - SNssaiInfo: []smf_factory.SnssaiInfoItem{{ + SNssaiInfo: []*smf_factory.SnssaiInfoItem{{ SNssai: &models.Snssai{ Sst: 1, Sd: "010203", }, - DnnInfos: []smf_factory.SnssaiDnnInfoItem{{ + DnnInfos: []*smf_factory.SnssaiDnnInfoItem{{ Dnn: "internet", DNS: &smf_factory.DNS{ IPv4Addr: "8.8.8.8", @@ -460,7 +459,7 @@ func smfConfig(testID string) error { Sst: 1, Sd: "112233", }, - DnnInfos: []smf_factory.SnssaiDnnInfoItem{ + DnnInfos: []*smf_factory.SnssaiDnnInfoItem{ { Dnn: "internet", DNS: &smf_factory.DNS{ @@ -478,24 +477,29 @@ func smfConfig(testID string) error { }, }}, PFCP: &smf_factory.PFCP{ - Addr: "10.200.200.1", + NodeID: "10.200.200.1", + ExternalAddr: "10.200.200.1", + ListenAddr: "10.200.200.1", }, UserPlaneInformation: smf_factory.UserPlaneInformation{ - UPNodes: map[string]smf_factory.UPNode{ + UPNodes: map[string]*smf_factory.UPNode{ "gNB1": { Type: "AN", + ANIP: "192.188.2.3", }, "UPF": { Type: "UPF", NodeID: "10.200.200.101", - SNssaiInfos: []smf_factory.SnssaiUpfInfoItem{{ + Addr: "10.200.200.101", + SNssaiInfos: []*smf_factory.SnssaiUpfInfoItem{{ SNssai: &models.Snssai{ Sst: 1, Sd: "010203", }, - DnnUpfInfoList: []smf_factory.DnnUpfInfoItem{{ - Dnn: "internet", - Pools: []smf_factory.UEIPPool{{ + DnnUpfInfoList: []*smf_factory.DnnUpfInfoItem{{ + Dnn: "internet", + DnaiList: dnaiList, + Pools: []*smf_factory.UEIPPool{{ Cidr: "10.60.0.0/16", }}, }}, @@ -504,93 +508,86 @@ func smfConfig(testID string) error { Sst: 1, Sd: "112233", }, - DnnUpfInfoList: []smf_factory.DnnUpfInfoItem{{ + DnnUpfInfoList: []*smf_factory.DnnUpfInfoItem{{ Dnn: "internet", - Pools: []smf_factory.UEIPPool{{ + Pools: []*smf_factory.UEIPPool{{ Cidr: "10.61.0.0/16", }}, }}, }}, - InterfaceUpfInfoList: []smf_factory.InterfaceUpfInfoItem{{ + InterfaceUpfInfoList: []*smf_factory.InterfaceUpfInfoItem{{ InterfaceType: "N3", Endpoints: []string{ "10.200.200.102", }, - NetworkInstance: "internet", + NetworkInstances: []string{ + "internet", + }, }}, }, }, - Links: []smf_factory.UPLink{{ + Links: []*smf_factory.UPLink{{ A: "gNB1", B: "UPF", }}, }, - NrfUri: "http://127.0.0.10:8000", - }, - Logger: &logger_util.Logger{ - SMF: &logger_util.LogSetting{ - DebugLevel: "info", - ReportCaller: false, - }, - NAS: &logger_util.LogSetting{ - DebugLevel: "info", - ReportCaller: false, - }, - NGAP: &logger_util.LogSetting{ - DebugLevel: "info", - ReportCaller: false, - }, - Aper: &logger_util.LogSetting{ - DebugLevel: "info", - ReportCaller: false, + T3591: &smf_factory.TimerValue{ + Enable: true, + ExpireTime: 5 * time.Second, + MaxRetryTimes: 2, }, - PFCP: &logger_util.LogSetting{ - DebugLevel: "info", - ReportCaller: false, + T3592: &smf_factory.TimerValue{ + Enable: true, + ExpireTime: 5 * time.Second, + MaxRetryTimes: 2, }, + NrfUri: "http://127.0.0.10:8000", + }, + Logger: &smf_factory.Logger{ + Enable: true, + Level: "info", + ReportCaller: false, }, } if testID == "TestRequestTwoPDUSessions" { smf_factory.SmfConfig.Configuration.UserPlaneInformation.Links = - append(smf_factory.SmfConfig.Configuration.UserPlaneInformation.Links, smf_factory.UPLink{ + append(smf_factory.SmfConfig.Configuration.UserPlaneInformation.Links, &smf_factory.UPLink{ A: "gNB1", B: "UPF2", }) smf_factory.SmfConfig.Configuration.UserPlaneInformation.UPNodes["UPF2"] = - smf_factory.UPNode{ + &smf_factory.UPNode{ Type: "UPF", NodeID: "10.200.200.102", Addr: "10.200.200.102", - SNssaiInfos: []smf_factory.SnssaiUpfInfoItem{{ + SNssaiInfos: []*smf_factory.SnssaiUpfInfoItem{{ SNssai: &models.Snssai{ Sst: 1, Sd: "112233", }, - DnnUpfInfoList: []smf_factory.DnnUpfInfoItem{{ + DnnUpfInfoList: []*smf_factory.DnnUpfInfoItem{{ Dnn: "internet2", - Pools: []smf_factory.UEIPPool{{ + Pools: []*smf_factory.UEIPPool{{ Cidr: "10.62.0.0/16", }}, }}, }}, - InterfaceUpfInfoList: []smf_factory.InterfaceUpfInfoItem{{ + InterfaceUpfInfoList: []*smf_factory.InterfaceUpfInfoItem{{ InterfaceType: "N3", Endpoints: []string{ "10.200.200.102", }, - NetworkInstance: "internet2", + NetworkInstances: []string{ + "internet2", + }, }}, } } smfUeRoutingConfig() - if err := smf_factory.CheckConfigVersion(); err != nil { - return err - } - if _, err := smf_factory.SmfConfig.Validate(); err != nil { return err } @@ -603,9 +600,9 @@ func smfConfig(testID string) error { } func smfUeRoutingConfig() { - smf_factory.UERoutingConfig = smf_factory.RoutingConfig{ + smf_factory.UERoutingConfig = &smf_factory.RoutingConfig{ Info: &smf_factory.Info{ - Version: "1.0.1", + Version: "1.0.7", Description: "SMF initial test routing information for UE", }, UERoutingInfo: map[string]smf_factory.UERoutingInfo{ @@ -648,13 +645,27 @@ func smfUeRoutingConfig() { }}, }, }, + RouteProf: map[smf_factory.RouteProfID]smf_factory.RouteProfile{ + "MEC1": { + ForwardingPolicyID: "10", + }, + }, + PfdDatas: []*smf_factory.PfdDataForApp{{ + AppID: "edge", + Pfds: []smf_factory.PfdContent{{ + PfdID: "pfd1", + FlowDescriptions: []string{ + "permit out ip from 10.60.0.0/24 8080 to 10.60.0.1", + }, + }}, + }}, } } func udrConfig() error { - udr_factory.UdrConfig = udr_factory.Config{ + udr_factory.UdrConfig = &udr_factory.Config{ Info: &udr_factory.Info{ - Version: "1.0.1", + Version: "1.0.2", Description: "UDR initial test configuration", }, Configuration: &udr_factory.Configuration{ @@ -664,8 +675,8 @@ func udrConfig() error { BindingIPv4: "127.0.0.4", Port: 8000, Tls: &udr_factory.Tls{ - Pem: "config/TLS/udr.pem", - Key: "config/TLS/udr.key", + Pem: "cert/udr.pem", + Key: "cert/udr.key", }, }, Mongodb: &udr_factory.Mongodb{ @@ -674,18 +685,13 @@ func udrConfig() error { }, NrfUri: "http://127.0.0.10:8000", }, - Logger: &logger_util.Logger{ - UDR: &logger_util.LogSetting{ - DebugLevel: "info", - ReportCaller: false, - }, + Logger: &udr_factory.Logger{ + Enable: true, + Level: "info", + ReportCaller: false, }, } - if err := udr_factory.CheckConfigVersion(); err != nil { - return err - } - if _, err := udr_factory.UdrConfig.Validate(); err != nil { return err } @@ -694,9 +700,9 @@ func udrConfig() error { } func pcfConfig() error { - pcf_factory.PcfConfig = pcf_factory.Config{ + pcf_factory.PcfConfig = &pcf_factory.Config{ Info: &pcf_factory.Info{ - Version: "1.0.1", + Version: "1.0.2", Description: "PCF initial test configuration", }, Configuration: &pcf_factory.Configuration{ @@ -707,8 +713,8 @@ func pcfConfig() error { BindingIPv4: "127.0.0.7", Port: 8000, Tls: &pcf_factory.Tls{ - Pem: "config/TLS/pcf.pem", - Key: "config/TLS/pcf.key", + Pem: "cert/pcf.pem", + Key: "cert/pcf.key", }, }, TimeFormat: "2019-01-02 15:04:05", @@ -734,18 +740,13 @@ func pcfConfig() error { Url: "mongodb://localhost:27017", }, }, - Logger: &logger_util.Logger{ - PCF: &logger_util.LogSetting{ - DebugLevel: "info", - ReportCaller: false, - }, + Logger: &pcf_factory.Logger{ + Enable: true, + Level: "info", + ReportCaller: false, }, } - if err := pcf_factory.CheckConfigVersion(); err != nil { - return err - } - if _, err := pcf_factory.PcfConfig.Validate(); err != nil { return err } @@ -754,9 +755,9 @@ func pcfConfig() error { } func udmConfig() error { - udm_factory.UdmConfig = udm_factory.Config{ + udm_factory.UdmConfig = &udm_factory.Config{ Info: &udm_factory.Info{ - Version: "1.0.2", + Version: "1.0.3", Description: "UDM initial test configuration", }, Configuration: &udm_factory.Configuration{ @@ -773,8 +774,8 @@ func udmConfig() error { BindingIPv4: "127.0.0.3", Port: 8000, Tls: &udm_factory.Tls{ - Pem: "config/TLS/udm.pem", - Key: "config/TLS/udm.key", + Pem: "cert/udm.pem", + Key: "cert/udm.key", }, }, NrfUri: "http://127.0.0.10:8000", @@ -791,18 +792,13 @@ func udmConfig() error { }, }, }, - Logger: &logger_util.Logger{ - UDM: &logger_util.LogSetting{ - DebugLevel: "info", - ReportCaller: false, - }, + Logger: &udm_factory.Logger{ + Enable: true, + Level: "info", + ReportCaller: false, }, } - if err := udm_factory.CheckConfigVersion(); err != nil { - return err - } - if _, err := udm_factory.UdmConfig.Validate(); err != nil { return err } @@ -813,9 +809,9 @@ func udmConfig() error { func nssfConfig() error { var accessType3GPP models.AccessType = models.AccessType__3_GPP_ACCESS - nssf_factory.NssfConfig = nssf_factory.Config{ + nssf_factory.NssfConfig = &nssf_factory.Config{ Info: &nssf_factory.Info{ - Version: "1.0.1", + Version: "1.0.2", Description: "NSSF initial test configuration", }, Configuration: &nssf_factory.Configuration{ @@ -826,8 +822,8 @@ func nssfConfig() error { BindingIPv4: "127.0.0.31", Port: 8000, Tls: &nssf_factory.Tls{ - Pem: "config/TLS/nssf.pem", - Key: "config/TLS/nssf.key", + Pem: "cert/nssf.pem", + Key: "cert/nssf.key", }, }, ServiceNameList: []models.ServiceName{ @@ -1163,7 +1159,7 @@ func nssfConfig() error { Mcc: "466", Mnc: "92", }, - Tac: "33457", + Tac: "33458", }, AccessType: &accessType3GPP, SupportedSnssaiList: []models.Snssai{{ @@ -1193,7 +1189,7 @@ func nssfConfig() error { Mcc: "466", Mnc: "92", }, - Tac: "33458", + Tac: "33459", }, AccessType: &accessType3GPP, SupportedSnssaiList: []models.Snssai{{ @@ -1288,27 +1284,20 @@ func nssfConfig() error { }}, }}, }, - Logger: &logger_util.Logger{ - NSSF: &logger_util.LogSetting{ - DebugLevel: "info", - ReportCaller: false, - }, + Logger: &nssf_factory.Logger{ + Enable: true, + Level: "info", + ReportCaller: false, }, } - if err := nssf_factory.CheckConfigVersion(); err != nil { - return err - } - - nssf_factory.Configured = true - return nil } func ausfConfig() error { - ausf_factory.AusfConfig = ausf_factory.Config{ + ausf_factory.AusfConfig = &ausf_factory.Config{ Info: &ausf_factory.Info{ - Version: "1.0.2", + Version: "1.0.3", Description: "AUSF initial test configuration", }, Configuration: &ausf_factory.Configuration{ @@ -1318,8 +1307,8 @@ func ausfConfig() error { BindingIPv4: "127.0.0.9", Port: 8000, Tls: &ausf_factory.Tls{ - Pem: "config/TLS/ausf.pem", - Key: "config/TLS/ausf.key", + Pem: "cert/ausf.pem", + Key: "cert/ausf.key", }, }, ServiceNameList: []string{ @@ -1335,18 +1324,13 @@ func ausfConfig() error { }}, GroupId: "ausfGroup001", }, - Logger: &logger_util.Logger{ - AUSF: &logger_util.LogSetting{ - DebugLevel: "info", - ReportCaller: false, - }, + Logger: &ausf_factory.Logger{ + Enable: true, + Level: "info", + ReportCaller: false, }, } - if err := ausf_factory.CheckConfigVersion(); err != nil { - return err - } - if _, err := ausf_factory.AusfConfig.Validate(); err != nil { return err } diff --git a/test/non3gpp_test.go b/test/non3gpp_test.go index 595f7ab1..c36512f6 100644 --- a/test/non3gpp_test.go +++ b/test/non3gpp_test.go @@ -15,7 +15,6 @@ import ( "test/nasTestpacket" "github.com/davecgh/go-spew/spew" - "github.com/free5gc/util/ueauth" "github.com/go-ping/ping" "github.com/stretchr/testify/assert" "github.com/vishvananda/netlink" @@ -30,6 +29,7 @@ import ( "github.com/free5gc/nas/nasType" "github.com/free5gc/nas/security" "github.com/free5gc/openapi/models" + "github.com/free5gc/util/ueauth" ) var ( @@ -44,7 +44,12 @@ var ( ueInnerAddr = new(net.IPNet) ) -func generateSPI(n3ue *context.N3IWFUe) []byte { +type N3IWFUe struct { + context.N3IWFIkeUe + context.N3IWFRanUe +} + +func generateSPI(n3ue *N3IWFUe) []byte { var spi uint32 spiByte := make([]byte, 4) for { @@ -651,7 +656,7 @@ func applyXFRMRule(ue_is_initiator bool, ifId uint32, childSecurityAssociation * func sendPduSessionEstablishmentRequest( pduSessionId uint8, ue *RanUeContext, - n3Info *context.N3IWFUe, + n3Info *N3IWFUe, ikeSA *context.IKESecurityAssociation, ikeConn *net.UDPConn, nasConn *net.TCPConn, @@ -909,7 +914,7 @@ func TestNon3GPPUE(t *testing.T) { } // Used to save IPsec/IKE related data - n3ue := new(context.N3IWFUe) + n3ue := new(N3IWFUe) n3ue.PduSessionList = make(map[int64]*context.PDUSession) n3ue.N3IWFChildSecurityAssociation = make(map[uint32]*context.ChildSecurityAssociation) n3ue.TemporaryExchangeMsgIDChildSAMapping = make(map[uint32]*context.ChildSecurityAssociation) diff --git a/test/ranUe.go b/test/ranUe.go index c8266d45..e6e8f478 100644 --- a/test/ranUe.go +++ b/test/ranUe.go @@ -306,7 +306,7 @@ func (ue *RanUeContext) DeriveResEAPMessageAndSetKey( s := append(prev, ap...) // Write Data to it - if _, err = h.Write(s); err != nil { + if _, err := h.Write(s); err != nil { fatal.Fatalf("EAP-AKA' prf error: %+v", err) } @@ -338,7 +338,7 @@ func (ue *RanUeContext) DeriveResEAPMessageAndSetKey( // calculate MAC h := hmac.New(sha256.New, Kaut) - if _, err = h.Write(resEAPMessage); err != nil { + if _, err := h.Write(resEAPMessage); err != nil { fatal.Fatalf("MAC calculate error: %+v", err) } sum := h.Sum(nil) diff --git a/test/registration_test.go b/test/registration_test.go index 19a75ef1..c30b796c 100644 --- a/test/registration_test.go +++ b/test/registration_test.go @@ -2,21 +2,25 @@ package test_test import ( "bytes" + "context" "encoding/base64" "encoding/binary" "encoding/hex" "fmt" "net" + "net/http" "os/exec" "strconv" "testing" "time" "test" + "test/consumerTestdata/PCF/TestPolicyAuthorization" "test/consumerTestdata/UDM/TestGenAuthData" "test/nasTestpacket" + "github.com/gin-gonic/gin" "github.com/mohae/deepcopy" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -30,7 +34,9 @@ import ( "github.com/free5gc/nas/security" "github.com/free5gc/ngap" "github.com/free5gc/ngap/ngapType" + "github.com/free5gc/openapi/Npcf_PolicyAuthorization" "github.com/free5gc/openapi/models" + "github.com/free5gc/util/httpwrapper" "github.com/free5gc/util/milenage" ) @@ -288,7 +294,7 @@ func TestDeregistration(t *testing.T) { var recvMsg = make([]byte, 2048) // RAN connect to AMF - conn, err := test.ConnectToAmf("127.0.0.1", "127.0.0.1", 38412, 9487) + conn, err := test.ConnectToAmf(amfN2Ipv4Addr, ranN2Ipv4Addr, 38412, 9487) assert.Nil(t, err) // send NGSetupRequest Msg @@ -493,7 +499,7 @@ func TestServiceRequest(t *testing.T) { var recvMsg = make([]byte, 2048) // RAN connect to AMF - conn, err := test.ConnectToAmf("127.0.0.1", "127.0.0.1", 38412, 9487) + conn, err := test.ConnectToAmf(amfN2Ipv4Addr, ranN2Ipv4Addr, 38412, 9487) assert.Nil(t, err) // send NGSetupRequest Msg @@ -682,7 +688,7 @@ func TestServiceRequest(t *testing.T) { // send NAS Service Request pdu = nasTestpacket.GetServiceRequest(nasMessage.ServiceTypeData) - pdu, err = test.EncodeNasPduWithSecurity(ue, pdu, nas.SecurityHeaderTypeIntegrityProtectedAndCiphered, true, false) + pdu, err = test.EncodeNasPduWithSecurity(ue, pdu, nas.SecurityHeaderTypeIntegrityProtected, true, false) assert.Nil(t, err) sendMsg, err = test.GetInitialUEMessage(ue.RanUeNgapId, pdu, "fe0000000001") assert.Nil(t, err) @@ -692,9 +698,13 @@ func TestServiceRequest(t *testing.T) { // receive Initial Context Setup Request n, err = conn.Read(recvMsg) assert.Nil(t, err) - _, err = ngap.Decoder(recvMsg[:n]) + ngapMsg, err = ngap.Decoder(recvMsg[:n]) assert.Nil(t, err) + // update AMF UE NGAP ID + ue.AmfUeNgapId = ngapMsg.InitiatingMessage. + Value.InitialContextSetupRequest.ProtocolIEs.List[0].Value.AMFUENGAPID.Value + // Send Initial Context Setup Response sendMsg, err = test.GetInitialContextSetupResponseForServiceRequest(ue.AmfUeNgapId, ue.RanUeNgapId, ranN3Ipv4Addr) assert.Nil(t, err) @@ -722,7 +732,7 @@ func TestGUTIRegistration(t *testing.T) { var recvMsg = make([]byte, 2048) // RAN connect to AMF - conn, err := test.ConnectToAmf("127.0.0.1", "127.0.0.1", 38412, 9487) + conn, err := test.ConnectToAmf(amfN2Ipv4Addr, ranN2Ipv4Addr, 38412, 9487) require.Nil(t, err) // send NGSetupRequest Msg @@ -934,6 +944,11 @@ func TestGUTIRegistration(t *testing.T) { require.Equal(t, nasPdu.GmmHeader.GetMessageType(), nas.MsgTypeIdentityRequest, "Received wrong GMM message. Expected Identity Request.") + // update AMF UE NGAP ID + ue.AmfUeNgapId = ngapMsg.InitiatingMessage. + Value.DownlinkNASTransport. + ProtocolIEs.List[0].Value.AMFUENGAPID.Value + // send NAS Identity Response mobileIdentity := nasType.MobileIdentity{ Len: SUCI5GS.Len, @@ -941,6 +956,7 @@ func TestGUTIRegistration(t *testing.T) { } pdu = nasTestpacket.GetIdentityResponse(mobileIdentity) require.Nil(t, err) + sendMsg, err = test.GetUplinkNASTransport(ue.AmfUeNgapId, ue.RanUeNgapId, pdu) require.Nil(t, err) _, err = conn.Write(sendMsg) @@ -1039,7 +1055,7 @@ func TestPDUSessionReleaseRequest(t *testing.T) { var recvMsg = make([]byte, 2048) // RAN connect to AMF - conn, err := test.ConnectToAmf("127.0.0.1", "127.0.0.1", 38412, 9487) + conn, err := test.ConnectToAmf(amfN2Ipv4Addr, ranN2Ipv4Addr, 38412, 9487) assert.Nil(t, err) // send NGSetupRequest Msg @@ -1246,6 +1262,239 @@ func TestPDUSessionReleaseRequest(t *testing.T) { NfTerminate() } +func TestPDUSessionReleaseAbnormal(t *testing.T) { + var n int + var sendMsg []byte + var recvMsg = make([]byte, 2048) + + // RAN connect to AMF + conn, err := test.ConnectToAmf(amfN2Ipv4Addr, ranN2Ipv4Addr, 38412, 9487) + assert.Nil(t, err) + + // send NGSetupRequest Msg + sendMsg, err = test.GetNGSetupRequest([]byte("\x00\x01\x02"), 24, "free5gc") + assert.Nil(t, err) + _, err = conn.Write(sendMsg) + assert.Nil(t, err) + + // receive NGSetupResponse Msg + n, err = conn.Read(recvMsg) + assert.Nil(t, err) + _, err = ngap.Decoder(recvMsg[:n]) + assert.Nil(t, err) + + // New UE + ue := test.NewRanUeContext("imsi-2089300007487", 1, security.AlgCiphering128NEA0, security.AlgIntegrity128NIA2, + models.AccessType__3_GPP_ACCESS) + ue.AmfUeNgapId = 1 + ue.AuthenticationSubs = test.GetAuthSubscription(TestGenAuthData.MilenageTestSet19.K, + TestGenAuthData.MilenageTestSet19.OPC, + TestGenAuthData.MilenageTestSet19.OP) + // insert UE data to MongoDB + + servingPlmnId := "20893" + test.InsertAuthSubscriptionToMongoDB(ue.Supi, ue.AuthenticationSubs) + getData := test.GetAuthSubscriptionFromMongoDB(ue.Supi) + assert.NotNil(t, getData) + { + amData := test.GetAccessAndMobilitySubscriptionData() + test.InsertAccessAndMobilitySubscriptionDataToMongoDB(ue.Supi, amData, servingPlmnId) + getData := test.GetAccessAndMobilitySubscriptionDataFromMongoDB(ue.Supi, servingPlmnId) + assert.NotNil(t, getData) + } + { + smfSelData := test.GetSmfSelectionSubscriptionData() + test.InsertSmfSelectionSubscriptionDataToMongoDB(ue.Supi, smfSelData, servingPlmnId) + getData := test.GetSmfSelectionSubscriptionDataFromMongoDB(ue.Supi, servingPlmnId) + assert.NotNil(t, getData) + } + { + smSelData := test.GetSessionManagementSubscriptionData() + test.InsertSessionManagementSubscriptionDataToMongoDB(ue.Supi, servingPlmnId, smSelData) + getData := test.GetSessionManagementDataFromMongoDB(ue.Supi, servingPlmnId) + assert.NotNil(t, getData) + } + { + amPolicyData := test.GetAmPolicyData() + test.InsertAmPolicyDataToMongoDB(ue.Supi, amPolicyData) + getData := test.GetAmPolicyDataFromMongoDB(ue.Supi) + assert.NotNil(t, getData) + } + { + smPolicyData := test.GetSmPolicyData() + test.InsertSmPolicyDataToMongoDB(ue.Supi, smPolicyData) + getData := test.GetSmPolicyDataFromMongoDB(ue.Supi) + assert.NotNil(t, getData) + } + + // send InitialUeMessage(Registration Request)(imsi-2089300007487) + mobileIdentity5GS := nasType.MobileIdentity5GS{ + Len: 12, // suci + Buffer: []uint8{0x01, 0x02, 0xf8, 0x39, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x78}, + } + ueSecurityCapability := ue.GetUESecurityCapability() + registrationRequest := nasTestpacket.GetRegistrationRequest( + nasMessage.RegistrationType5GSInitialRegistration, mobileIdentity5GS, nil, ueSecurityCapability, nil, nil, nil) + sendMsg, err = test.GetInitialUEMessage(ue.RanUeNgapId, registrationRequest, "") + assert.Nil(t, err) + _, err = conn.Write(sendMsg) + assert.Nil(t, err) + + // receive NAS Authentication Request Msg + n, err = conn.Read(recvMsg) + assert.Nil(t, err) + ngapMsg, err := ngap.Decoder(recvMsg[:n]) + assert.Nil(t, err) + + // Calculate for RES* + nasPdu := test.GetNasPdu(ue, ngapMsg.InitiatingMessage.Value.DownlinkNASTransport) + require.NotNil(t, nasPdu) + require.NotNil(t, nasPdu.GmmMessage, "GMM message is nil") + require.Equal(t, nasPdu.GmmHeader.GetMessageType(), nas.MsgTypeAuthenticationRequest, + "Received wrong GMM message. Expected Authentication Request.") + rand := nasPdu.AuthenticationRequest.GetRANDValue() + resStat := ue.DeriveRESstarAndSetKey(ue.AuthenticationSubs, rand[:], "5G:mnc093.mcc208.3gppnetwork.org") + + // send NAS Authentication Response + pdu := nasTestpacket.GetAuthenticationResponse(resStat, "") + sendMsg, err = test.GetUplinkNASTransport(ue.AmfUeNgapId, ue.RanUeNgapId, pdu) + assert.Nil(t, err) + _, err = conn.Write(sendMsg) + assert.Nil(t, err) + + // receive NAS Security Mode Command Msg + n, err = conn.Read(recvMsg) + assert.Nil(t, err) + ngapPdu, err := ngap.Decoder(recvMsg[:n]) + require.Nil(t, err) + require.NotNil(t, ngapPdu) + nasPdu = test.GetNasPdu(ue, ngapPdu.InitiatingMessage.Value.DownlinkNASTransport) + require.NotNil(t, nasPdu) + require.NotNil(t, nasPdu.GmmMessage, "GMM message is nil") + require.Equal(t, nasPdu.GmmHeader.GetMessageType(), nas.MsgTypeSecurityModeCommand, + "Received wrong GMM message. Expected Security Mode Command.") + + // send NAS Security Mode Complete Msg + registrationRequestWith5GMM := nasTestpacket.GetRegistrationRequest(nasMessage.RegistrationType5GSInitialRegistration, + mobileIdentity5GS, nil, ueSecurityCapability, ue.Get5GMMCapability(), nil, nil) + pdu = nasTestpacket.GetSecurityModeComplete(registrationRequestWith5GMM) + pdu, err = test.EncodeNasPduWithSecurity(ue, pdu, nas.SecurityHeaderTypeIntegrityProtectedAndCipheredWithNew5gNasSecurityContext, true, true) + assert.Nil(t, err) + sendMsg, err = test.GetUplinkNASTransport(ue.AmfUeNgapId, ue.RanUeNgapId, pdu) + assert.Nil(t, err) + _, err = conn.Write(sendMsg) + assert.Nil(t, err) + + // receive ngap Initial Context Setup Request Msg + n, err = conn.Read(recvMsg) + assert.Nil(t, err) + _, err = ngap.Decoder(recvMsg[:n]) + assert.Nil(t, err) + + // send ngap Initial Context Setup Response Msg + sendMsg, err = test.GetInitialContextSetupResponse(ue.AmfUeNgapId, ue.RanUeNgapId) + assert.Nil(t, err) + _, err = conn.Write(sendMsg) + assert.Nil(t, err) + + // send NAS Registration Complete Msg + pdu = nasTestpacket.GetRegistrationComplete(nil) + pdu, err = test.EncodeNasPduWithSecurity(ue, pdu, nas.SecurityHeaderTypeIntegrityProtectedAndCiphered, true, false) + assert.Nil(t, err) + sendMsg, err = test.GetUplinkNASTransport(ue.AmfUeNgapId, ue.RanUeNgapId, pdu) + assert.Nil(t, err) + _, err = conn.Write(sendMsg) + assert.Nil(t, err) + + // send PduSessionEstablishmentRequest Msg + + sNssai := models.Snssai{ + Sst: 1, + Sd: "010203", + } + pdu = nasTestpacket.GetUlNasTransport_PduSessionEstablishmentRequest(10, nasMessage.ULNASTransportRequestTypeInitialRequest, "internet", &sNssai) + pdu, err = test.EncodeNasPduWithSecurity(ue, pdu, nas.SecurityHeaderTypeIntegrityProtectedAndCiphered, true, false) + assert.Nil(t, err) + sendMsg, err = test.GetUplinkNASTransport(ue.AmfUeNgapId, ue.RanUeNgapId, pdu) + assert.Nil(t, err) + _, err = conn.Write(sendMsg) + assert.Nil(t, err) + + // receive 12. NGAP-PDU Session Resource Setup Request(DL nas transport((NAS msg-PDU session setup Accept))) + n, err = conn.Read(recvMsg) + assert.Nil(t, err) + _, err = ngap.Decoder(recvMsg[:n]) + assert.Nil(t, err) + + // send 14. NGAP-PDU Session Resource Setup Response + sendMsg, err = test.GetPDUSessionResourceSetupResponse(10, ue.AmfUeNgapId, ue.RanUeNgapId, ranN3Ipv4Addr) + assert.Nil(t, err) + _, err = conn.Write(sendMsg) + assert.Nil(t, err) + + // Send Pdu Session Release Request + pdu = nasTestpacket.GetUlNasTransport_PduSessionReleaseRequest(10) + pdu, err = test.EncodeNasPduWithSecurity(ue, pdu, nas.SecurityHeaderTypeIntegrityProtectedAndCiphered, true, false) + assert.Nil(t, err) + sendMsg, err = test.GetUplinkNASTransport(ue.AmfUeNgapId, ue.RanUeNgapId, pdu) + assert.Nil(t, err) + _, err = conn.Write(sendMsg) + assert.Nil(t, err) + + // receive PDU Session Resource Release Command + n, err = conn.Read(recvMsg) + assert.Nil(t, err) + _, err = ngap.Decoder(recvMsg[:n]) + assert.Nil(t, err) + + time.Sleep(1000 * time.Millisecond) + // send N2 Resource Release Ack(PDUSession Resource Release Response) + sendMsg, err = test.GetPDUSessionResourceReleaseResponse(ue.AmfUeNgapId, ue.RanUeNgapId) + assert.Nil(t, err) + _, err = conn.Write(sendMsg) + assert.Nil(t, err) + + // send ngap UE Context Release Request + pduSessionIDList := []int64{10} + sendMsg, err = test.GetUEContextReleaseRequest(ue.AmfUeNgapId, ue.RanUeNgapId, pduSessionIDList) + assert.Nil(t, err) + _, err = conn.Write(sendMsg) + assert.Nil(t, err) + + // receive UE Context Release Command + n, err = conn.Read(recvMsg) + assert.Nil(t, err) + _, err = ngap.Decoder(recvMsg[:n]) + assert.Nil(t, err) + + // send ngap UE Context Release Complete + sendMsg, err = test.GetUEContextReleaseComplete(ue.AmfUeNgapId, ue.RanUeNgapId, nil) + assert.Nil(t, err) + _, err = conn.Write(sendMsg) + assert.Nil(t, err) + + // Just test registration no occur panic + // send InitialUeMessage(Registration Request)(imsi-2089300007487) + sendMsg, err = test.GetInitialUEMessage(ue.RanUeNgapId, registrationRequest, "") + assert.Nil(t, err) + _, err = conn.Write(sendMsg) + assert.Nil(t, err) + + // wait result + time.Sleep(2 * time.Second) + + // delete test data + test.DelAuthSubscriptionToMongoDB(ue.Supi) + test.DelAccessAndMobilitySubscriptionDataFromMongoDB(ue.Supi, servingPlmnId) + test.DelSmfSelectionSubscriptionDataFromMongoDB(ue.Supi, servingPlmnId) + + // close Connection + conn.Close() + + // terminate all NF + NfTerminate() +} + // Registration -> Pdu Session Establishment -> Path Switch(Xn Handover) func TestXnHandover(t *testing.T) { var n int @@ -1253,7 +1502,7 @@ func TestXnHandover(t *testing.T) { var recvMsg = make([]byte, 2048) // RAN connect to AMF - conn, err := test.ConnectToAmf("127.0.0.1", "127.0.0.1", 38412, 9487) + conn, err := test.ConnectToAmf(amfN2Ipv4Addr, ranN2Ipv4Addr, 38412, 9487) assert.Nil(t, err) // send NGSetupRequest Msg @@ -1270,7 +1519,7 @@ func TestXnHandover(t *testing.T) { time.Sleep(10 * time.Millisecond) - conn2, err1 := test.ConnectToAmf("127.0.0.1", "127.0.0.1", 38412, 9488) + conn2, err1 := test.ConnectToAmf(amfN2Ipv4Addr, ranN2Ipv4Addr, 38412, 9488) assert.Nil(t, err1) // send Second NGSetupRequest Msg @@ -1469,7 +1718,7 @@ func TestPaging(t *testing.T) { var recvMsg = make([]byte, 2048) // RAN connect to AMFcd - conn, err := test.ConnectToAmf("127.0.0.1", "127.0.0.1", 38412, 9487) + conn, err := test.ConnectToAmf(amfN2Ipv4Addr, ranN2Ipv4Addr, 38412, 9487) assert.Nil(t, err) // send NGSetupRequest Msg @@ -1681,7 +1930,7 @@ func TestPaging(t *testing.T) { // send NAS Service Request pdu = nasTestpacket.GetServiceRequest(nasMessage.ServiceTypeMobileTerminatedServices) - pdu, err = test.EncodeNasPduWithSecurity(ue, pdu, nas.SecurityHeaderTypeIntegrityProtectedAndCiphered, true, false) + pdu, err = test.EncodeNasPduWithSecurity(ue, pdu, nas.SecurityHeaderTypeIntegrityProtected, true, false) assert.Nil(t, err) sendMsg, err = test.GetInitialUEMessage(ue.RanUeNgapId, pdu, "fe0000000001") assert.Nil(t, err) @@ -1691,9 +1940,13 @@ func TestPaging(t *testing.T) { // receive Initial Context Setup Request n, err = conn.Read(recvMsg) assert.Nil(t, err) - _, err = ngap.Decoder(recvMsg[:n]) + ngapMsg, err = ngap.Decoder(recvMsg[:n]) assert.Nil(t, err) + // update AMF UE NGAP ID + ue.AmfUeNgapId = ngapMsg.InitiatingMessage. + Value.InitialContextSetupRequest.ProtocolIEs.List[0].Value.AMFUENGAPID.Value + //send Initial Context Setup Response sendMsg, err = test.GetInitialContextSetupResponseForServiceRequest(ue.AmfUeNgapId, ue.RanUeNgapId, ranN3Ipv4Addr) assert.Nil(t, err) @@ -1720,7 +1973,7 @@ func TestN2Handover(t *testing.T) { var recvMsg = make([]byte, 2048) // RAN1 connect to AMF - conn, err := test.ConnectToAmf("127.0.0.1", "127.0.0.1", 38412, 9487) + conn, err := test.ConnectToAmf(amfN2Ipv4Addr, ranN2Ipv4Addr, 38412, 9487) assert.Nil(t, err) // RAN1 connect to UPF @@ -1742,7 +1995,7 @@ func TestN2Handover(t *testing.T) { time.Sleep(10 * time.Millisecond) // RAN2 connect to AMF - conn2, err1 := test.ConnectToAmf("127.0.0.1", "127.0.0.1", 38412, 9488) + conn2, err1 := test.ConnectToAmf(amfN2Ipv4Addr, ranN2Ipv4Addr, 38412, 9488) assert.Nil(t, err1) // RAN2 connect to UPF @@ -2077,7 +2330,7 @@ func TestDuplicateRegistration(t *testing.T) { var recvMsg = make([]byte, 2048) // RAN connect to AMF - conn, err := test.ConnectToAmf("127.0.0.1", "127.0.0.1", 38412, 9487) + conn, err := test.ConnectToAmf(amfN2Ipv4Addr, ranN2Ipv4Addr, 38412, 9487) assert.Nil(t, err) // RAN connect to UPF @@ -2329,13 +2582,227 @@ func TestDuplicateRegistration(t *testing.T) { NfTerminate() } -func TestReSynchronization(t *testing.T) { +func TestAFInfluenceOnTrafficRouting(t *testing.T) { var n int var sendMsg []byte var recvMsg = make([]byte, 2048) + // fake AF + go func() { + router := gin.Default() + router.POST("nnef-callback/v1/traffic-influence/:appID", func(c *gin.Context) { + c.Status(http.StatusOK) + }) + router.POST("nnef-callback/v1/applications/:appID/terminate", func(c *gin.Context) { + c.Status(http.StatusNoContent) + }) + + server, err := httpwrapper.NewHttp2Server("127.0.0.100:8000", "", router) + if err == nil && server != nil { + err = server.ListenAndServe() + } + assert.True(t, err == nil) + }() + // RAN connect to AMF - conn, err := test.ConnectToAmf("127.0.0.1", "127.0.0.1", 38412, 9487) + conn, err := test.ConnectToAmf(amfN2Ipv4Addr, ranN2Ipv4Addr, 38412, 9487) + assert.Nil(t, err) + + // send NGSetupRequest Msg + sendMsg, err = test.GetNGSetupRequest([]byte("\x00\x01\x02"), 24, "free5gc") + assert.Nil(t, err) + _, err = conn.Write(sendMsg) + assert.Nil(t, err) + + // receive NGSetupResponse Msg + n, err = conn.Read(recvMsg) + assert.Nil(t, err) + _, err = ngap.Decoder(recvMsg[:n]) + assert.Nil(t, err) + + // New UE + ue := test.NewRanUeContext("imsi-2089300007487", 1, security.AlgCiphering128NEA0, security.AlgIntegrity128NIA2, + models.AccessType__3_GPP_ACCESS) + // ue := test.NewRanUeContext("imsi-2089300007487", 1, security.AlgCiphering128NEA0, security.AlgIntegrity128NIA0, models.AccessType__3_GPP_ACCESS) + ue.AmfUeNgapId = 1 + ue.AuthenticationSubs = test.GetAuthSubscription(TestGenAuthData.MilenageTestSet19.K, + TestGenAuthData.MilenageTestSet19.OPC, + TestGenAuthData.MilenageTestSet19.OP) + // insert UE data to MongoDB + + servingPlmnId := "20893" + test.InsertAuthSubscriptionToMongoDB(ue.Supi, ue.AuthenticationSubs) + getData := test.GetAuthSubscriptionFromMongoDB(ue.Supi) + assert.NotNil(t, getData) + { + amData := test.GetAccessAndMobilitySubscriptionData() + test.InsertAccessAndMobilitySubscriptionDataToMongoDB(ue.Supi, amData, servingPlmnId) + getData := test.GetAccessAndMobilitySubscriptionDataFromMongoDB(ue.Supi, servingPlmnId) + assert.NotNil(t, getData) + } + { + smfSelData := test.GetSmfSelectionSubscriptionData() + test.InsertSmfSelectionSubscriptionDataToMongoDB(ue.Supi, smfSelData, servingPlmnId) + getData := test.GetSmfSelectionSubscriptionDataFromMongoDB(ue.Supi, servingPlmnId) + assert.NotNil(t, getData) + } + { + smSelData := test.GetSessionManagementSubscriptionData() + test.InsertSessionManagementSubscriptionDataToMongoDB(ue.Supi, servingPlmnId, smSelData) + getData := test.GetSessionManagementDataFromMongoDB(ue.Supi, servingPlmnId) + assert.NotNil(t, getData) + } + { + amPolicyData := test.GetAmPolicyData() + test.InsertAmPolicyDataToMongoDB(ue.Supi, amPolicyData) + getData := test.GetAmPolicyDataFromMongoDB(ue.Supi) + assert.NotNil(t, getData) + } + { + smPolicyData := test.GetSmPolicyData() + test.InsertSmPolicyDataToMongoDB(ue.Supi, smPolicyData) + getData := test.GetSmPolicyDataFromMongoDB(ue.Supi) + assert.NotNil(t, getData) + } + + // send InitialUeMessage(Registration Request)(imsi-2089300007487) + mobileIdentity5GS := nasType.MobileIdentity5GS{ + Len: 12, // suci + Buffer: []uint8{0x01, 0x02, 0xf8, 0x39, 0xf0, 0xff, 0x00, 0x00, 0x00, 0x00, 0x47, 0x78}, + } + ueSecurityCapability := ue.GetUESecurityCapability() + registrationRequest := nasTestpacket.GetRegistrationRequest( + nasMessage.RegistrationType5GSInitialRegistration, mobileIdentity5GS, nil, ueSecurityCapability, nil, nil, nil) + sendMsg, err = test.GetInitialUEMessage(ue.RanUeNgapId, registrationRequest, "") + assert.Nil(t, err) + _, err = conn.Write(sendMsg) + assert.Nil(t, err) + + // receive NAS Authentication Request Msg + n, err = conn.Read(recvMsg) + assert.Nil(t, err) + ngapMsg, err := ngap.Decoder(recvMsg[:n]) + assert.Nil(t, err) + + // Calculate for RES* + nasPdu := test.GetNasPdu(ue, ngapMsg.InitiatingMessage.Value.DownlinkNASTransport) + require.NotNil(t, nasPdu) + require.NotNil(t, nasPdu.GmmMessage, "GMM message is nil") + require.Equal(t, nasPdu.GmmHeader.GetMessageType(), nas.MsgTypeAuthenticationRequest, + "Received wrong GMM message. Expected Authentication Request.") + rand := nasPdu.AuthenticationRequest.GetRANDValue() + resStat := ue.DeriveRESstarAndSetKey(ue.AuthenticationSubs, rand[:], "5G:mnc093.mcc208.3gppnetwork.org") + + // send NAS Authentication Response + pdu := nasTestpacket.GetAuthenticationResponse(resStat, "") + sendMsg, err = test.GetUplinkNASTransport(ue.AmfUeNgapId, ue.RanUeNgapId, pdu) + assert.Nil(t, err) + _, err = conn.Write(sendMsg) + assert.Nil(t, err) + + // receive NAS Security Mode Command Msg + n, err = conn.Read(recvMsg) + assert.Nil(t, err) + ngapPdu, err := ngap.Decoder(recvMsg[:n]) + require.Nil(t, err) + require.NotNil(t, ngapPdu) + nasPdu = test.GetNasPdu(ue, ngapPdu.InitiatingMessage.Value.DownlinkNASTransport) + require.NotNil(t, nasPdu) + require.NotNil(t, nasPdu.GmmMessage, "GMM message is nil") + require.Equal(t, nasPdu.GmmHeader.GetMessageType(), nas.MsgTypeSecurityModeCommand, + "Received wrong GMM message. Expected Security Mode Command.") + + // send NAS Security Mode Complete Msg + registrationRequestWith5GMM := nasTestpacket.GetRegistrationRequest(nasMessage.RegistrationType5GSInitialRegistration, + mobileIdentity5GS, nil, ueSecurityCapability, ue.Get5GMMCapability(), nil, nil) + pdu = nasTestpacket.GetSecurityModeComplete(registrationRequestWith5GMM) + pdu, err = test.EncodeNasPduWithSecurity(ue, pdu, nas.SecurityHeaderTypeIntegrityProtectedAndCipheredWithNew5gNasSecurityContext, true, true) + assert.Nil(t, err) + sendMsg, err = test.GetUplinkNASTransport(ue.AmfUeNgapId, ue.RanUeNgapId, pdu) + assert.Nil(t, err) + _, err = conn.Write(sendMsg) + assert.Nil(t, err) + + // receive ngap Initial Context Setup Request Msg + n, err = conn.Read(recvMsg) + assert.Nil(t, err) + _, err = ngap.Decoder(recvMsg[:n]) + assert.Nil(t, err) + + // send ngap Initial Context Setup Response Msg + sendMsg, err = test.GetInitialContextSetupResponse(ue.AmfUeNgapId, ue.RanUeNgapId) + assert.Nil(t, err) + _, err = conn.Write(sendMsg) + assert.Nil(t, err) + + // send NAS Registration Complete Msg + pdu = nasTestpacket.GetRegistrationComplete(nil) + pdu, err = test.EncodeNasPduWithSecurity(ue, pdu, nas.SecurityHeaderTypeIntegrityProtectedAndCiphered, true, false) + assert.Nil(t, err) + sendMsg, err = test.GetUplinkNASTransport(ue.AmfUeNgapId, ue.RanUeNgapId, pdu) + assert.Nil(t, err) + _, err = conn.Write(sendMsg) + assert.Nil(t, err) + + time.Sleep(100 * time.Millisecond) + // send GetPduSessionEstablishmentRequest Msg + + pdu = nasTestpacket.GetUlNasTransport_PduSessionEstablishmentRequest(10, nasMessage.ULNASTransportRequestTypeInitialRequest, "internet", + &models.Snssai{Sst: 1, Sd: "010203"}) + pdu, err = test.EncodeNasPduWithSecurity(ue, pdu, nas.SecurityHeaderTypeIntegrityProtectedAndCiphered, true, false) + assert.Nil(t, err) + sendMsg, err = test.GetUplinkNASTransport(ue.AmfUeNgapId, ue.RanUeNgapId, pdu) + assert.Nil(t, err) + _, err = conn.Write(sendMsg) + assert.Nil(t, err) + + // receive 12. NGAP-PDU Session Resource Setup Request(DL nas transport((NAS msg-PDU session setup Accept))) + n, err = conn.Read(recvMsg) + assert.Nil(t, err) + _, err = ngap.Decoder(recvMsg[:n]) + assert.Nil(t, err) + + // send 14. NGAP-PDU Session Resource Setup Response + sendMsg, err = test.GetPDUSessionResourceSetupResponse(10, ue.AmfUeNgapId, ue.RanUeNgapId, ranN3Ipv4Addr) + assert.Nil(t, err) + _, err = conn.Write(sendMsg) + assert.Nil(t, err) + + // wait 1s + time.Sleep(1 * time.Second) + + // Send the dummy packet + + cfg := Npcf_PolicyAuthorization.NewConfiguration() + cfg.SetBasePath("http://127.0.0.7:8000") + client := Npcf_PolicyAuthorization.NewAPIClient(cfg) + + appSessCtx := TestPolicyAuthorization.GetPostAppSessionsData_AFInfluenceOnTrafficRouting() + + _, _, err = client.ApplicationSessionsCollectionApi.PostAppSessions(context.Background(), appSessCtx) + assert.Nil(t, err, "PolicyAuthorize failed") + + time.Sleep(1 * time.Second) + + // delete test data + test.DelAuthSubscriptionToMongoDB(ue.Supi) + test.DelAccessAndMobilitySubscriptionDataFromMongoDB(ue.Supi, servingPlmnId) + test.DelSmfSelectionSubscriptionDataFromMongoDB(ue.Supi, servingPlmnId) + + // close Connection + conn.Close() + + // terminate all NF + NfTerminate() +} + +func TestReSynchronisation(t *testing.T) { + var n int + var sendMsg []byte + var recvMsg = make([]byte, 2048) + + // RAN connect to AMF + conn, err := test.ConnectToAmf(amfN2Ipv4Addr, ranN2Ipv4Addr, 38412, 9487) assert.Nil(t, err) // RAN connect to UPF @@ -2652,7 +3119,7 @@ func TestRequestTwoPDUSessions(t *testing.T) { var recvMsg = make([]byte, 2048) // RAN connect to AMF - conn, err := test.ConnectToAmf("127.0.0.1", "127.0.0.1", 38412, 9487) + conn, err := test.ConnectToAmf(amfN2Ipv4Addr, ranN2Ipv4Addr, 38412, 9487) assert.Nil(t, err) // RAN connect to UPF @@ -3171,7 +3638,7 @@ func TestEAPAKAPrimeAuthentication(t *testing.T) { time.Sleep(1 * time.Second) // Send the dummy packet - // ping IP(tunnel IP) from 10.60.0.2(127.0.0.1) to 10.60.0.20(127.0.0.8) + // ping IP(tunnel IP) from 60.60.0.2(127.0.0.1) to 60.60.0.20(127.0.0.8) gtpHdr, err := hex.DecodeString("32ff00340000000100000000") assert.Nil(t, err) icmpData, err := hex.DecodeString("8c870d0000000000101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f3031323334353637") @@ -3184,8 +3651,8 @@ func TestEAPAKAPrimeAuthentication(t *testing.T) { Flags: 0, TotalLen: 48, TTL: 64, - Src: net.ParseIP("10.60.0.1").To4(), - Dst: net.ParseIP("10.60.0.101").To4(), + Src: net.ParseIP("60.60.0.1").To4(), + Dst: net.ParseIP("60.60.0.101").To4(), ID: 1, } checksum := test.CalculateIpv4HeaderChecksum(&ipv4hdr) diff --git a/test/ueRanEmulator/main.go b/test/ueRanEmulator/main.go index 3356b1f6..844d02dc 100644 --- a/test/ueRanEmulator/main.go +++ b/test/ueRanEmulator/main.go @@ -9,11 +9,12 @@ import ( "strings" "time" + "test" + "test/nasTestpacket" + "github.com/calee0219/fatal" "github.com/urfave/cli" "gopkg.in/yaml.v2" - "test" - "test/nasTestpacket" "github.com/free5gc/nas" "github.com/free5gc/nas/nasMessage" diff --git a/test/ulclsession_test.go b/test/ulclsession_test.go index bdf515e7..46a3ed48 100644 --- a/test/ulclsession_test.go +++ b/test/ulclsession_test.go @@ -1,6 +1,7 @@ package test_test import ( + "flag" "fmt" "os" "os/exec" @@ -15,6 +16,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + // ausf_context "github.com/free5gc/ausf/context" "github.com/free5gc/nas" "github.com/free5gc/nas/nasMessage" "github.com/free5gc/nas/nasType" @@ -24,8 +26,11 @@ import ( "github.com/free5gc/openapi/models" ) +var ueCount = flag.Int("ueCount", 1, "Number of ue") +var upfNum = flag.Int("upfNum", 1, "Number of upf") + func TestULCLAndMultiUPF(t *testing.T) { - testULCLSessionBase(t, 4, 6) + testULCLSessionBase(t, *ueCount, *upfNum) } func testULCLSessionBase(t *testing.T, ueCount int, upfNum int) { @@ -227,7 +232,7 @@ func testULCLSessionBase(t *testing.T, ueCount int, upfNum int) { // check PDR and FAR start(For ULCL) dir, _ := os.Getwd() - cmdPath := dir + "/../go-gtp5gnl/bin/" + cmdPath := dir + "/go-gtp5gnl/bin/" gtp5gTunnelCmdPath := filepath.Clean(cmdPath) for ns_num := 1; ns_num < upfNum+1; ns_num++ { diff --git a/webconsole b/webconsole index 69864fe6..2b9cc4c3 160000 --- a/webconsole +++ b/webconsole @@ -1 +1 @@ -Subproject commit 69864fe682f4d92056ee2714336472612c6955d6 +Subproject commit 2b9cc4c30e7b57a56135a8b874e7b3019db1bf67