diff options
author | Christian Poessinger <christian@poessinger.com> | 2020-07-11 20:22:13 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2020-07-11 20:22:13 +0200 |
commit | 9ac84f533b9dfd80dbf00708ac1f58d260bfdfa7 (patch) | |
tree | 09e0e5f1defc65ada92f267e479e6418111a2e54 | |
parent | 10b5196ddfb9a83b17f90f93524ea077275a8557 (diff) | |
download | vyos-1x-9ac84f533b9dfd80dbf00708ac1f58d260bfdfa7.tar.gz vyos-1x-9ac84f533b9dfd80dbf00708ac1f58d260bfdfa7.zip |
snmp: test that encrypted-password is properly inserted into CLI
-rwxr-xr-x | scripts/cli/test_service_snmp.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/scripts/cli/test_service_snmp.py b/scripts/cli/test_service_snmp.py index 983eadf4c..f4f20a3cb 100755 --- a/scripts/cli/test_service_snmp.py +++ b/scripts/cli/test_service_snmp.py @@ -92,7 +92,6 @@ class TestSNMPService(unittest.TestCase): self.session.set(base_path + ['v3', 'view', 'default', 'oid', '1']) self.session.set(base_path + ['v3', 'group', 'default', 'view', 'default']) - self.session.commit() # create user self.session.set(base_path + ['v3', 'user', 'vyos', 'auth', 'plaintext-password', 'vyos12345678']) @@ -101,6 +100,16 @@ class TestSNMPService(unittest.TestCase): self.session.set(base_path + ['v3', 'user', 'vyos', 'privacy', 'type', 'aes']) self.session.set(base_path + ['v3', 'user', 'vyos', 'group', 'default']) + self.session.commit() + + # commit will alter the CLI values - check if they have been updated: + hashed_password = '4e52fe55fd011c9c51ae2c65f4b78ca93dcafdfe' + tmp = self.session.show_config(base_path + ['v3', 'user', 'vyos', 'auth', 'encrypted-password']).split()[1] + self.assertEqual(tmp, hashed_password) + + tmp = self.session.show_config(base_path + ['v3', 'user', 'vyos', 'privacy', 'encrypted-password']).split()[1] + self.assertEqual(tmp, hashed_password) + # TODO: read in config file and check values # Check for running process |