summaryrefslogtreecommitdiff
path: root/cloudinit/config/tests
diff options
context:
space:
mode:
authorGonéri Le Bouder <goneri@lebouder.net>2020-03-25 13:44:10 -0400
committerGitHub <noreply@github.com>2020-03-25 13:44:10 -0400
commit993f3e3e76e56266a83776a8f54dbb3ba59cfce7 (patch)
treea7226ed8f85b6a8b09c14d923bc08aadf5a1c11b /cloudinit/config/tests
parent42f69f410ab8850c02b1f53dd67c132aa8ef64f5 (diff)
downloadvyos-cloud-init-993f3e3e76e56266a83776a8f54dbb3ba59cfce7.tar.gz
vyos-cloud-init-993f3e3e76e56266a83776a8f54dbb3ba59cfce7.zip
set_passwords: avoid chpasswd on BSD (#268)
Avoid chpasswd on all the BSD variants.
Diffstat (limited to 'cloudinit/config/tests')
-rw-r--r--cloudinit/config/tests/test_set_passwords.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/cloudinit/config/tests/test_set_passwords.py b/cloudinit/config/tests/test_set_passwords.py
index 8247c388..2732bd60 100644
--- a/cloudinit/config/tests/test_set_passwords.py
+++ b/cloudinit/config/tests/test_set_passwords.py
@@ -112,12 +112,12 @@ class TestSetPasswordsHandle(CiTestCase):
'\n'.join(valid_hashed_pwds) + '\n')],
m_subp.call_args_list)
- @mock.patch(MODPATH + "util.is_FreeBSD")
+ @mock.patch(MODPATH + "util.is_BSD")
@mock.patch(MODPATH + "util.subp")
- def test_freebsd_calls_custom_pw_cmds_to_set_and_expire_passwords(
- self, m_subp, m_is_freebsd):
- """FreeBSD calls custom pw commands instead of chpasswd and passwd"""
- m_is_freebsd.return_value = True
+ def test_bsd_calls_custom_pw_cmds_to_set_and_expire_passwords(
+ self, m_subp, m_is_bsd):
+ """BSD don't use chpasswd"""
+ m_is_bsd.return_value = True
cloud = self.tmp_cloud(distro='freebsd')
valid_pwds = ['ubuntu:passw0rd']
cfg = {'chpasswd': {'list': valid_pwds}}
@@ -129,12 +129,12 @@ class TestSetPasswordsHandle(CiTestCase):
mock.call(['pw', 'usermod', 'ubuntu', '-p', '01-Jan-1970'])],
m_subp.call_args_list)
- @mock.patch(MODPATH + "util.is_FreeBSD")
+ @mock.patch(MODPATH + "util.is_BSD")
@mock.patch(MODPATH + "util.subp")
def test_handle_on_chpasswd_list_creates_random_passwords(self, m_subp,
- m_is_freebsd):
+ m_is_bsd):
"""handle parses command set random passwords."""
- m_is_freebsd.return_value = False
+ m_is_bsd.return_value = False
cloud = self.tmp_cloud(distro='ubuntu')
valid_random_pwds = [
'root:R',