8000 pmap: implemented rc options by estodi · Pull Request #456 · uutils/procps · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

pmap: implemented rc options #456

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

Merged
merged 7 commits into from
Jul 3, 2025
Merged

pmap: implemented rc options #456

merged 7 commits into from
Jul 3, 2025

Conversation

estodi
Copy link
Contributor
@estodi estodi commented Jul 1, 2025

Added support for the rc options.

@Krysztal112233
Copy link
Collaborator
Krysztal112233 commented Jul 1, 2025

I think there might be something incorrect...I did the following

➜  procps git:(pmap_rc) ✗ cargo test
    Finished `test` profile [unoptimized + debuginfo] target(s) in 0.05s
     Running unittests src/bin/procps.rs (target/debug/deps/procps-387e1f98aa91ed7c)

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

     Running tests/tests.rs (target/debug/deps/tests-eb57e1d8ed2dfe6f)

running 167 tests
test test_free::test_invalid_arg ... ok
test test_free::test_count_zero ... ok
test test_free::test_count_line ... ok
test test_free::test_committed ... ok
test test_free::test_total ... ok
test test_pgrep::test_invalid_signal ... ok
test test_free::test_seconds_zero ... ok
test test_free::test_lohi ... ok
test test_free::test_no_args ... ok
test test_pgrep::test_no_args ... ok
test test_free::test_wide ... ok
test test_free::test_count ... ok
test test_pgrep::test_invalid_arg ... ok
test test_pgrep::test_help ... ok
test test_pgrep::test_invalid_regex ... ok
test test_pgrep::test_invalid_username ... ok
test test_free::test_unit ... ok
test test_pgrep::test_invalid_group_name ... ok
test test_pgrep::test_current_user ... ok
test test_pgrep::test_list_full_process_with_empty_cmdline ... ok
test test_pgrep::test_lone_require_handler_is_allowed ... ok
test test_pgrep::test_non_matching_pattern ... ok
test test_pgrep::test_nonexisting_cgroup ... ok
test test_pgrep::test_newest_non_matching_pattern ... ok
test test_pgrep::test_nonexisting_pgroup ... ok
test test_free::test_line ... ok
test test_pgrep::test_pidfile_invalid_content ... ok
test test_pgrep::test_does_not_match_current_process ... ok
test test_pgrep::test_pidfile_nonexistent_file ... ok
test test_pgrep::test_nonexisting_session ... ok
test test_pgrep::test_does_not_match_pid ... ok
test test_pgrep::test_count_with_non_matching_pattern ... ok
test test_pgrep::test_pidfile_not_locked ... ok
test test_pgrep::test_env_nonmatching_value ... ok
test test_pgrep::test_older_matching_pattern ... ok
test test_pgrep::test_older_non_matching_pattern ... ok
test test_pgrep::test_ignore_ancestors ... ok
test test_pgrep::test_cgroup ... ok
test test_pgrep::test_oldest_non_matching_pattern ... ok
test test_pgrep::test_env_nonexistent ... ok
test test_pgrep::test_count_with_matching_pattern ... ok
test test_pgrep::test_parent_multiple_parents ... ok
test test_pgrep::test_parent_non_matching_parent ... ok
test test_pgrep::test_env_key_match ... ok
test test_pidof::test_find_init ... ignored, fails in CI
test test_pgrep::test_env_multiple_filters ... ok
test test_pgrep::test_too_many_patterns ... ok
test test_pgrep::test_env_key_value_match ... ok
test test_pidof::test_invalid_arg ... ok
test test_pidof::test_no_args ... ok
test test_pgrep::test_pidfile_flock_locked ... ok
test test_pgrep::test_list_full ... ok
test test_pgrep::test_pidfile_match ... ok
test test_pgrep::test_newest ... ok
test test_pgrep::test_pidfile_fcntl_locked ... ok
test test_pgrep::test_pidfile_invert ... ok
test test_pidwait::test_invalid_arg ... ok
test test_pidwait::test_no_args ... ok
test test_pidof::test_no_pid_found ... ok
test test_pidwait::test_too_many_patterns ... ok
test test_pkill::test_help ... ok
test test_pkill::test_invalid_arg ... ok
test test_pgrep::test_pidfile_no_match ... ok
test test_pkill::test_no_args ... ok
test test_pkill::test_too_long_pattern ... ok
test test_pidof::test_threads ... ok
test test_pkill::test_too_many_patterns ... ok
test test_pidof::test_check_root_accepted ... ok
test test_pmap::test_create_rc_to ... ok
test test_pidof::test_quiet ... ok
test test_pmap::test_device_permission_denied ... ok
test test_pmap::test_existing_pid ... ok
test test_pmap::test_device ... ok
test test_pmap::test_extended_permission_denied ... ok
test test_pgrep::test_require_handler ... ok
test test_pmap::test_invalid_arg ... ok
test test_pidof::test_find_kthreadd_only_with_w_flag ... ok
test test_pmap::test_no_args ... ok
test test_pgrep::test_delimiter_last_wins ... ok
test test_pmap::test_multiple_existing_pids ... ok
test test_pmap::test_non_existing_pid ... ok
test test_pmap::test_non_existing_and_existing_pid ... ok
test test_pmap::test_permission_denied ... ok
test test_pgrep::test_full ... ok
test test_pgrep::test_ignore_case ... ok
test test_pgrep::test_signal_that_never_matches ... ok
test test_pgrep::test_runstates_invalid_runstate ... ok
test test_pgrep::test_terminal_multiple_terminals ... ok
test test_ps::test_invalid_arg ... ok
test test_pmap::test_default_rc ... ok
test test_pgrep::test_delimiter ... ok
test test_pidof::test_omit_pid ... ok
test test_pgrep::test_terminal_invalid_terminal ... ok
test test_pwdx::test_invalid_arg ... ok
test test_pgrep::test_too_long_pattern ... ok
test test_pwdx::test_no_args ... ok
test test_pgrep::test_parent ... ok
test test_pgrep::test_pgroup ... ok
test test_slabtop::test_help ... ok
test test_slabtop::test_invalid_arg ... ok
test test_slabtop::test_without_args_as_non_root ... ok
test test_pmap::test_more_extended ... ok
test test_slabtop::test_once_as_non_root ... ok
test test_pmap::test_extended ... ok
test test_pidof::test_script ... ok
test test_snice::test_no_args ... ok
test test_snice::test_no_process_selected ... ok
test test_sysctl::linux::test_continues_on_error ... ok
test test_sysctl::linux::test_get_simple ... ok
test test_sysctl::linux::test_get_key_only ... ok
test test_sysctl::linux::test_ignoring_errors ... ok
test test_sysctl::linux::test_get_value_only ... ok
test test_slabtop::test_without_args_as_root ... ok
test test_sysctl::test_invalid_arg ... ok
test test_slabtop::test_once_as_root ... ok
test test_tload::test_invalid_arg ... ok
test test_pmap::test_most_extended ... ok
test test_pgrep::test_older ... ok
test test_top::test_conflict_arg ... ok
test test_vmstat::test_invalid_unit ... ok
test test_top::test_invalid_arg ... ok
test test_vmstat::test_header ... ok
test test_vmstat::test_active ... ok
test test_vmstat::test_invalid_arg ... ok
test test_vmstat::test_invalid_number ... ok
test test_pgrep::test_oldest ... ok
test test_vmstat::test_timestamp ... ok
test test_vmstat::test_unit ... ok
test test_vmstat::test_simple ... ok
test test_w::test_help ... ok
test test_vmstat::test_wide_mode ... ok
test test_w::test_invalid_arg ... ok
test test_pkill::test_non_matching_pattern ... ok
test test_watch::test_invalid_arg ... ok
test test_pidwait::test_non_matching_pattern ... ok
test test_watch::test_invalid_interval ... ok
test test_pkill::test_inverse ... ok
test test_pmap::test_read_rc_from ... ok
test test_w::test_output_format ... ok
test test_w::test_option_short ... ok
test test_pgrep::test_session ... ok
test test_w::test_no_header ... ok
test test_pidof::test_single_shot ... ok
test test_pgrep::test_runstates ... ok
test test_pidof::test_separator ... ok
test test_pmap::test_quiet_showpath ... ok
test test_pmap::test_quiet ... ok
test test_pwdx::test_non_existing_pid ... ok
test test_pwdx::test_multiple_valid_pids ... ok
test test_pgrep::test_unknown_terminal ... ok
test test_pwdx::test_valid_pid ... ok
test test_pgrep::test_valid_regex ... ok
test test_pgrep::test_terminal ... ok
test test_pmap::test_showpath ... ok
test test_pwdx::test_invalid_pid ... ok
test test_pwdx::test_non_existing_and_existing_pid ... ok
test test_pwdx::test_invalid_and_valid_pid ... ok
test test_ps::test_select_all_processes ... ok
test test_watch::test_interval_environment_variable ... ok
test test_watch::test_no_interval ... ok
test test_watch::test_valid_interval ... ok
test test_pgrep::test_threads ... ok
test test_ps::test_code_mapping ... ok
test test_vmstat::test_no_first ... ok
test test_watch::test_valid_interval_comma ... ok
test test_top::test_arg_p ... ok
test test_top::test_flag_user ... ok

