pytest-testkit 1.0.3__tar.gz → 1.0.3a2__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.
- {pytest_testkit-1.0.3/pytest_testkit.egg-info → pytest_testkit-1.0.3a2}/PKG-INFO +1 -1
- {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/pyproject.toml +1 -1
- {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/pytest_testkit/lib/common/environment/device.py +16 -12
- {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/pytest_testkit/plugin.py +1 -1
- {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2/pytest_testkit.egg-info}/PKG-INFO +1 -1
- {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/LICENSE +0 -0
- {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/MANIFEST.in +0 -0
- {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/README.md +0 -0
- {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/pytest_testkit/__init__.py +0 -0
- {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/pytest_testkit/lib/__init__.py +0 -0
- {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/pytest_testkit/lib/base/__init__.py +0 -0
- {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/pytest_testkit/lib/base/excel.py +0 -0
- {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/pytest_testkit/lib/base/ftp.py +0 -0
- {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/pytest_testkit/lib/base/local_exec.py +0 -0
- {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/pytest_testkit/lib/base/sftp.py +0 -0
- {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/pytest_testkit/lib/base/ssh.py +0 -0
- {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/pytest_testkit/lib/common/__init__.py +0 -0
- {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/pytest_testkit/lib/common/environment/__init__.py +0 -0
- {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/pytest_testkit/lib/common/environment/allocator.py +0 -0
- {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/pytest_testkit/lib/common/environment/manager.py +0 -0
- {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/pytest_testkit/lib/common/log/__init__.py +0 -0
- {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/pytest_testkit/lib/common/log/filters.py +0 -0
- {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/pytest_testkit/lib/common/log/infra_logger.py +0 -0
- {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/pytest_testkit/lib/common/log/manager.py +0 -0
- {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/pytest_testkit/lib/pre_action/__init__.py +0 -0
- {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/pytest_testkit/lib/pre_action/action.py +0 -0
- {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/pytest_testkit/lib/pre_action/exceptions.py +0 -0
- {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/pytest_testkit/lib/pre_action/registry.py +0 -0
- {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/pytest_testkit.egg-info/SOURCES.txt +0 -0
- {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/pytest_testkit.egg-info/dependency_links.txt +0 -0
- {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/pytest_testkit.egg-info/entry_points.txt +0 -0
- {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/pytest_testkit.egg-info/requires.txt +0 -0
- {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/pytest_testkit.egg-info/top_level.txt +0 -0
- {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/requirements.txt +0 -0
- {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/setup.cfg +0 -0
- {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/tests/test_collect_case_with_inifile.py +0 -0
- {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/tests/test_docker_proxy_creation.py +0 -0
- {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/tests/test_docker_proxy_exit_docker.py +0 -0
- {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/tests/test_docker_proxy_getitem.py +0 -0
- {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/tests/test_docker_proxy_integration.py +0 -0
- {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/tests/test_docker_proxy_is_interactive_shell.py +0 -0
- {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/tests/test_docker_proxy_non_shell_commands.py +0 -0
- {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/tests/test_docker_proxy_sendcmd.py +0 -0
- {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/tests/test_docker_proxy_sendcmd_interactive.py +0 -0
- {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/tests/test_env_nodes_filter.py +0 -0
- {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/tests/test_get_inifile_info.py +0 -0
- {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/tests/test_get_item_case_info.py +0 -0
- {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/tests/test_local_exec.py +0 -0
- {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/tests/test_local_interactive.py +0 -0
- {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/tests/test_log_factory.py +0 -0
- {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/tests/test_log_factory_integration.py +0 -0
- {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/tests/test_security_features.py +0 -0
- {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/tests/test_ssh_cwd.py +0 -0
- {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/tests/test_ssh_file_ops.py +0 -0
- {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/tests/test_ssh_ignore_err.py +0 -0
- {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/tests/test_ssh_only_stdout.py +0 -0
- {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/tests/test_ssh_remove_command_echo.py +0 -0
- {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/tests/test_ssh_success.py +0 -0
{pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/pytest_testkit/lib/common/environment/device.py
RENAMED
|
@@ -772,13 +772,11 @@ class Device:
|
|
|
772
772
|
result_dict = ssh_connect.ssh_cmd_interactive(param)
|
|
773
773
|
|
|
774
774
|
# 发送命令日志: HTML location 列显示 sendcmd[设备短名],
|
|
775
|
-
#
|
|
775
|
+
# 消息不带 shell 提示符只打印命令本身
|
|
776
|
+
new_prompt = getattr(ssh_connect, "last_prompt", "") if ssh_connect else ""
|
|
776
777
|
if echo_output and not _SESSION_QUIET_STDOUT:
|
|
777
778
|
node_tag = f"[{_short_name(self.name)}]"
|
|
778
|
-
|
|
779
|
-
# root@lease-env1792052573-5446-nodes1-device1792052573-2811:~#ls -l
|
|
780
|
-
# 打印回显如上 需要带上 shell 提示符吗
|
|
781
|
-
send_msg = f"{prompt}{cmd}" if prompt else cmd
|
|
779
|
+
send_msg = cmd
|
|
782
780
|
if cwd is not None:
|
|
783
781
|
send_msg += f" (cwd: {cwd})"
|
|
784
782
|
logger.info(
|
|
@@ -796,9 +794,6 @@ class Device:
|
|
|
796
794
|
echo_parts.append(stderr)
|
|
797
795
|
result_echo = "\n".join(echo_parts)
|
|
798
796
|
if result_echo:
|
|
799
|
-
new_prompt = (
|
|
800
|
-
getattr(ssh_connect, "last_prompt", "") if ssh_connect else ""
|
|
801
|
-
)
|
|
802
797
|
# 回显结果以shell提示符结尾移除它, 没有提示符则直接打印不拼装
|
|
803
798
|
if new_prompt and result_echo.endswith(new_prompt):
|
|
804
799
|
recv_msg = result_echo[: -len(new_prompt)].rstrip("\n")
|
|
@@ -808,6 +803,14 @@ class Device:
|
|
|
808
803
|
else:
|
|
809
804
|
logger.info("(empty)", extra={"op_type": f"recvcmd{node_tag}"})
|
|
810
805
|
|
|
806
|
+
# 移除 stdout 末尾的 shell 提示符
|
|
807
|
+
if new_prompt:
|
|
808
|
+
stdout_val = result_dict.get("stdout", "") or ""
|
|
809
|
+
if stdout_val.endswith(new_prompt):
|
|
810
|
+
result_dict["stdout"] = stdout_val[: -len(new_prompt)]
|
|
811
|
+
|
|
812
|
+
logger.info(f"test tzing: {result_dict}")
|
|
813
|
+
|
|
811
814
|
# 按用户原始 only_stdout 决定返回值
|
|
812
815
|
if only_stdout:
|
|
813
816
|
return result_dict.get("stdout", "")
|
|
@@ -1079,10 +1082,11 @@ class Device:
|
|
|
1079
1082
|
self._thread_local.sshConnect.close()
|
|
1080
1083
|
self._set_logged_in(False)
|
|
1081
1084
|
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
)
|
|
1085
|
+
# # 移除 放到调度日志中
|
|
1086
|
+
# logger.info(
|
|
1087
|
+
# f"Disconnected from {self.__str__()}",
|
|
1088
|
+
# extra={"op_type": f"disconnect[{_short_name(self.name)}]"},
|
|
1089
|
+
# )
|
|
1086
1090
|
|
|
1087
1091
|
return True
|
|
1088
1092
|
except Exception as e:
|
|
@@ -1064,7 +1064,7 @@ def pytest_runtest_teardown(item):
|
|
|
1064
1064
|
if item.config.env_initialized and hasattr(item, "infra_environments"):
|
|
1065
1065
|
env_manager = item.config.env_manager
|
|
1066
1066
|
env_manager.release_environments(item.nodeid)
|
|
1067
|
-
logger.info(f"Released test environments")
|
|
1067
|
+
# logger.info(f"Released test environments")
|
|
1068
1068
|
|
|
1069
1069
|
result = getattr(item, "infra_test_result", "unknown")
|
|
1070
1070
|
|
|
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
|
{pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/pytest_testkit/lib/common/environment/__init__.py
RENAMED
|
File without changes
|
{pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/pytest_testkit/lib/common/environment/allocator.py
RENAMED
|
File without changes
|
{pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/pytest_testkit/lib/common/environment/manager.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/pytest_testkit/lib/common/log/infra_logger.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/pytest_testkit.egg-info/dependency_links.txt
RENAMED
|
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
|
{pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/tests/test_docker_proxy_is_interactive_shell.py
RENAMED
|
File without changes
|
{pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/tests/test_docker_proxy_non_shell_commands.py
RENAMED
|
File without changes
|
|
File without changes
|
{pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/tests/test_docker_proxy_sendcmd_interactive.py
RENAMED
|
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
|