summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-02-17 21:22:20 +0100
committerChristian Poessinger <christian@poessinger.com>2020-02-17 21:22:20 +0100
commite38c7397d4a7f427bef1dfebf3e7d329d895ec1e (patch)
tree967baec6c9487a42b8d1a494ea5cfb6a930abebb /scripts
parentb6000fb7e48d049ce78afbdbeaa24d91c85f0191 (diff)
downloadvyos-1x-e38c7397d4a7f427bef1dfebf3e7d329d895ec1e.tar.gz
vyos-1x-e38c7397d4a7f427bef1dfebf3e7d329d895ec1e.zip
snmp: get_config_value() should return str not list
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/cli/test_service_snmp.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/scripts/cli/test_service_snmp.py b/scripts/cli/test_service_snmp.py
index 2f918c929..e46b4b588 100755
--- a/scripts/cli/test_service_snmp.py
+++ b/scripts/cli/test_service_snmp.py
@@ -30,7 +30,8 @@ base_path = ['service', 'snmp']
def get_config_value(key):
tmp = read_file(SNMPD_CONF)
- return re.findall(r'\n?{}\s+(.*)'.format(key), tmp)
+ tmp = re.findall(r'\n?{}\s+(.*)'.format(key), tmp)
+ return tmp[0]
class TestSNMPService(unittest.TestCase):
def setUp(self):
@@ -70,7 +71,7 @@ class TestSNMPService(unittest.TestCase):
# verify listen address, it will be returned as
# ['unix:/run/snmpd.socket,udp:127.0.0.1:161,udp6:[::1]:161']
# thus we need to transfor this into a proper list
- config = get_config_value('agentaddress')[0]
+ config = get_config_value('agentaddress')
expected = 'unix:/run/snmpd.socket'
for addr in listen:
if is_ipv4(addr):
@@ -100,6 +101,7 @@ class TestSNMPService(unittest.TestCase):
# create user
for authpriv in ['auth', 'privacy']:
self.session.set(base_path + ['v3', 'user', 'vyos', authpriv, 'plaintext-key', 'vyos1234'])
+
self.session.set(base_path + ['v3', 'user', 'vyos', 'group', 'default'])
# TODO: read in config file and check values