Skip to content

Instantly share code, notes, and snippets.

@jasperla
Created August 4, 2020 19:24
Show Gist options
  • Save jasperla/1f40265b54c636602bb439d1b6085709 to your computer and use it in GitHub Desktop.
Save jasperla/1f40265b54c636602bb439d1b6085709 to your computer and use it in GitHub Desktop.
diff --git a/tests/unit/modules/test_tls.py b/tests/unit/modules/test_tls.py
index 419cddd056..614963ccfb 100644
--- a/tests/unit/modules/test_tls.py
+++ b/tests/unit/modules/test_tls.py
@@ -7,6 +7,7 @@ from __future__ import absolute_import, print_function, unicode_literals
# Import Python libs
import logging
+import os
# Import 3rd party Libs
import salt.ext as six
@@ -331,6 +332,8 @@ class TLSAddTestCase(TestCase, LoaderModuleMockMixin):
tls.__opts__, {"hash_type": "sha256", "cachedir": ca_path}
), patch(
"salt.modules.tls.maybe_fix_ssl_version", MagicMock(return_value=True)
+ ), patch(
+ "os.stat", MagicMock(return_value=[MagicMock(st_mode=33188)])
):
self.assertEqual(
tls.create_ca(
@@ -338,6 +341,7 @@ class TLSAddTestCase(TestCase, LoaderModuleMockMixin):
),
ret,
)
+ self.assertEqual(certk_stat.st_mode & stat.S_IRWXO, 0)
@with_tempdir()
def test_recreate_ca(self, ca_path):
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment