fix: make authorization tests independent of host PIDs - #200
Closed
fly602 wants to merge 1 commit into
Closed
Conversation
1. Inject the process start-time reader into allowCallerRegistry. 2. Keep getProcessStartTime as the production implementation. 3. Stub start-time reads in tests to remove /proc PID dependencies. Log: No user-facing changes Influence: 1. Run locale-helper tests in an isolated PID namespace. 2. Verify non-root authorization still detects PID reuse. 3. Build the package on architectures using isolated build workers. fix: 修复授权测试依赖构建机进程的问题 1. 为 allowCallerRegistry 注入进程启动时间读取函数。 2. 生产环境仍使用 getProcessStartTime 读取 /proc。 3. 测试使用固定启动时间,消除对构建机 PID 的依赖。 Log: 无用户可见变化 Influence: 1. 在隔离 PID 命名空间中运行 locale-helper 测试。 2. 验证非 root 授权仍能检测 PID 复用。 3. 在使用隔离构建容器的各架构上执行软件包构建。 PMS: TASK-393313
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThis PR injects a process start-time reader into the allowCallerRegistry so tests can stub PID start times, making authorization tests independent of host /proc PIDs while keeping the production implementation unchanged. Sequence diagram for injected processStartTime in authorizeRegistrarsequenceDiagram
participant Test
participant allowCallerRegistry
participant processStartTime
Test->>allowCallerRegistry: authorizeRegistrar(sender, uniqueName)
allowCallerRegistry->>processStartTime: processStartTime(senderPID)
processStartTime-->>allowCallerRegistry: senderStartTime
allowCallerRegistry->>processStartTime: processStartTime(senderPID)
processStartTime-->>allowCallerRegistry: checkStartTime
allowCallerRegistry-->>Test: authorization result
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Log: No user-facing changes
Influence:
fix: 修复授权测试依赖构建机进程的问题
Log: 无用户可见变化
Influence:
PMS: TASK-393313
Summary by Sourcery
Decouple authorization tests from build-host process IDs while preserving production PID-reuse detection.
Bug Fixes:
Enhancements:
Tests: