From d9d2e9c8ead29c173fefd1b565d191a85baaa071 Mon Sep 17 00:00:00 2001 From: Christian Breunig Date: Sat, 6 Apr 2024 12:44:01 +0200 Subject: T6199: start validating smoketests against real CLI defaultValues Use vyos.xml_ref.default_value to query XML default values and take them into account when validating properly applied defaults in individual smoketests instead of using hardcoded values like 443 for https port. --- smoketest/scripts/cli/test_service_https.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'smoketest/scripts/cli/test_service_https.py') diff --git a/smoketest/scripts/cli/test_service_https.py b/smoketest/scripts/cli/test_service_https.py index 94eade2d7..f2a64627f 100755 --- a/smoketest/scripts/cli/test_service_https.py +++ b/smoketest/scripts/cli/test_service_https.py @@ -27,6 +27,7 @@ from vyos.utils.file import read_file from vyos.utils.file import write_file from vyos.utils.process import call from vyos.utils.process import process_named_running +from vyos.xml_ref import default_value from vyos.configsession import ConfigSessionError @@ -147,10 +148,8 @@ class TestHTTPSService(VyOSUnitTestSHIM.TestCase): @ignore_warning(InsecureRequestWarning) def test_api_auth(self): - vhost_id = 'example' address = '127.0.0.1' - port = '443' # default value - name = 'localhost' + port = default_value(base_path + ['port']) key = 'MySuperSecretVyOS' self.cli_set(base_path + ['api', 'keys', 'id', 'key-01', 'key', key]) @@ -420,7 +419,6 @@ class TestHTTPSService(VyOSUnitTestSHIM.TestCase): url = f'https://{address}/config-file' url_config = f'https://{address}/configure' headers = {} - tmp_file = 'tmp-config.boot' self.cli_set(base_path + ['api', 'keys', 'id', 'key-01', 'key', key]) self.cli_commit() -- cgit v1.2.3