Updating configs and adding keyword for getting the lab fqdn

Adding new config item and keyword for fqdn of the lab.

Change-Id: I02d182d0df749a293b0c1898d00e508c1e00eba8
Signed-off-by: jpike <jason.pike@windriver.com>
This commit is contained in:
jpike
2025-08-20 11:46:37 -04:00
parent b16a5b5f0d
commit 0efd9618fa
6 changed files with 28 additions and 8 deletions

View File

@@ -1,6 +1,6 @@
{
// dns name for the lab
"dns_name": "lab_dns_name",
"domain_name": "lab_domain_name",
// ACME server url
"stepca_server_url": "external_acme_server_url",

View File

@@ -15,18 +15,18 @@ class SecurityConfig:
raise
security_dict = json5.load(json_data)
self.dns_name = security_dict["dns_name"]
self.domain_name = security_dict["domain_name"]
self.stepca_server_url = security_dict["stepca_server_url"]
self.stepca_server_issuer = security_dict["stepca_server_issuer"]
def get_dns_name(self) -> str:
def get_domain_name(self) -> str:
"""
Getter for the dns name
Returns:
str: the dns name
"""
return self.dns_name
return self.domain_name
def get_stepca_server_url(self) -> str:
"""

View File

@@ -0,0 +1,19 @@
from config.configuration_manager import ConfigurationManager
from keywords.base_keyword import BaseKeyword
class LabInfoKeywords(BaseKeyword):
"""
Class for lab info keywords
"""
def get_fully_qualified_name(self) -> str:
"""
Returns the fully qualified name of the lab from config
Returns:
str: the fully qualified name
"""
lab_name = ConfigurationManager.get_lab_config().get_lab_name()
domain_name = ConfigurationManager.get_security_config().get_domain_name()
return f"{lab_name}.{domain_name}"

View File

@@ -7,6 +7,7 @@ from framework.resources.resource_finder import get_stx_resource_path
from framework.validation.validation import validate_equals, validate_equals_with_retry, validate_list_contains, validate_str_contains, validate_str_contains_with_retry
from keywords.cloud_platform.rest.cloud_rest_client import CloudRestClient
from keywords.cloud_platform.ssh.lab_connection_keywords import LabConnectionKeywords
from keywords.cloud_platform.ssh.lab_info_keywords import LabInfoKeywords
from keywords.cloud_platform.system.application.object.system_application_status_enum import SystemApplicationStatusEnum
from keywords.cloud_platform.system.application.system_application_apply_keywords import SystemApplicationApplyKeywords
from keywords.cloud_platform.system.helm.system_helm_override_keywords import SystemHelmOverrideKeywords
@@ -43,7 +44,7 @@ def test_app_using_nginx_controller(request):
ssh_connection = LabConnectionKeywords().get_active_controller_ssh()
lab_config = ConfigurationManager.get_lab_config()
oam_ip = lab_config.get_floating_ip()
dns_name = ConfigurationManager.get_security_config().get_dns_name()
dns_name = LabInfoKeywords().get_fully_qualified_name()
dns_resolution_status = IPAddressKeywords(oam_ip).check_dnsname_resolution(dns_name=dns_name)
validate_equals(dns_resolution_status, True, "Verify the dns name resolution")
stepca_url = ConfigurationManager.get_security_config().get_stepca_server_url()

View File

@@ -1,6 +1,6 @@
{
// dns name for the lab
"dns_name": "fake_dns_name",
"domain_name": "fake_domain_name",
// ACME server url
"stepca_server_url": "custom_server_url",

View File

@@ -13,7 +13,7 @@ def test_default_security_config():
configuration_manager.load_configs(config_file_locations)
default_config = configuration_manager.get_security_config()
assert default_config is not None, "Default security config wasn't loaded successfully"
assert default_config.get_dns_name() == "lab_dns_name", "default dns name was incorrect"
assert default_config.get_domain_name() == "lab_domain_name", "default domain name was incorrect"
def test_custom_security_config():
@@ -28,4 +28,4 @@ def test_custom_security_config():
custom_config = configuration_manager.get_security_config()
assert custom_config is not None, "Custom security config wasn't loaded successfully"
assert custom_config.get_dns_name() == "fake_dns_name", "Custom dns name was incorrect"
assert custom_config.get_domain_name() == "fake_domain_name", "Custom dns name was incorrect"