Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add shepherd to the list of supported init programs #354

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion functions/_pure_detect_container_by_pid_method.fish
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ function _pure_detect_container_by_pid_method \
| string match \
--quiet \
--invert \
--regex 'init|systemd'
--regex 'init|systemd|shepherd'
end
end
10 changes: 10 additions & 0 deletions tests/_pure_detect_container_by_pid_method.test.fish
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,16 @@ if test (uname -s) = Linux
) $status -eq $FAILURE
end

if test (uname -s) = Linux
before_each
@test "_pure_detect_container_by_pid_method: false when detecting shepherd in /proc/1/sched" (
_create_proc_sched_file $proc_sched
echo "shepherd (1, #threads: 1)" >$proc_sched

_pure_detect_container_by_pid_method $proc_sched
) $status -eq $FAILURE
end

if test (uname -s) = Linux
before_each
@test "_pure_detect_container_by_pid_method: true when 1st process is neither systemd nor init in /proc/1/sched" (
Expand Down