test result: ok. 166 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out; finished in 2.50s

➜  procps git:(pmap_rc) ✗ cargo test
    Finished `test` profile [unoptimized + debuginfo] target(s) in 0.05s
     Running unittests src/bin/procps.rs (target/debug/deps/procps-387e1f98aa91ed7c)

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

     Running tests/tests.rs (target/debug/deps/tests-eb57e1d8ed2dfe6f)

running 167 tests
test test_free::test_count_zero ... ok
test test_free::test_invalid_arg ... ok
test test_free::test_lohi ... ok
test test_free::test_seconds_zero ... ok
test test_free::test_total ... ok
test test_free::test_committed ... ok
test test_pgrep::test_invalid_username ... ok
test test_free::test_no_args ... ok
test test_pgrep::test_no_args ... ok
test test_pgrep::test_invalid_signal ... ok
test test_free::test_wide ... ok
test test_free::test_line ... ok
test test_pgrep::test_invalid_group_name ... ok
test test_pgrep::test_invalid_arg ... ok
test test_free::test_count_line ... ok
test test_pgrep::test_help ... ok
test test_pgrep::test_invalid_regex ... ok
test test_free::test_count ... ok
test test_free::test_unit ... ok
test test_pgrep::test_count_with_non_matching_pattern ... ok
test test_pgrep::test_current_user ... ok
test test_pgrep::test_newest_non_matching_pattern ... ok
test test_pgrep::test_lone_require_handler_is_allowed ... ok
test test_pgrep::test_list_full_process_with_empty_cmdline ... ok
test test_pgrep::test_non_matching_pattern ... ok
test test_pgrep::test_nonexisting_cgroup ... ok
test test_pgrep::test_nonexisting_pgroup ... ok
test test_pgrep::test_does_not_match_current_process ... ok
test test_pgrep::test_pidfile_invalid_content ... ok
test test_pgrep::test_nonexisting_session ... ok
test test_pgrep::test_pidfile_nonexistent_file ... ok
test test_pgrep::test_pidfile_not_locked ... ok
test test_pgrep::test_does_not_match_pid ... ok
test test_pgrep::test_older_non_matching_pattern ... ok
test test_pgrep::test_ignore_ancestors ... ok
test test_pgrep::test_env_key_match ... ok
test test_pgrep::test_older_matching_pattern ... ok
test test_pgrep::test_env_nonmatching_value ... ok
test test_pgrep::test_env_multiple_filters ... ok
test test_pgrep::test_env_nonexistent ... ok
test test_pgrep::test_env_key_value_match ... ok
test test_pgrep::test_too_many_patterns ... ok
test test_pgrep::test_parent_multiple_parents ... ok
test test_pgrep::test_oldest_non_matching_pattern ... ok
test test_pidof::test_find_init ... ignored, fails in CI
test test_pgrep::test_parent_non_matching_parent ... ok
test test_pidof::test_invalid_arg ... ok
test test_pgrep::test_count_with_matching_pattern ... ok
test test_pidof::test_no_args ... ok
test test_pgrep::test_list_full ... ok
test test_pgrep::test_pidfile_flock_locked ... ok
test test_pgrep::test_cgroup ... ok
test test_pgrep::test_newest ... ok
test test_pgrep::test_pidfile_fcntl_locked ... ok
test test_pidof::test_no_pid_found ... ok
test test_pgrep::test_pidfile_match ... ok
test test_pidwait::test_invalid_arg ... ok
test test_pidof::test_check_root_accepted ... ok
test test_pgrep::test_require_handler ... ok
test test_pidwait::test_no_args ... ok
test test_pidwait::test_too_many_patterns ... ok
test test_pkill::test_invalid_arg ... ok
test test_pgrep::test_pidfile_invert ... ok
test test_pkill::test_help ... ok
test test_pgrep::test_pidfile_no_match ... ok
test test_pkill::test_too_long_pattern ... ok
test test_pkill::test_too_many_patterns ... ok
test test_pkill::test_no_args ... ok
test test_pmap::test_create_rc_to ... ok
test test_pidof::test_threads ... ok
test test_pidof::test_quiet ... ok
test test_pmap::test_device_permission_denied ... ok
test test_pmap::test_existing_pid ... ok
test test_pmap::test_default_rc ... FAILED
test test_pmap::test_invalid_arg ... ok
test test_pmap::test_extended_permission_denied ... ok
test test_pgrep::test_full ... ok
test test_pgrep::test_runstates_invalid_runstate ... ok
test test_pmap::test_device ... ok
test test_pidof::test_find_kthreadd_only_with_w_flag ... ok
test test_pgrep::test_delimiter_last_wins ... ok
test test_pgrep::test_ignore_case ... ok
test test_pmap::test_no_args ... ok
test test_pmap::test_non_existing_pid ... ok
test test_pmap::test_permission_denied ... ok
test test_pmap::test_non_existing_and_existing_pid ... ok
test test_ps::test_invalid_arg ... ok
test test_pgrep::test_delimiter ... ok
test test_pmap::test_multiple_existing_pids ... ok
test test_pgrep::test_signal_that_never_matches ... ok
test test_pgrep::test_terminal_invalid_terminal ... ok
test test_pwdx::test_invalid_arg ... ok
test test_pgrep::test_terminal_multiple_terminals ... ok
test test_pwdx::test_no_args ... ok
test test_pgrep::test_parent ... ok
test test_pgrep::test_too_long_pattern ... ok
test test_slabtop::test_help ... ok
test test_slabtop::test_invalid_arg ... ok
test test_slabtop::test_once_as_non_root ... ok
test test_pgrep::test_older ... ok
test test_slabtop::test_without_args_as_non_root ... ok
test test_pgrep::test_oldest ... ok
test test_pidof::test_omit_pid ... ok
test test_slabtop::test_without_args_as_root ... ok
test test_snice::test_no_args ... ok
test test_slabtop::test_once_as_root ... ok
test test_snice::test_no_process_selected ... ok
test test_pgrep::test_pgroup ... ok
test test_sysctl::linux::test_continues_on_error ... ok
test test_pmap::test_more_extended ... ok
test test_sysctl::linux::test_get_key_only ... ok
test test_sysctl::linux::test_get_value_only ... ok
test test_sysctl::linux::test_get_simple ... ok
test test_pmap::test_extended ... ok
test test_sysctl::linux::test_ignoring_errors ... ok
test test_sysctl::test_invalid_arg ... ok
test test_tload::test_invalid_arg ... ok
test test_pmap::test_most_extended ... ok
test test_top::test_conflict_arg ... ok
test test_top::test_invalid_arg ... ok
test test_vmstat::test_invalid_arg ... ok
test test_vmstat::test_active ... ok
test test_pmap::test_read_rc_from ... ok
test test_vmstat::test_header ... ok
test test_vmstat::test_invalid_unit ... ok
test test_vmstat::test_invalid_number ... ok
test test_vmstat::test_simple ... ok
test test_vmstat::test_timestamp ... ok
test test_vmstat::test_unit ... ok
test test_w::test_help ... ok
test test_vmstat::test_wide_mode ... ok
test test_w::test_invalid_arg ... ok
test test_pidof::test_script ... ok
test test_watch::test_invalid_arg ... ok
test test_watch::test_invalid_interval ... ok
test test_pidwait::test_non_matching_pattern ... ok
test test_pkill::test_non_matching_pattern ... ok
test test_w::test_output_format ... ok
test test_pkill::test_inverse ... ok
test test_w::test_option_short ... ok
test test_w::test_no_header ... ok
test test_pgrep::test_session ... ok
test test_pgrep::test_runstates ... ok
test test_pidof::test_single_shot ... ok
test test_pidof::test_separator ... ok
test test_pmap::test_quiet_showpath ... ok
test test_pmap::test_quiet ... ok
test test_pgrep::test_unknown_terminal ... ok
test test_pgrep::test_terminal ... ok
test test_pgrep::test_valid_regex ... ok
test test_pwdx::test_non_existing_pid ... ok
test test_pwdx::test_valid_pid ... ok
test test_pmap::test_showpath ... ok
test test_pwdx::test_multiple_valid_pids ... ok
test test_pwdx::test_invalid_pid ... ok
test test_pwdx::test_invalid_and_valid_pid ... ok
test test_pwdx::test_non_existing_and_existing_pid ... ok
test test_ps::test_select_all_processes ... ok
test test_watch::test_interval_environment_variable ... ok
test test_watch::test_no_interval ... ok
test test_watch::test_valid_interval ... ok
test test_ps::test_code_mapping ... ok
test test_pgrep::test_threads ... ok
test test_vmstat::test_no_first ... ok
test test_watch::test_valid_interval_comma ... ok
test test_top::test_arg_p ... ok
test test_top::test_flag_user ... ok

