Skip to content

Commit

Permalink
modify Makefile, run.sh, config & add CHF to GitHub workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
brianchennn committed Sep 1, 2023
1 parent 74585ff commit e587401
Show file tree
Hide file tree
Showing 7 changed files with 104 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/dispatch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ on:
description: 'NF patch'
required: false
type: string
chf_patch:
description: 'NF patch'
required: false
type: string
jobs:
build:
runs-on: [self-hosted, linux, x64]
Expand Down Expand Up @@ -82,6 +86,7 @@ jobs:
AUSF_PATCH: ${{ inputs.ausf_patch }}
N3IWF_PATCH: ${{ inputs.n3iwf_patch }}
PCF_PATCH: ${{ inputs.pcf_patch }}
CHF_PATCH: ${{ inputs.chf_patch }}

- name: Basic Test
run: |
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ C_BUILD_PATH = build
ROOT_PATH = $(shell pwd)

NF = $(GO_NF)
GO_NF = amf ausf nrf nssf pcf smf udm udr n3iwf upf
GO_NF = amf ausf nrf nssf pcf smf udm udr n3iwf upf chf

WEBCONSOLE = webconsole

Expand Down
27 changes: 27 additions & 0 deletions cert/chf.key
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
-----BEGIN RSA PRIVATE KEY-----
MIIEpAIBAAKCAQEAvrAD943EXFG1sWQYv4HzMWAsZdvypE+taRGaFB4IoqPpPKLj
gJN6wsHE16ehisixMXLwTNmuaiT6BAWDLKSuLTAJENB/3wX89Ga3KGEo9BKOVy0j
lU3PZDfGS6Crc1I2xyT5cwtZe85h941XtPCkuSyIO2ZDz2uT5cOj/Hm1gLeZqEXC
+6fly7K87DUrosOXAVxRtMhyYENeTGQPZV9Wcwqqi3f+01kVhESmT3hTw4u5f/nn
+Isx99uZwsHBlkmiUC9prgef9jdN1+GwfUKptTDPPzKNMn/aG7glKs9VnI3pcgha
WoUENMkhSOw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ThstL+r6FF2U
0gPvywKBgQDOHgczHI+G8pgivzC2W6OUvImm7DEFKZw2ZRNFSqq0/ksWfUnYIUaf
KyNhKOCmCqYSZr6ivX47dO9G2x8OM5u95paY8ysOB+mlx/yrXKI8B4ZMax3xaVMq
QDwiWcsGN6VUvyWITyDDsoUgWK7sPsVcoJgvVKduz/VRkPZk2YNGyA==
-----END RSA PRIVATE KEY-----
20 changes: 20 additions & 0 deletions cert/chf.pem
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
-----BEGIN CERTIFICATE-----
MIIDSDCCAjACCQDQLErVY/eE8DANBgkqhkiG9w0BAQsFADBmMQswCQYDVQQGEwJU
VzEPMA0GA1UECAwGVGFpd2FuMQ8wDQYDVQQHDAZUYWlwZWkxDTALBgNVBAoMBE5U
Q1UxDDAKBgNVBAsMA0lPVDEYMBYGA1UEAwwPd3d3Lm50Y3UuZWR1LnR3MB4XDTE5
MDcyMzAzMjcwM1oXDTI5MDcyMDAzMjcwM1owZjELMAkGA1UEBhMCVFcxDzANBgNV
BAgMBlRhaXdhbjEPMA0GA1UEBwwGVGFpcGVpMQ0wCwYDVQQKDAROVENVMQwwCgYD
VQQLDANJT1QxGDAWBgNVBAMMD3d3dy5udGN1LmVkdS50dzCCASIwDQYJKoZIhvcN
AQEBBQADggEPADCCAQoCggEBAL6wA/eNxFxRtbFkGL+B8zFgLGXb8qRPrWkRmhQe
CKKj6Tyi44CTesLBxNenoYrIsTFy8EzZrmok+gQFgyykri0wCRDQf98F/PRmtyhh
KPQSjlctI5VNz2Q3xkugq3NSNsck+XMLWXvOYfeNV7TwpLksiDtmQ89rk+XDo/x5
tYC3mahFwvun5cuyvOw1K6LDlwFcUbTIcmBDXkxkD2VfVnMKqot3/tNZFYREpk94
U8OLuX/55/iLMffbmcLBwZZJolAvaa4Hn/Y3TdfhsH1CqbUwzz8yjTJ/2hu4JSrP
VZyN6XIIWlqFBDTJIUjsCL33jz39Txd+chCuX3Zth38QjU0CAwEAATANBgkqhkiG
9w0BAQsFAAOCAQEABtO5Re3ekkXGgBGDBBxBzfIV9H19s4xi3sIhav8d20uaT0lK
rYlYIFH4U7yi2eIs60OWDa5kATrOtTeE3Q9hQ4zZMq8xlerz8w/muRS/1AcjI6y0
MXQIiv+RVNeWrWSwaOXPDjOXIP1QjG8WEddJg4DMu4copGSmLlv+ETYRuE6OklgU
YUgu+Fo+73UAL8LMQFwXNpfvtkvwWLEZhPvkbMgnTY/1da+BIX0nJqkKxy2E5xYf
gRMPsd6DdcQ1yHc/b90G0X3VRSaUgW97SPoEn+LFuQMJ0aIN7o5O+GW74yUfyxMo
VVF59Dz6FUAk+PupYWvjsh2tL92R/tdykSlDVw==
-----END CERTIFICATE-----
49 changes: 49 additions & 0 deletions config/chfcfg.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
info:
version: 1.0.3
description: CHF initial local configuration

