summaryrefslogtreecommitdiff
path: root/smoketest/scripts/cli/test_service_dns_dynamic.py
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2023-05-29 21:47:22 +0200
committerChristian Breunig <christian@breunig.cc>2023-05-29 21:56:05 +0200
commitaafed70cb2f12382823ee7d5adc78fec35048002 (patch)
tree58394d16ea157b75e6203f188148b560dd3a3816 /smoketest/scripts/cli/test_service_dns_dynamic.py
parentaef116371f786f5d711731fdc712ae83dc4a34e2 (diff)
downloadvyos-1x-aafed70cb2f12382823ee7d5adc78fec35048002.tar.gz
vyos-1x-aafed70cb2f12382823ee7d5adc78fec35048002.zip
smoketest: adjust to new process_named_running() implementation
After commit 9c677c81b ("vyos.util: extend process_named_running() signature with cmdline") we need an exact match for the process name. In the past we used a in b and now we test for a == b.
Diffstat (limited to 'smoketest/scripts/cli/test_service_dns_dynamic.py')
-rwxr-xr-xsmoketest/scripts/cli/test_service_dns_dynamic.py19
1 files changed, 8 insertions, 11 deletions
diff --git a/smoketest/scripts/cli/test_service_dns_dynamic.py b/smoketest/scripts/cli/test_service_dns_dynamic.py
index a3aa41f94..4a3c05a36 100755
--- a/smoketest/scripts/cli/test_service_dns_dynamic.py
+++ b/smoketest/scripts/cli/test_service_dns_dynamic.py
@@ -22,11 +22,11 @@ from base_vyostest_shim import VyOSUnitTestSHIM
from vyos.configsession import ConfigSessionError
from vyos.util import cmd
-from vyos.util import process_named_running
+from vyos.util import process_running
from vyos.util import read_file
-PROCESS_NAME = 'ddclient'
DDCLIENT_CONF = '/run/ddclient/ddclient.conf'
+DDCLIENT_PID = '/run/ddclient/ddclient.pid'
base_path = ['service', 'dns', 'dynamic']
hostname = 'test.ddns.vyos.io'
@@ -40,10 +40,16 @@ def get_config_value(key):
class TestServiceDDNS(VyOSUnitTestSHIM.TestCase):
def tearDown(self):
+ # Check for running process
+ self.assertTrue(process_running(DDCLIENT_PID))
+
# Delete DDNS configuration
self.cli_delete(base_path)
self.cli_commit()
+ # PID file must no londer exist after process exited
+ self.assertFalse(os.path.exists(DDCLIENT_PID))
+
def test_dyndns_service(self):
from itertools import product
ddns = ['interface', interface, 'service']
@@ -101,9 +107,6 @@ class TestServiceDDNS(VyOSUnitTestSHIM.TestCase):
self.assertTrue(login == user)
self.assertTrue(pwd == "'" + password + "'")
- # Check for running process
- self.assertTrue(process_named_running(PROCESS_NAME))
-
def test_dyndns_rfc2136(self):
# Check if DDNS service can be configured and runs
ddns = ['interface', interface, 'rfc2136', 'vyos']
@@ -131,9 +134,6 @@ class TestServiceDDNS(VyOSUnitTestSHIM.TestCase):
# TODO: inspect generated configuration file
- # Check for running process
- self.assertTrue(process_named_running(PROCESS_NAME))
-
def test_dyndns_ipv6(self):
ddns = ['interface', interface, 'service', 'dynv6']
proto = 'dyndns2'
@@ -151,9 +151,6 @@ class TestServiceDDNS(VyOSUnitTestSHIM.TestCase):
# commit changes
self.cli_commit()
- # Check for running process
- self.assertTrue(process_named_running(PROCESS_NAME))
-
protocol = get_config_value('protocol')
login = get_config_value('login')
pwd = get_config_value('password')