From a484329ee6d7e1bdec7e62e9754af0ef8b733dc7 Mon Sep 17 00:00:00 2001 From: gatici Date: Tue, 6 Aug 2024 10:28:52 +0300 Subject: [PATCH] Rearrange the log messages to start with lower case letters Signed-off-by: gatici --- nrfcache/match_filters.go | 17 +++++++++-------- nrfcache/nrfcache.go | 7 +++---- nrfcache/nrfcache_test.go | 22 +++++++++++----------- 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/nrfcache/match_filters.go b/nrfcache/match_filters.go index f28745c..b369a63 100644 --- a/nrfcache/match_filters.go +++ b/nrfcache/match_filters.go @@ -61,6 +61,7 @@ func MatchSmfProfile(profile *models.NfProfile, opts *Nnrf_NFDiscovery.SearchNFI var snssai models.Snssai err := json.Unmarshal([]byte(reqSnssai), &snssai) if err != nil { + fmt.Printf("error Unmarshaling nssai : %+v", err) return false, err } @@ -112,7 +113,7 @@ func MatchSmfProfile(profile *models.NfProfile, opts *Nnrf_NFDiscovery.SearchNFI return false, nil } } - fmt.Printf("SMF match found, nfInstance Id %v", profile.NfInstanceId) + fmt.Printf("smf match found, nfInstance Id %v", profile.NfInstanceId) return true, nil } @@ -142,12 +143,12 @@ func MatchAusfProfile(profile *models.NfProfile, opts *Nnrf_NFDiscovery.SearchNF matchFound = MatchSupiRange(opts.Supi.Value(), profile.AusfInfo.SupiRanges) } } - fmt.Printf("Ausf match found = %v", matchFound) + fmt.Printf("ausf match found = %v", matchFound) return matchFound, nil } func MatchNssfProfile(profile *models.NfProfile, opts *Nnrf_NFDiscovery.SearchNFInstancesParamOpts) (bool, error) { - fmt.Println("Nssf match found ") + fmt.Println("nssf match found ") return true, nil } @@ -163,7 +164,7 @@ func MatchAmfProfile(profile *models.NfProfile, opts *Nnrf_NFDiscovery.SearchNFI err := json.Unmarshal([]byte(targetPlmn), &plmn) if err != nil { - fmt.Printf("Error Unmarshaling plmn : %+v", err) + fmt.Printf("error Unmarshaling plmn : %+v", err) return false, err } @@ -191,7 +192,7 @@ func MatchAmfProfile(profile *models.NfProfile, opts *Nnrf_NFDiscovery.SearchNFI err := json.Unmarshal([]byte(guami), &guamiOpt) if err != nil { - fmt.Printf("Error Unmarshaling guami : %+v", err) + fmt.Printf("error Unmarshaling guami : %+v", err) return false, err } @@ -232,7 +233,7 @@ func MatchAmfProfile(profile *models.NfProfile, opts *Nnrf_NFDiscovery.SearchNFI } } } - fmt.Printf("Amf match found = %v", profile.NfInstanceId) + fmt.Printf("amf match found = %v", profile.NfInstanceId) return true, nil } @@ -243,7 +244,7 @@ func MatchPcfProfile(profile *models.NfProfile, opts *Nnrf_NFDiscovery.SearchNFI matchFound = MatchSupiRange(opts.Supi.Value(), profile.PcfInfo.SupiRanges) } } - fmt.Printf("PCF match found = %v", matchFound) + fmt.Printf("pcf match found = %v", matchFound) return matchFound, nil } @@ -254,6 +255,6 @@ func MatchUdmProfile(profile *models.NfProfile, opts *Nnrf_NFDiscovery.SearchNFI matchFound = MatchSupiRange(opts.Supi.Value(), profile.UdmInfo.SupiRanges) } } - fmt.Printf("UDM match found = %v", matchFound) + fmt.Printf("udm match found = %v", matchFound) return matchFound, nil } diff --git a/nrfcache/nrfcache.go b/nrfcache/nrfcache.go index 17482d8..7335fd6 100644 --- a/nrfcache/nrfcache.go +++ b/nrfcache/nrfcache.go @@ -147,7 +147,7 @@ func (c *NrfCache) handleLookup(nrfUri string, targetNfType, requestNfType model c.mutex.RUnlock() if len(searchResult.NfInstances) == 0 { - fmt.Printf("Cache miss for nftype %s", targetNfType) + fmt.Printf("cache miss for nftype %s", targetNfType) c.mutex.Lock() defer c.mutex.Unlock() searchResult.NfInstances = c.get(param) @@ -297,7 +297,7 @@ func (c *NrfMasterCache) GetNrfCacheInstance(targetNfType models.NfType) *NrfCac cache, exists := c.nfTypeToCacheMap[targetNfType] if exists == false { - fmt.Printf("Creating cache for nftype %v", targetNfType) + fmt.Printf("creating cache for nftype %v", targetNfType) cache = NewNrfCache(c.evictionInterval, c.nrfDiscoveryQueryCb) c.nfTypeToCacheMap[targetNfType] = cache } @@ -346,7 +346,6 @@ func disableNrfCaching() { } func SearchNFInstances(nrfUri string, targetNfType, requestNfType models.NfType, param *Nnrf_NFDiscovery.SearchNFInstancesParamOpts) (models.SearchResult, error) { - var searchResult models.SearchResult var err error @@ -354,7 +353,7 @@ func SearchNFInstances(nrfUri string, targetNfType, requestNfType models.NfType, if c != nil { searchResult, err = c.handleLookup(nrfUri, targetNfType, requestNfType, param) } else { - fmt.Println("SearchNFInstances nrf cache") + fmt.Println("failed to find cache for nf type") } for _, np := range searchResult.NfInstances { diff --git a/nrfcache/nrfcache_test.go b/nrfcache/nrfcache_test.go index 2227c58..0644652 100644 --- a/nrfcache/nrfcache_test.go +++ b/nrfcache/nrfcache_test.go @@ -443,7 +443,7 @@ func MarshToJsonString(v interface{}) (result []string) { for i := 0; i < val.Len(); i++ { tmp, err := json.Marshal(val.Index(i).Interface()) if err != nil { - fmt.Printf("Marshal error: %+v", err) + fmt.Printf("marshal error: %+v", err) } result = append(result, string(tmp)) @@ -451,7 +451,7 @@ func MarshToJsonString(v interface{}) (result []string) { } else { tmp, err := json.Marshal(v) if err != nil { - fmt.Printf("Marshal error: %+v", err) + fmt.Printf("marshal error: %+v", err) } result = append(result, string(tmp)) @@ -572,7 +572,7 @@ func TestCacheMissAndHits(t *testing.T) { t.Error("nrf search did not return any records") } if expectedCallCount != nrfDbCallbackCallCount { - t.Error("Unexpected nrfDbCallbackCallCount") + t.Error("unexpected nrfDbCallbackCallCount") } // Cache hit scenario @@ -584,7 +584,7 @@ func TestCacheMissAndHits(t *testing.T) { t.Error("nrf search did not return any records") } if expectedCallCount != nrfDbCallbackCallCount { - t.Error("Unexpected nrfDbCallbackCallCount") + t.Error("unexpected nrfDbCallbackCallCount") } // Cache Miss for dnn 'ims' @@ -604,7 +604,7 @@ func TestCacheMissAndHits(t *testing.T) { t.Error("nrf search did not return any records") } if expectedCallCount != nrfDbCallbackCallCount { - t.Error("Unexpected nrfDbCallbackCallCount") + t.Error("unexpected nrfDbCallbackCallCount") } // Cache Miss for dnn 'internet' sd '0a0b0c' @@ -624,7 +624,7 @@ func TestCacheMissAndHits(t *testing.T) { t.Error("nrf search did not return any records") } if expectedCallCount != nrfDbCallbackCallCount { - t.Error("Unexpected nrfDbCallbackCallCount") + t.Error("unexpected nrfDbCallbackCallCount") } disableNrfCaching() @@ -823,7 +823,7 @@ func TestAusfMatchFilters(t *testing.T) { t.Error("nrf search did not return any records") } if expectedCallCount != nrfDbCallbackCallCount { - t.Error("Unexpected nrfDbCallbackCallCount") + t.Error("unexpected nrfDbCallbackCallCount") } result, err = SearchNFInstances("testNrf", models.NfType_AUSF, models.NfType_AMF, ¶m) @@ -835,7 +835,7 @@ func TestAusfMatchFilters(t *testing.T) { t.Error("nrf search did not return any records") } if expectedCallCount != nrfDbCallbackCallCount { - t.Error("Unexpected nrfDbCallbackCallCount") + t.Error("unexpected nrfDbCallbackCallCount") } param = Nnrf_NFDiscovery.SearchNFInstancesParamOpts{ @@ -851,7 +851,7 @@ func TestAusfMatchFilters(t *testing.T) { t.Error("nrf search did not return any records") } if expectedCallCount != nrfDbCallbackCallCount { - t.Error("Unexpected nrfDbCallbackCallCount") + t.Error("unexpected nrfDbCallbackCallCount") } disableNrfCaching() } @@ -877,7 +877,7 @@ func TestAmfMatchFilters(t *testing.T) { t.Error("nrf search did not return any records") } if expectedCallCount != nrfDbCallbackCallCount { - t.Error("Unexpected nrfDbCallbackCallCount") + t.Error("unexpected nrfDbCallbackCallCount") } param = Nnrf_NFDiscovery.SearchNFInstancesParamOpts{ @@ -895,7 +895,7 @@ func TestAmfMatchFilters(t *testing.T) { t.Error("nrf search did not return any records") } if expectedCallCount != nrfDbCallbackCallCount { - t.Error("Unexpected nrfDbCallbackCallCount") + t.Error("unexpected nrfDbCallbackCallCount") } disableNrfCaching()