configuration:
chfName: CHF # the name of this CHF
sbi: # Service-based interface information
scheme: http # the protocol for sbi (http or https)
registerIPv4: 127.0.0.113 # IP used to register to NRF
bindingIPv4: 127.0.0.113 # IP used to bind the service
port: 8000 # port used to bind the service
tls: # the local path of TLS key
pem: cert/chf.pem # CHF TLS Certificate
key: cert/chf.key # CHF TLS Private key
nrfUri: http://127.0.0.10:8000 # a valid URI of NRF
serviceNameList: # the SBI services provided by this CHF, refer to TS 32.291
- nchf-convergedcharging # Nchf_AMPolicyControl service
mongodb: # the mongodb connected by this CHF
name: free5gc # name of the mongodb
url: mongodb://localhost:27017 # a valid URL of the mongodb
quotaValidityTime: 10000
volumeLimit: 50000
volumeLimitPDU: 10000
volumeThresholdRate: 0.8
cgf:
hostIPv4: 127.0.0.1
port: 2122
listenPort: 2121
tls:
pem: cert/chf.pem
key: cert/chf.key
abmfDiameter:
protocol: tcp
hostIPv4: 127.0.0.113
port: 3868
tls:
pem: cert/chf.pem
key: cert/chf.key
rfDiameter:
protocol: tcp
hostIPv4: 127.0.0.113
port: 3869
tls:
pem: cert/chf.pem # CHF TLS Certificate
key: cert/chf.key # CHF TLS Private key
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
2 changes: 1 addition & 1 deletion run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ mongo --eval "db.NfProfile.drop();db.applicationData.influenceData.subsToNotify.
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"
NF_LIST="nrf amf smf udr pcf udm nssf ausf chf"

export GIN_MODE=release

Expand Down
2 changes: 1 addition & 1 deletion test/ulclsession_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func testULCLSessionBase(t *testing.T, ueCount int, upfNum int) {
servingPlmnId := "20893"
sNssai := models.Snssai{
Sst: 1,
Sd: "010203",
Sd: "112233",
}

for i := 0; i < ueCount; i++ {
Expand Down

0 comments on commit e587401

Please sign in to comment.