test_hostid.rs lacks test cases with frozen ip addr e.g. unshare -ru sh -c "hostname 127.0.0.1 && hostid"

Open Beginner friendly
#16,431 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@costajohnt is already working on this.

Since Nov 14, 2026.

  • #16444 by @costajohnt — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
62/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
rust
Domain
testing

Research direction

The existing checks live in test_hostid.rs, which only matches a regex on the output. Read it first to see how the other test cases run the hostid binary. Add one case that wraps the run in unshare -ru sh -c "hostname 127.0.0.1 && ..." and expects 007f0100. Done when cargo test hostid passes on Linux with user namespaces enabled.

Written by the indexing model from the issue text.

Description

U - hostid

test_hostid lacks test cases with frozen ip addr. It just checks regex.
We should have 1 example at least for.

$ unshare -ru sh -c "hostname 127.0.0.1 && /home/a/bin/gnu9.12/hostid"
007f0100
$ unshare -ru sh -c "hostname 127.0.0.1 && target/debug/hostid"
007f0100
Dominant language
Rust
Stars
24.4k
Forks
2.2k
Avg merge
3d 6h
Merged PRs (30d)
434

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from uutils/coreutils

All issues in uutils/coreutils

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.