failures:

---- test_pmap::test_default_rc stdout ----
bin: "/home/krysztal/Desktop/projects/procps/target/debug/procps"
run: /home/krysztal/Desktop/projects/procps/target/debug/procps pmap -c 42943

thread 'test_pmap::test_default_rc' panicked at tests/by-util/test_pmap.rs:31:49:
Command was expected to fail.
stdout = 42943:   /home/krysztal/Desktop/projects/procps/target/debug/deps/tests-eb57e1d8ed2dfe6f
         Address 
000058a6ee5ba000 
000058a6ee634000 
000058a6eea23000 
000058a6eeb2f000 
000058a6eeb89000 
000058a71e52c000 
00007e1144000000 
00007e1144021000 
00007e114c000000 
00007e114c021000 
000
8000
07e1150000000 
00007e1150021000 
00007e1154000000 
00007e1154021000 
00007e115c000000 
00007e115c021000 
00007e1160000000 
00007e1160021000 
00007e1164000000 
00007e1164021000 
00007e116c000000 
00007e116c021000 
00007e1170000000 
00007e1170021000 
00007e1174000000 
00007e1174021000 
00007e1178000000 
00007e1178021000 
00007e117c000000 
00007e117c021000 
00007e1180000000 
00007e1180021000 
00007e1184000000 
00007e1184021000 
00007e1188000000 
00007e1188021000 
00007e118c000000 
00007e118c021000 
00007e1190000000 
00007e1190021000 
00007e1194000000 
00007e1194021000 
00007e1198000000 
00007e1198021000 
00007e119c000000 
00007e119c021000 
00007e11a0000000 
00007e11a0021000 
00007e11a4000000 
00007e11a4021000 
00007e11a8000000 
00007e11a8021000 
00007e11ac000000 
00007e11ac021000 
00007e11b0000000 
00007e11b0021000 
00007e11b4000000 
00007e11b4021000 
00007e11b8000000 
00007e11b8021000 
00007e11bc000000 
00007e11bc021000 
00007e11c0000000 
00007e11c0021000 
00007e11c4000000 
00007e11c4021000 
00007e11c8000000 
00007e11c8021000 
00007e11cc000000 
00007e11cc021000 
00007e11d4000000 
00007e11d4021000 
00007e11d8000000 
00007e11d8021000 
00007e11dc000000 
00007e11dc021000 
00007e11e0000000 
00007e11e0021000 
00007e11e4000000 
00007e11e4021000 
00007e11ec000000 
00007e11ec021000 
00007e11f4000000 
00007e11f405a000 
00007e11f9def000 
00007e11f9df0000 
00007e11f9ff0000 
00007e11f9ff1000 
00007e11fa1f1000 
00007e11fa1f2000 
00007e11fa3f2000 
00007e11fa3f3000 
00007e11fa5f3000 
00007e11fa5f4000 
00007e11fa7f4000 
00007e11fa7f5000 
00007e11fa9f5000 
00007e11fa9f6000 
00007e11fabf6000 
00007e11fabf7000 
00007e11fadf7000 
00007e11fadf8000 
00007e11faff8000 
00007e11faff9000 
00007e11fb1f9000 
00007e11fb1fa000 
00007e11fb3fa000 
00007e11fb3fb000 
00007e11fb5fb000 
00007e11fb5fc000 
00007e11fb7fc000 
00007e11fb7fd000 
00007e11fb9fd000 
00007e11fb9fe000 
00007e11fbbfe000 
00007e11fbbff000 
00007e11fbdff000 
00007e11fbe00000 
00007e11fc000000 
00007e11fc021000 
00007e1200000000 
00007e1200021000 
00007e1204000000 
00007e1204021000 
00007e1208000000 
00007e1208021000 
00007e120c000000 
00007e120c021000 
00007e1210000000 
00007e1210021000 
00007e1214000000 
00007e1214021000 
00007e1218000000 
00007e1218054000 
00007e121c000000 
00007e121c021000 
00007e1220000000 
00007e1220021000 
00007e1224000000 
00007e1224021000 
00007e1228000000 
00007e1228021000 
00007e122c000000 
00007e122c021000 
00007e1230000000 
00007e1230021000 
00007e1234000000 
00007e12340cc000 
00007e1238000000 
00007e1238021000 
00007e123c000000 
00007e123c0b4000 
00007e1240000000 
00007e1240021000 
00007e1244000000 
00007e1244021000 
00007e1248000000 
00007e1248021000 
00007e124c000000 
00007e124c0b6000 
00007e1250000000 
00007e1250021000 
00007e1254000000 
00007e1254030000 
00007e1258000000 
00007e1258028000 
00007e125c000000 
00007e125c021000 
00007e1260000000 
00007e12600c2000 
00007e12641e1000 
00007e12641e2000 
00007e12643e2000 
00007e12643e3000 
00007e12645e3000 
00007e12645e4000 
00007e12647e4000 
00007e12647e5000 
00007e12649e5000 
00007e12649e6000 
00007e1264be6000 
00007e1264be7000 
00007e1264de7000 
00007e1264de8000 
00007e1264fe8000 
00007e1264fe9000 
00007e12651e9000 
00007e12651ea000 
00007e12653ea000 
00007e12653eb000 
00007e12655eb000 
00007e12655ec000 
00007e12657ec000 
00007e12657ed000 
00007e12659ed000 
00007e12659ee000 
00007e1265bee000 
00007e1265bef000 
00007e1265def000 
00007e1265df0000 
00007e1265ff0000 
00007e1265ff1000 
00007e12661f1000 
00007e12661f2000 
00007e12663f2000 
00007e12663f3000 
00007e12665f3000 
00007e12665f4000 
00007e12667f4000 
00007e12667f5000 
00007e12669f5000 
00007e12669f6000 
00007e1266bf6000 
00007e1266bf7000 
00007e1266df7000 
00007e1266df8000 
00007e1266ff8000 
00007e1266ff9000 
00007e12671f9000 
00007e12671fa000 
00007e12673fa000 
00007e12673fb000 
00007e12675fb000 
00007e12675fc000 
00007e12677fc000 
00007e12677fd000 
00007e12679fd000 
00007e12679fe000 
00007e1267bfe000 
00007e1267bff000 
00007e1267dff000 
00007e1267e00000 
00007e1268000000 
00007e1268021000 
00007e126c1a9000 
00007e126c1aa000 
00007e126c3aa000 
00007e126c3ab000 
00007e126c5ab000 
00007e126c5ac000 
00007e126c7ac000 
00007e126c7ad000 
00007e126c9ad000 
00007e126c9ae000 
00007e126cbae000 
00007e126cbaf000 
00007e126cdc2000 
00007e126cdc3000 
00007e126cdc8000 
00007e126cdc9000 
00007e126cdcb000 
00007e126cdcc000 
00007e126cdce000 
00007e126cdcf000 
00007e126cdd1000 
00007e126cdd2000 
00007e126cdd4000 
00007e126cdd5000 
00007e126cdd7000 
00007e126cdd8000 
00007e126cdda000 
00007e126cddb000 
00007e126cddd000 
00007e126cdde000 
00007e126cde0000 
00007e126cde1000 
00007e126cde3000 
00007e126cde4000 
00007e126cde6000 
00007e126cde7000 
00007e126cde9000 
00007e126cdea000 
00007e126cdec000 
00007e126cded000 
00007e126cdef000 
00007e126cdf0000 
00007e126cdf2000 
00007e126cdf3000 
00007e126cdf5000 
00007e126cdf6000 
00007e126cdf9000 
00007e126cdfa000 
00007e126cdfc000 
00007e126cdfd000 
00007e126cdff000 
00007e126ce00000 
00007e126ce02000 
00007e126ce03000 
00007e126ce05000 
00007e126ce06000 
00007e126ce08000 
00007e126ce09000 
00007e126ce0b000 
00007e126ce0c000 
00007e126ce0e000 
00007e126ce0f000 
00007e126ce11000 
00007e126ce12000 
00007e126ce14000 
00007e126ce15000 
00007e126ce17000 
00007e126ce18000 
00007e126ce1a000 
00007e126ce1b000 
00007e126ce1d000 
00007e126ce1e000 
00007e126ce20000 
00007e126ce21000 
00007e126ce23000 
00007e126ce24000 
00007e126ce26000 
00007e126ce27000 
00007e126ce29000 
00007e126ce2a000 
00007e126ce2c000 
00007e126ce2d000 
00007e126ce2f000 
00007e126ce30000 
00007e126ce32000 
00007e126ce33000 
00007e126ce35000 
00007e126ce36000 
00007e126ce38000 
00007e126ce39000 
00007e126ce3b000 
00007e126ce3c000 
00007e126ce3e000 
00007e126ce3f000 
00007e126ce41000 
00007e126ce42000 
00007e126ce44000 
00007e126ce45000 
00007e126ce47000 
00007e126ce48000 
00007e126ce4a000 
00007e126ce4b000 
00007e126ce4d000 
00007e126ce4e000 
00007e126ce50000 
00007e126ce51000 
00007e126ce53000 
00007e126ce54000 
00007e126ce56000 
00007e126ce57000 
00007e126ce59000 
00007e126ce5a000 
00007e126d05a000 
00007e126d05b000 
00007e126d25b000 
00007e126d25c000 
00007e126d45c000 
00007e126d45d000 
00007e126d65d000 
00007e126d65e000 
00007e126d660000 
00007e126d661000 
00007e126d663000 
00007e126d664000 
00007e126d666000 
00007e126d667000 
00007e126d669000 
00007e126d66a000 
00007e126d66c000 
00007e126d66d000 
00007e126d86d000 
00007e126d86e000 
00007e126d870000 
00007e126d871000 
00007e126d873000 
00007e126d874000 
00007e126d876000 
00007e126d877000 
00007e126da77000 
00007e126da78000 
00007e126dc78000 
00007e126dc79000 
00007e126de79000 
00007e126de7a000 
00007e126e07a000 
00007e126e07b000 
00007e126e27b000 
00007e126e27c000 
00007e126e47c000 
00007e126e47d000 
00007e126e67d000 
00007e126e680000 
00007e126e6a8000 
00007e126e80d000 
00007e126e863000 
00007e126e867000 
00007e126e869000 
00007e126e876000 
00007e126e87a000 
00007e126e89d000 
00007e126e8a1000 
00007e126e8a2000 
00007e126e8a4000 
00007e126e8a5000 
00007e126e8a7000 
00007e126e8a8000 
00007e126e8aa000 
00007e126e8ab000 
00007e126e8ad000 
00007e126e8ae000 
00007e126e8b0000 
00007e126e8b1000 
00007e126e8b3000 
00007e126e8b4000 
00007e126e8b6000 
00007e126e8b7000 
00007e126e8b9000 
00007e126e8ba000 
00007e126e8bc000 
00007e126e8bd000 
00007e126e8bf000 
00007e126e8c0000 
00007e126e8c1000 
00007e126e8c2000 
00007e126e8c4000 
00007e126e8c6000 
00007e126e8ca000 
00007e126e8cc000 
00007e126e8cd000 
00007e126e8f5000 
00007e126e900000 
00007e126e902000 
00007e126e903000 
00007fffa1c46000 
ffffffffff600000 

 stderr = 
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


