Thanks for providing more background details in the linked bug.
I'd like to add a unittest for this scenario, something like this
% git diff tests/unittests/test_datasource/test_azure.py diff --git a/tests/unittests/test_datasource/test_azure.py b/tests/unittests/test_datasource/test_azure.py index 3547dd9..6251a42 100644 --- a/tests/unittests/test_datasource/test_azure.py +++ b/tests/unittests/test_datasource/test_azure.py @@ -769,6 +769,23 @@ scbus-1 on xpt0 bus 0 crypt.crypt(odata['UserPassword'], defuser['passwd'][0:pos]))
+ def test_user_not_locked_if_password_redacted(self): + odata = {'HostName': "myhost", 'UserName': "myuser", + 'UserPassword': dsaz.DEF_PASSWD_REDACTION} + data = {'ovfcontent': construct_valid_ovf_env(data=odata)} + + dsrc = self._get_ds(data) + ret = dsrc.get_data() + self.assertTrue(ret) + self.assertTrue('default_user' in dsrc.cfg['system_info']) + defuser = dsrc.cfg['system_info']['default_user'] + + # default user should be updated username and should not be locked. + self.assertEqual(defuser['name'], odata['UserName']) + self.assertIn('lock_passwd', defuser) + self.assertFalse(defuser['lock_passwd']) + +
When you've signed the CLA and added a unittest, please move this branch back from WIP to Needs Review.
« Back to merge proposal
Thanks for providing more background details in the linked bug.
I'd like to add a unittest for this scenario, something like this
% git diff tests/unittests /test_datasourc e/test_ azure.py unittests/ test_datasource /test_azure. py b/tests/ unittests/ test_datasource /test_azure. py unittests/ test_datasource /test_azure. py unittests/ test_datasource /test_azure. py
crypt. crypt(odata[ 'UserPassword' ],
defuser[ 'passwd' ][0:pos] ))
diff --git a/tests/
index 3547dd9..6251a42 100644
--- a/tests/
+++ b/tests/
@@ -769,6 +769,23 @@ scbus-1 on xpt0 bus 0
+ def test_user_ not_locked_ if_password_ redacted( self): PASSWD_ REDACTION} valid_ovf_ env(data= odata)} (ret) ('default_ user' in dsrc.cfg[ 'system_ info']) 'system_ info'][ 'default_ user'] l(defuser[ 'name'] , odata['UserName']) 'lock_passwd' , defuser) e(defuser[ 'lock_passwd' ])
+ odata = {'HostName': "myhost", 'UserName': "myuser",
+ 'UserPassword': dsaz.DEF_
+ data = {'ovfcontent': construct_
+
+ dsrc = self._get_ds(data)
+ ret = dsrc.get_data()
+ self.assertTrue
+ self.assertTrue
+ defuser = dsrc.cfg[
+
+ # default user should be updated username and should not be locked.
+ self.assertEqua
+ self.assertIn(
+ self.assertFals
+
+
When you've signed the CLA and added a unittest, please move this branch back from WIP to Needs Review.