Skip to content

Commit 54cd675

Browse files
mgr/smb: add tests cases for smb show password filter
Signed-off-by: John Mulligan <[email protected]>
1 parent 5678d39 commit 54cd675

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

src/pybind/mgr/smb/tests/test_smb.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -722,3 +722,29 @@ def test_show_cluster_without_shares(tmodule):
722722
}
723723
""".strip()
724724
)
725+
726+
727+
def test_show_password_filter_hidden(tmodule):
728+
_example_cfg_1(tmodule)
729+
out = tmodule.show(password_filter=smb.enums.PasswordFilter.HIDDEN)
730+
assert 'resources' in out
731+
res = out['resources']
732+
assert len(res) == 4
733+
ja = [r for r in res if r['resource_type'] == 'ceph.smb.join.auth']
734+
assert ja
735+
join_auth = ja[0]
736+
assert join_auth['auth']['username'] == 'testadmin'
737+
assert join_auth['auth']['password'] == '****************'
738+
739+
740+
def test_show_password_filter_b64(tmodule):
741+
_example_cfg_1(tmodule)
742+
out = tmodule.show(password_filter=smb.enums.PasswordFilter.BASE64)
743+
assert 'resources' in out
744+
res = out['resources']
745+
assert len(res) == 4
746+
ja = [r for r in res if r['resource_type'] == 'ceph.smb.join.auth']
747+
assert ja
748+
join_auth = ja[0]
749+
assert join_auth['auth']['username'] == 'testadmin'
750+
assert join_auth['auth']['password'] == 'UGFzc3cwcmQ='

0 commit comments

Comments
 (0)