-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: gatici <[email protected]>
- Loading branch information
Showing
6 changed files
with
66 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// SPDX-FileCopyrightText: 2024 Canonical Ltd. | ||
/* | ||
* Tests for PCF Configuration Factory | ||
*/ | ||
|
||
package factory | ||
|
||
import ( | ||
"fmt" | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
// Webui URL is not set then default Webui URL value is returned | ||
func TestGetDefaultWebuiUrl(t *testing.T) { | ||
if err := InitConfigFactory("pcfcfg.yaml"); err != nil { | ||
fmt.Printf("Error in InitConfigFactory: %v\n", err) | ||
} | ||
got := PcfConfig.Configuration.WebuiUri | ||
want := "webui:9876" | ||
assert.Equal(t, got, want, "The webui URL is not correct.") | ||
} | ||
|
||
// Webui URL is set to a custom value then custom Webui URL is returned | ||
func TestGetCustomWebuiUrl(t *testing.T) { | ||
if err := InitConfigFactory("pcfcfg_with_custom_webui_url.yaml"); err != nil { | ||
fmt.Printf("Error in InitConfigFactory: %v\n", err) | ||
} | ||
got := PcfConfig.Configuration.WebuiUri | ||
want := "myspecialwebui:9872" | ||
assert.Equal(t, got, want, "The webui URL is not correct.") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# SPDX-FileCopyrightText: 2024 Canonical Ltd. | ||
|
||
configuration: | ||
defaultBdtRefId: BdtPolicyId- | ||
mongodb: | ||
name: free5gc | ||
url: http://1.1.1.1 | ||
nrfUri: https://nrf:443 | ||
pcfName: PCF | ||
info: | ||
description: PCF initial local configuration | ||
version: 1.0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# SPDX-FileCopyrightText: 2024 Canonical Ltd. | ||
|
||
configuration: | ||
defaultBdtRefId: BdtPolicyId- | ||
mongodb: | ||
name: free5gc | ||
url: http://1.1.1.1 | ||
nrfUri: https://nrf:443 | ||
webuiUri: myspecialwebui:9872 # a valid URI of Webui | ||
pcfName: PCF | ||
info: | ||
description: PCF initial local configuration | ||
version: 1.0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters