amd-debug-tools 0.2.12__tar.gz → 0.2.13__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.
Files changed (69) hide show
  1. {amd_debug_tools-0.2.12/src/amd_debug_tools.egg-info → amd_debug_tools-0.2.13}/PKG-INFO +1 -1
  2. {amd_debug_tools-0.2.12 → amd_debug_tools-0.2.13}/src/amd_debug/s2idle.py +9 -11
  3. {amd_debug_tools-0.2.12 → amd_debug_tools-0.2.13/src/amd_debug_tools.egg-info}/PKG-INFO +1 -1
  4. {amd_debug_tools-0.2.12 → amd_debug_tools-0.2.13}/src/test_s2idle.py +3 -9
  5. {amd_debug_tools-0.2.12 → amd_debug_tools-0.2.13}/.github/workflows/ci.yml +0 -0
  6. {amd_debug_tools-0.2.12 → amd_debug_tools-0.2.13}/.github/workflows/mirror.yml +0 -0
  7. {amd_debug_tools-0.2.12 → amd_debug_tools-0.2.13}/.gitignore +0 -0
  8. {amd_debug_tools-0.2.12 → amd_debug_tools-0.2.13}/.pre-commit-config.yaml +0 -0
  9. {amd_debug_tools-0.2.12 → amd_debug_tools-0.2.13}/.vscode/settings.json +0 -0
  10. {amd_debug_tools-0.2.12 → amd_debug_tools-0.2.13}/LICENSE +0 -0
  11. {amd_debug_tools-0.2.12 → amd_debug_tools-0.2.13}/Makefile +0 -0
  12. {amd_debug_tools-0.2.12 → amd_debug_tools-0.2.13}/README.md +0 -0
  13. {amd_debug_tools-0.2.12 → amd_debug_tools-0.2.13}/amd_bios.py +0 -0
  14. {amd_debug_tools-0.2.12 → amd_debug_tools-0.2.13}/amd_pstate.py +0 -0
  15. {amd_debug_tools-0.2.12 → amd_debug_tools-0.2.13}/amd_s2idle.py +0 -0
  16. {amd_debug_tools-0.2.12 → amd_debug_tools-0.2.13}/amd_ttm.py +0 -0
  17. {amd_debug_tools-0.2.12 → amd_debug_tools-0.2.13}/docs/amd-bios.md +0 -0
  18. {amd_debug_tools-0.2.12 → amd_debug_tools-0.2.13}/docs/amd-pstate.md +0 -0
  19. {amd_debug_tools-0.2.12 → amd_debug_tools-0.2.13}/docs/amd-s2idle.md +0 -0
  20. {amd_debug_tools-0.2.12 → amd_debug_tools-0.2.13}/docs/amd-ttm.md +0 -0
  21. {amd_debug_tools-0.2.12 → amd_debug_tools-0.2.13}/docs/in-tree.md +0 -0
  22. {amd_debug_tools-0.2.12 → amd_debug_tools-0.2.13}/install_deps.py +0 -0
  23. {amd_debug_tools-0.2.12 → amd_debug_tools-0.2.13}/psr.py +0 -0
  24. {amd_debug_tools-0.2.12 → amd_debug_tools-0.2.13}/pyproject.toml +0 -0
  25. {amd_debug_tools-0.2.12 → amd_debug_tools-0.2.13}/setup.cfg +0 -0
  26. {amd_debug_tools-0.2.12 → amd_debug_tools-0.2.13}/src/amd_debug/__init__.py +0 -0
  27. {amd_debug_tools-0.2.12 → amd_debug_tools-0.2.13}/src/amd_debug/acpi.py +0 -0
  28. {amd_debug_tools-0.2.12 → amd_debug_tools-0.2.13}/src/amd_debug/bash/amd-s2idle +0 -0
  29. {amd_debug_tools-0.2.12 → amd_debug_tools-0.2.13}/src/amd_debug/battery.py +0 -0
  30. {amd_debug_tools-0.2.12 → amd_debug_tools-0.2.13}/src/amd_debug/bios.py +0 -0
  31. {amd_debug_tools-0.2.12 → amd_debug_tools-0.2.13}/src/amd_debug/common.py +0 -0
  32. {amd_debug_tools-0.2.12 → amd_debug_tools-0.2.13}/src/amd_debug/database.py +0 -0
  33. {amd_debug_tools-0.2.12 → amd_debug_tools-0.2.13}/src/amd_debug/display.py +0 -0
  34. {amd_debug_tools-0.2.12 → amd_debug_tools-0.2.13}/src/amd_debug/failures.py +0 -0
  35. {amd_debug_tools-0.2.12 → amd_debug_tools-0.2.13}/src/amd_debug/installer.py +0 -0
  36. {amd_debug_tools-0.2.12 → amd_debug_tools-0.2.13}/src/amd_debug/kernel.py +0 -0
  37. {amd_debug_tools-0.2.12 → amd_debug_tools-0.2.13}/src/amd_debug/prerequisites.py +0 -0
  38. {amd_debug_tools-0.2.12 → amd_debug_tools-0.2.13}/src/amd_debug/pstate.py +0 -0
  39. {amd_debug_tools-0.2.12 → amd_debug_tools-0.2.13}/src/amd_debug/s2idle-hook +0 -0
  40. {amd_debug_tools-0.2.12 → amd_debug_tools-0.2.13}/src/amd_debug/sleep_report.py +0 -0
  41. {amd_debug_tools-0.2.12 → amd_debug_tools-0.2.13}/src/amd_debug/templates/html +0 -0
  42. {amd_debug_tools-0.2.12 → amd_debug_tools-0.2.13}/src/amd_debug/templates/md +0 -0
  43. {amd_debug_tools-0.2.12 → amd_debug_tools-0.2.13}/src/amd_debug/templates/stdout +0 -0
  44. {amd_debug_tools-0.2.12 → amd_debug_tools-0.2.13}/src/amd_debug/templates/txt +0 -0
  45. {amd_debug_tools-0.2.12 → amd_debug_tools-0.2.13}/src/amd_debug/ttm.py +0 -0
  46. {amd_debug_tools-0.2.12 → amd_debug_tools-0.2.13}/src/amd_debug/validator.py +0 -0
  47. {amd_debug_tools-0.2.12 → amd_debug_tools-0.2.13}/src/amd_debug/wake.py +0 -0
  48. {amd_debug_tools-0.2.12 → amd_debug_tools-0.2.13}/src/amd_debug_tools.egg-info/SOURCES.txt +0 -0
  49. {amd_debug_tools-0.2.12 → amd_debug_tools-0.2.13}/src/amd_debug_tools.egg-info/dependency_links.txt +0 -0
  50. {amd_debug_tools-0.2.12 → amd_debug_tools-0.2.13}/src/amd_debug_tools.egg-info/entry_points.txt +0 -0
  51. {amd_debug_tools-0.2.12 → amd_debug_tools-0.2.13}/src/amd_debug_tools.egg-info/requires.txt +0 -0
  52. {amd_debug_tools-0.2.12 → amd_debug_tools-0.2.13}/src/amd_debug_tools.egg-info/top_level.txt +0 -0
  53. {amd_debug_tools-0.2.12 → amd_debug_tools-0.2.13}/src/launcher.py +0 -0
  54. {amd_debug_tools-0.2.12 → amd_debug_tools-0.2.13}/src/test_acpi.py +0 -0
  55. {amd_debug_tools-0.2.12 → amd_debug_tools-0.2.13}/src/test_batteries.py +0 -0
  56. {amd_debug_tools-0.2.12 → amd_debug_tools-0.2.13}/src/test_bios.py +0 -0
  57. {amd_debug_tools-0.2.12 → amd_debug_tools-0.2.13}/src/test_common.py +0 -0
  58. {amd_debug_tools-0.2.12 → amd_debug_tools-0.2.13}/src/test_database.py +0 -0
  59. {amd_debug_tools-0.2.12 → amd_debug_tools-0.2.13}/src/test_display.py +0 -0
  60. {amd_debug_tools-0.2.12 → amd_debug_tools-0.2.13}/src/test_failures.py +0 -0
  61. {amd_debug_tools-0.2.12 → amd_debug_tools-0.2.13}/src/test_installer.py +0 -0
  62. {amd_debug_tools-0.2.12 → amd_debug_tools-0.2.13}/src/test_kernel.py +0 -0
  63. {amd_debug_tools-0.2.12 → amd_debug_tools-0.2.13}/src/test_launcher.py +0 -0
  64. {amd_debug_tools-0.2.12 → amd_debug_tools-0.2.13}/src/test_prerequisites.py +0 -0
  65. {amd_debug_tools-0.2.12 → amd_debug_tools-0.2.13}/src/test_pstate.py +0 -0
  66. {amd_debug_tools-0.2.12 → amd_debug_tools-0.2.13}/src/test_sleep_report.py +0 -0
  67. {amd_debug_tools-0.2.12 → amd_debug_tools-0.2.13}/src/test_ttm.py +0 -0
  68. {amd_debug_tools-0.2.12 → amd_debug_tools-0.2.13}/src/test_validator.py +0 -0
  69. {amd_debug_tools-0.2.12 → amd_debug_tools-0.2.13}/src/test_wake.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: amd-debug-tools
3
- Version: 0.2.12
3
+ Version: 0.2.13
4
4
  Summary: debug tools for AMD systems
5
5
  Author-email: Mario Limonciello <superm1@kernel.org>
6
6
  License-Expression: MIT
@@ -10,7 +10,6 @@ from datetime import date, timedelta, datetime
10
10
  from amd_debug.common import (
11
11
  convert_string_to_bool,
12
12
  colorize_choices,
13
- fatal_error,
14
13
  is_root,
15
14
  relaunch_sudo,
16
15
  show_log_info,
@@ -61,16 +60,15 @@ def display_report_file(fname, fmt) -> None:
61
60
  return
62
61
  user = os.environ.get("SUDO_USER")
63
62
  if user:
64
- cmd = [
65
- "systemd-run",
66
- "--user",
67
- f"--machine={user}@.host",
68
- "xdg-open",
69
- os.path.abspath(fname),
70
- ]
71
- ret = subprocess.call(cmd)
72
- if ret:
73
- fatal_error(f"Failed to open report: {ret}")
63
+ # ensure that xdg tools will know how to display the file
64
+ # (user may need to call tool with sudo -E)
65
+ if os.environ.get("XDG_SESSION_TYPE"):
66
+ subprocess.call(["sudo", "-E", "-u", user, "xdg-open", fname])
67
+ else:
68
+ print(
69
+ "To display report automatically in browser launch tool "
70
+ f"with '-E' argument (Example: sudo -E {sys.argv[0]})"
71
+ )
74
72
 
75
73
 
76
74
  def get_report_file(report_file, extension) -> str:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: amd-debug-tools
3
- Version: 0.2.12
3
+ Version: 0.2.13
4
4
  Summary: debug tools for AMD systems
5
5
  Author-email: Mario Limonciello <superm1@kernel.org>
6
6
  License-Expression: MIT
@@ -611,18 +611,12 @@ class TestDisplayReportFile(unittest.TestCase):
611
611
  self, mock_subprocess_call, mock_env_get, mock_is_root
612
612
  ):
613
613
  """Test display_report_file when format is html, user is root, and SUDO_USER is set"""
614
- with self.assertRaises(SystemExit):
615
- display_report_file("/tmp/report.html", "html")
614
+ display_report_file("report.html", "html")
616
615
  mock_is_root.assert_called_once()
617
616
  mock_env_get.assert_any_call("SUDO_USER")
617
+ mock_env_get.assert_any_call("XDG_SESSION_TYPE")
618
618
  mock_subprocess_call.assert_called_once_with(
619
- [
620
- "systemd-run",
621
- "--user",
622
- "--machine=testuser@.host",
623
- "xdg-open",
624
- "/tmp/report.html",
625
- ]
619
+ ["sudo", "-E", "-u", "testuser", "xdg-open", "report.html"]
626
620
  )
627
621
 
628
622
  @patch("amd_debug.s2idle.is_root", return_value=True)