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.

Files changed (46) hide show
  1. {scautolib-3.3.2/SCAutolib.egg-info → scautolib-3.3.5}/PKG-INFO +1 -1
  2. {scautolib-3.3.2 → scautolib-3.3.5}/SCAutolib/__init__.py +4 -2
  3. {scautolib-3.3.2 → scautolib-3.3.5}/SCAutolib/controller.py +6 -0
  4. {scautolib-3.3.2 → scautolib-3.3.5}/SCAutolib/isDistro.py +4 -4
  5. {scautolib-3.3.2 → scautolib-3.3.5}/SCAutolib/models/gui.py +9 -27
  6. {scautolib-3.3.2 → scautolib-3.3.5}/SCAutolib/utils.py +1 -0
  7. {scautolib-3.3.2 → scautolib-3.3.5/SCAutolib.egg-info}/PKG-INFO +1 -1
  8. {scautolib-3.3.2 → scautolib-3.3.5}/setup.py +1 -1
  9. {scautolib-3.3.2 → scautolib-3.3.5}/LICENSE +0 -0
  10. {scautolib-3.3.2 → scautolib-3.3.5}/MANIFEST.in +0 -0
  11. {scautolib-3.3.2 → scautolib-3.3.5}/README.md +0 -0
  12. {scautolib-3.3.2 → scautolib-3.3.5}/SCAutolib/cli_commands.py +0 -0
  13. {scautolib-3.3.2 → scautolib-3.3.5}/SCAutolib/enums.py +0 -0
  14. {scautolib-3.3.2 → scautolib-3.3.5}/SCAutolib/exceptions.py +0 -0
  15. {scautolib-3.3.2 → scautolib-3.3.5}/SCAutolib/models/CA.py +0 -0
  16. {scautolib-3.3.2 → scautolib-3.3.5}/SCAutolib/models/__init__.py +0 -0
  17. {scautolib-3.3.2 → scautolib-3.3.5}/SCAutolib/models/authselect.py +0 -0
  18. {scautolib-3.3.2 → scautolib-3.3.5}/SCAutolib/models/card.py +0 -0
  19. {scautolib-3.3.2 → scautolib-3.3.5}/SCAutolib/models/file.py +0 -0
  20. {scautolib-3.3.2 → scautolib-3.3.5}/SCAutolib/models/log.py +0 -0
  21. {scautolib-3.3.2 → scautolib-3.3.5}/SCAutolib/models/user.py +0 -0
  22. {scautolib-3.3.2 → scautolib-3.3.5}/SCAutolib/templates/ca.cnf +0 -0
  23. {scautolib-3.3.2 → scautolib-3.3.5}/SCAutolib/templates/gnome_disable_welcome +0 -0
  24. {scautolib-3.3.2 → scautolib-3.3.5}/SCAutolib/templates/softhsm2.conf +0 -0
  25. {scautolib-3.3.2 → scautolib-3.3.5}/SCAutolib/templates/sssd.conf-10 +0 -0
  26. {scautolib-3.3.2 → scautolib-3.3.5}/SCAutolib/templates/sssd.conf-8or9 +0 -0
  27. {scautolib-3.3.2 → scautolib-3.3.5}/SCAutolib/templates/user.cnf +0 -0
  28. {scautolib-3.3.2 → scautolib-3.3.5}/SCAutolib/templates/virt_cacard.service +0 -0
  29. {scautolib-3.3.2 → scautolib-3.3.5}/SCAutolib/templates/virtcacard.cil +0 -0
  30. {scautolib-3.3.2 → scautolib-3.3.5}/SCAutolib.egg-info/SOURCES.txt +0 -0
  31. {scautolib-3.3.2 → scautolib-3.3.5}/SCAutolib.egg-info/dependency_links.txt +0 -0
  32. {scautolib-3.3.2 → scautolib-3.3.5}/SCAutolib.egg-info/entry_points.txt +0 -0
  33. {scautolib-3.3.2 → scautolib-3.3.5}/SCAutolib.egg-info/requires.txt +0 -0
  34. {scautolib-3.3.2 → scautolib-3.3.5}/SCAutolib.egg-info/top_level.txt +0 -0
  35. {scautolib-3.3.2 → scautolib-3.3.5}/requirements.txt +0 -0
  36. {scautolib-3.3.2 → scautolib-3.3.5}/setup.cfg +0 -0
  37. {scautolib-3.3.2 → scautolib-3.3.5}/test/test_ca.py +0 -0
  38. {scautolib-3.3.2 → scautolib-3.3.5}/test/test_card.py +0 -0
  39. {scautolib-3.3.2 → scautolib-3.3.5}/test/test_cli.py +0 -0
  40. {scautolib-3.3.2 → scautolib-3.3.5}/test/test_controller.py +0 -0
  41. {scautolib-3.3.2 → scautolib-3.3.5}/test/test_file.py +0 -0
  42. {scautolib-3.3.2 → scautolib-3.3.5}/test/test_openssl_conf.py +0 -0
  43. {scautolib-3.3.2 → scautolib-3.3.5}/test/test_sssd_conf.py +0 -0
  44. {scautolib-3.3.2 → scautolib-3.3.5}/test/test_user.py +0 -0
  45. {scautolib-3.3.2 → scautolib-3.3.5}/test/test_utils.py +0 -0
  46. {scautolib-3.3.2 → scautolib-3.3.5}/tox.ini +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: SCAutolib
3
- Version: 3.3.2
3
+ Version: 3.3.5
4
4
  Summary: Python library for automation tests of smart cards using virtualization.
5
5
  Home-page: https://github.com/redhat-qe-security/SCAutolib
6
6
  Author: Pavel Yadlouski
@@ -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 [%(levelname)s] %(message)s"
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(oses: Union[str, list], version: str = None) -> bool:
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(oses, str):
15
- results = (oses in cur_id) or (oses in cur_name)
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 oses:
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\">\n"
272
+ "<body style=\"background-color:#000;\">\n"
293
273
  )
294
274
 
295
- fmt = "<span style=\"color:white;\">"
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 += "<span style=\"color:limegreen;\">%(message)s</span>"
299
- self.fileHandler = HTMLFileHandler(self.html_file)
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>")
@@ -145,6 +145,7 @@ def load_token(card_name: str = None, update_sssd: bool = False):
145
145
  key="matchrule",
146
146
  value=f"<SUBJECT>.*CN={card.CN}.*")
147
147
  sssd_conf.save()
148
+ run(["sss_cache", "-E"])
148
149
  run(["systemctl", "restart", "sssd"])
149
150
  return card
150
151
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: SCAutolib
3
- Version: 3.3.2
3
+ Version: 3.3.5
4
4
  Summary: Python library for automation tests of smart cards using virtualization.
5
5
  Home-page: https://github.com/redhat-qe-security/SCAutolib
6
6
  Author: Pavel Yadlouski
@@ -24,7 +24,7 @@ graphical_reqs = [
24
24
 
25
25
  setup(
26
26
  name="SCAutolib",
27
- version="3.3.2",
27
+ version="3.3.5",
28
28
  description=description,
29
29
  long_description=long_description,
30
30
  long_description_content_type='text/markdown',
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