summaryrefslogtreecommitdiff
path: root/smoketest/scripts/cli/test_service_https.py
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2024-04-06 12:44:01 +0200
committerChristian Breunig <christian@breunig.cc>2024-04-06 12:51:18 +0200
commitd9d2e9c8ead29c173fefd1b565d191a85baaa071 (patch)
tree3d9f16a071e0a7f3367952783ad47a5a7ff4e482 /smoketest/scripts/cli/test_service_https.py
parent71786307eed6a0ebb42755f24c19dfd46b1b9696 (diff)
downloadvyos-1x-d9d2e9c8ead29c173fefd1b565d191a85baaa071.tar.gz
vyos-1x-d9d2e9c8ead29c173fefd1b565d191a85baaa071.zip
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.
Diffstat (limited to 'smoketest/scripts/cli/test_service_https.py')
-rwxr-xr-xsmoketest/scripts/cli/test_service_https.py6
1 files changed, 2 insertions, 4 deletions
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()