This commit is contained in:
twangboy 2020-06-08 18:15:26 -06:00 committed by Daniel Wozniak
parent e90abe5b33
commit 807bb03fee

View file

@ -10,6 +10,7 @@ from salt.exceptions import CommandExecutionError
# Import Salt Testing Libs
from tests.support.helpers import destructiveTest
from tests.support.mock import patch
from tests.support.unit import TestCase, skipIf
@ -29,6 +30,17 @@ class WinLgpoNetshTestCase(TestCase):
self.assertIn("Inbound", ret)
self.assertIn("Outbound", ret)
def test_get_settings_firewallpolicy_lgpo_issue_57591(self):
"""
Should not stacktrace when the hostname contains unicode characters
"""
with patch.object(win_lgpo_netsh, "__hostname__", return_value="kомпьютер"):
ret = win_lgpo_netsh.get_settings(
profile="domain", section="firewallpolicy", store="lgpo"
)
self.assertIn("Inbound", ret)
self.assertIn("Outbound", ret)
def test_get_settings_logging_local(self):
ret = win_lgpo_netsh.get_settings(
profile="domain", section="logging", store="local"