SCAutolib 3.3.2__tar.gz → 3.3.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of SCAutolib might be problematic. Click here for more details.
- {scautolib-3.3.2/SCAutolib.egg-info → scautolib-3.3.5}/PKG-INFO +1 -1
- {scautolib-3.3.2 → scautolib-3.3.5}/SCAutolib/__init__.py +4 -2
- {scautolib-3.3.2 → scautolib-3.3.5}/SCAutolib/controller.py +6 -0
- {scautolib-3.3.2 → scautolib-3.3.5}/SCAutolib/isDistro.py +4 -4
- {scautolib-3.3.2 → scautolib-3.3.5}/SCAutolib/models/gui.py +9 -27
- {scautolib-3.3.2 → scautolib-3.3.5}/SCAutolib/utils.py +1 -0
- {scautolib-3.3.2 → scautolib-3.3.5/SCAutolib.egg-info}/PKG-INFO +1 -1
- {scautolib-3.3.2 → scautolib-3.3.5}/setup.py +1 -1
- {scautolib-3.3.2 → scautolib-3.3.5}/LICENSE +0 -0
- {scautolib-3.3.2 → scautolib-3.3.5}/MANIFEST.in +0 -0
- {scautolib-3.3.2 → scautolib-3.3.5}/README.md +0 -0
- {scautolib-3.3.2 → scautolib-3.3.5}/SCAutolib/cli_commands.py +0 -0
- {scautolib-3.3.2 → scautolib-3.3.5}/SCAutolib/enums.py +0 -0
- {scautolib-3.3.2 → scautolib-3.3.5}/SCAutolib/exceptions.py +0 -0
- {scautolib-3.3.2 → scautolib-3.3.5}/SCAutolib/models/CA.py +0 -0
- {scautolib-3.3.2 → scautolib-3.3.5}/SCAutolib/models/__init__.py +0 -0
- {scautolib-3.3.2 → scautolib-3.3.5}/SCAutolib/models/authselect.py +0 -0
- {scautolib-3.3.2 → scautolib-3.3.5}/SCAutolib/models/card.py +0 -0
- {scautolib-3.3.2 → scautolib-3.3.5}/SCAutolib/models/file.py +0 -0
- {scautolib-3.3.2 → scautolib-3.3.5}/SCAutolib/models/log.py +0 -0
- {scautolib-3.3.2 → scautolib-3.3.5}/SCAutolib/models/user.py +0 -0
- {scautolib-3.3.2 → scautolib-3.3.5}/SCAutolib/templates/ca.cnf +0 -0
- {scautolib-3.3.2 → scautolib-3.3.5}/SCAutolib/templates/gnome_disable_welcome +0 -0
- {scautolib-3.3.2 → scautolib-3.3.5}/SCAutolib/templates/softhsm2.conf +0 -0
- {scautolib-3.3.2 → scautolib-3.3.5}/SCAutolib/templates/sssd.conf-10 +0 -0
- {scautolib-3.3.2 → scautolib-3.3.5}/SCAutolib/templates/sssd.conf-8or9 +0 -0
- {scautolib-3.3.2 → scautolib-3.3.5}/SCAutolib/templates/user.cnf +0 -0
- {scautolib-3.3.2 → scautolib-3.3.5}/SCAutolib/templates/virt_cacard.service +0 -0
- {scautolib-3.3.2 → scautolib-3.3.5}/SCAutolib/templates/virtcacard.cil +0 -0
- {scautolib-3.3.2 → scautolib-3.3.5}/SCAutolib.egg-info/SOURCES.txt +0 -0
- {scautolib-3.3.2 → scautolib-3.3.5}/SCAutolib.egg-info/dependency_links.txt +0 -0
- {scautolib-3.3.2 → scautolib-3.3.5}/SCAutolib.egg-info/entry_points.txt +0 -0
- {scautolib-3.3.2 → scautolib-3.3.5}/SCAutolib.egg-info/requires.txt +0 -0
- {scautolib-3.3.2 → scautolib-3.3.5}/SCAutolib.egg-info/top_level.txt +0 -0
- {scautolib-3.3.2 → scautolib-3.3.5}/requirements.txt +0 -0
- {scautolib-3.3.2 → scautolib-3.3.5}/setup.cfg +0 -0
- {scautolib-3.3.2 → scautolib-3.3.5}/test/test_ca.py +0 -0
- {scautolib-3.3.2 → scautolib-3.3.5}/test/test_card.py +0 -0
- {scautolib-3.3.2 → scautolib-3.3.5}/test/test_cli.py +0 -0
- {scautolib-3.3.2 → scautolib-3.3.5}/test/test_controller.py +0 -0
- {scautolib-3.3.2 → scautolib-3.3.5}/test/test_file.py +0 -0
- {scautolib-3.3.2 → scautolib-3.3.5}/test/test_openssl_conf.py +0 -0
- {scautolib-3.3.2 → scautolib-3.3.5}/test/test_sssd_conf.py +0 -0
- {scautolib-3.3.2 → scautolib-3.3.5}/test/test_user.py +0 -0
- {scautolib-3.3.2 → scautolib-3.3.5}/test/test_utils.py +0 -0
- {scautolib-3.3.2 → scautolib-3.3.5}/tox.ini +0 -0
|
@@ -7,10 +7,12 @@ from schema import Schema, Use, Or, And, Optional
|
|
|
7
7
|
|
|
8
8
|
from SCAutolib.enums import CardType, UserType
|
|
9
9
|
|
|
10
|
-
fmt = "%(name)s:%(module)s.%(funcName)s.%(lineno)d
|
|
10
|
+
fmt = ("%(asctime)s %(name)s:%(module)s.%(funcName)s.%(lineno)d "
|
|
11
|
+
"[%(levelname)s] %(message)s")
|
|
11
12
|
date_fmt = "%H:%M:%S"
|
|
12
13
|
coloredlogs.install(level="DEBUG", fmt=fmt, datefmt=date_fmt,
|
|
13
|
-
field_styles={'levelname': {'bold': True, 'color': 'blue'}
|
|
14
|
+
field_styles={'levelname': {'bold': True, 'color': 'blue'},
|
|
15
|
+
'asctime': {'color': 'green'}})
|
|
14
16
|
logger = logging.getLogger(__name__)
|
|
15
17
|
# Disable logs from imported packages
|
|
16
18
|
logging.getLogger("paramiko").setLevel(logging.WARNING)
|
|
@@ -449,6 +449,12 @@ class Controller:
|
|
|
449
449
|
cache_file.unlink()
|
|
450
450
|
logger.debug("Removed opensc file cache")
|
|
451
451
|
|
|
452
|
+
sssd_cache_dir = Path(os.path.expanduser('~sssd') + "/.cache/opensc/")
|
|
453
|
+
if sssd_cache_dir.exists():
|
|
454
|
+
for cache_file in sssd_cache_dir.iterdir():
|
|
455
|
+
cache_file.unlink()
|
|
456
|
+
logger.debug("Removed opensc file cache for sssd user")
|
|
457
|
+
|
|
452
458
|
# file only created in graphical mode that is why it is removed.
|
|
453
459
|
self.dconf_file.remove()
|
|
454
460
|
|
|
@@ -7,15 +7,15 @@ import distro
|
|
|
7
7
|
from typing import Union
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
def isDistro(
|
|
10
|
+
def isDistro(OSes: Union[str, list], version: str = None) -> bool:
|
|
11
11
|
cur_id = distro.id().lower()
|
|
12
12
|
cur_name = distro.name().lower()
|
|
13
13
|
|
|
14
|
-
if isinstance(
|
|
15
|
-
results = (
|
|
14
|
+
if isinstance(OSes, str):
|
|
15
|
+
results = (OSes in cur_id) or (OSes in cur_name)
|
|
16
16
|
else:
|
|
17
17
|
results = False
|
|
18
|
-
for item in
|
|
18
|
+
for item in OSes:
|
|
19
19
|
if not isinstance(item, str):
|
|
20
20
|
continue
|
|
21
21
|
item = item.lower()
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import copy
|
|
2
1
|
import inspect
|
|
3
2
|
import os
|
|
4
3
|
from os.path import join
|
|
@@ -15,28 +14,6 @@ from SCAutolib import run, logger
|
|
|
15
14
|
from SCAutolib.isDistro import isDistro
|
|
16
15
|
|
|
17
16
|
|
|
18
|
-
class HTMLFileHandler(logging.FileHandler):
|
|
19
|
-
"""Extending FileHandler to work with HTML files."""
|
|
20
|
-
|
|
21
|
-
def __init__(
|
|
22
|
-
self, filename, mode='a', encoding=None, delay=False, errors=None):
|
|
23
|
-
"""
|
|
24
|
-
A handler class which writes formatted logging records to disk HTML
|
|
25
|
-
files.
|
|
26
|
-
"""
|
|
27
|
-
super(HTMLFileHandler, self).__init__(
|
|
28
|
-
filename, mode, encoding, delay, errors
|
|
29
|
-
)
|
|
30
|
-
|
|
31
|
-
def emit(self, record: logging.LogRecord) -> None:
|
|
32
|
-
"""
|
|
33
|
-
Do whatever it takes to actually log the specified logging record.
|
|
34
|
-
"""
|
|
35
|
-
custom_record = copy.deepcopy(record)
|
|
36
|
-
custom_record.msg = str(record.msg).rstrip().replace("\n", "<br>\n")
|
|
37
|
-
return super().emit(custom_record)
|
|
38
|
-
|
|
39
|
-
|
|
40
17
|
class Screen:
|
|
41
18
|
"""Captures the screenshots."""
|
|
42
19
|
|
|
@@ -74,6 +51,9 @@ class Screen:
|
|
|
74
51
|
|
|
75
52
|
if out.returncode == 0:
|
|
76
53
|
captured = True
|
|
54
|
+
else:
|
|
55
|
+
logger.debug(f"ffmpeg failed with {out.returncode}. "
|
|
56
|
+
f"stdout: {out.stdout}, stderr: {out.stderr}")
|
|
77
57
|
|
|
78
58
|
if not captured:
|
|
79
59
|
raise Exception('Could not capture screenshot within timeout.')
|
|
@@ -289,14 +269,16 @@ class GUI:
|
|
|
289
269
|
"initial-scale=1.0\">\n"
|
|
290
270
|
"<title>Test Results</title>\n"
|
|
291
271
|
"</head>\n"
|
|
292
|
-
"<body style=\"background-color:#000
|
|
272
|
+
"<body style=\"background-color:#000;\">\n"
|
|
293
273
|
)
|
|
294
274
|
|
|
295
|
-
fmt = "<span style=\"color:
|
|
275
|
+
fmt = "<span style=\"color:limegreen;\">"
|
|
276
|
+
fmt += "%(asctime)s</span> "
|
|
277
|
+
fmt += "<span style=\"color:white;\">"
|
|
296
278
|
fmt += "%(name)s:%(module)s.%(funcName)s.%(lineno)d </span>"
|
|
297
279
|
fmt += "<span style=\"color:royalblue;\">[%(levelname)s] </span>"
|
|
298
|
-
fmt += "<
|
|
299
|
-
self.fileHandler =
|
|
280
|
+
fmt += "<pre style=\"color:limegreen;\">%(message)s</pre>"
|
|
281
|
+
self.fileHandler = logging.FileHandler(self.html_file)
|
|
300
282
|
self.fileHandler.setLevel(logging.DEBUG)
|
|
301
283
|
self.fileHandler.setFormatter(
|
|
302
284
|
logging.Formatter("<p>" + fmt + "</p>")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|