failures:
    test_pmap::test_default_rc

test result: FAILED. 165 passed; 1 failed; 1 ignored; 0 measured; 0 filtered out; finished in 2.51s

error: test failed, to rerun pass `--test tests`

It seems will create the .pmaprc at my home directory at the first time run cargo test and will failed the test at the second time to run it.

Comment on lines 25 to 46
fn test_default_rc() {
let pid = process::id();
let ts = TestScenario::new(util_name!());

// Fails to read before creating rc file
for arg in ["-c", "--read-rc"] {
ts.ucmd().arg(arg).arg(pid.to_string()).fails().code_is(1);
}

// Create rc file
ts.ucmd().arg("-n").succeeds();

// Fails to create because rc file already exists
for arg in ["-n", "--create-rc"] {
ts.ucmd().arg(arg).fails().code_is(1);
}

// Succeeds to read now
for arg in ["-c", "--read-rc"] {
ts.ucmd().arg(arg).arg(pid.to_string()).succeeds();
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can run the functionality of this test in the CI only, otherwise the test will fail if there is already a .pmaprc in the home directory. Using is_ci() should d 8000 o the trick.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you both!
As @cakebaker mentioned, test_default_rc is meant to be run in CI; otherwise you’d need to delete ~/.pmaprc before each run. I've updated the test to ensure it always runs in CI, as suggested.

estodi and others added 2 commits July 3, 2025 23:02
Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
@cakebaker cakebaker merged commit e6261fa into uutils:main Jul 3, 2025
16 checks passed
@cakebaker
Copy link
Contributor

Thanks!

Copy link
codecov bot commented Jul 3, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 0.00%. Comparing base (e8c56a5) to head (2e0ebf4).
Report is 4 commits behind head on main.

Additional details and impacted files
@@     Coverage Diff     @@
##   main   #456   +/-   ##
===========================
===========================

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

cakebaker added a commit to cakebaker/procps that referenced this pull request Jul 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0