libc/tests: keep hostname during sethostname_test.
CI: https://ci.freebsd.org/job/FreeBSD-main-amd64-test/26164/testReport/lib.libc.gen/sethostname_test/
Workflow:
- Record the original hostname.
- Tests(Modifying the hostname).
- Restore the hostname.
I am not sure if there's extended issue.
UPD1:
The original issue is that the variable host is not initialized properly due to the complicated process fork relationship.
I'm not sure if the changes @Rin0913 pushed are all that are needed, but in any case I think another round of review is needed.
@bsdimp
Thank you for replying. Which part do you think is unnecessary? Or should we keep this test skipped?
@bsdimp
Thank you for replying. Which part do you think is unnecessary? Or should we keep this test skipped?
I think that this just needs review. Anything else I was either confused about or I was badly communicating.
@kprovost
What do you think? Should we use jail which would affect all other tests if we just simplify specify the jail using on Makefile. Or just fix the bug causing hostname screwed.