mirror of
https://github.com/xcat2/xcat-core.git
synced 2026-11-22 10:22:18 +00:00
5c249f499e
makehosts reads the address test in four places. The branch widened all four from isIpv4addr to isValidIp so an IPv6 hosts.ip reaches /etc/hosts, and only addotherinterfaces had a test. Narrowing add_hosts_content, delotherinterfaces or the no-noderange path back to isIpv4addr left the whole unit suite passing, so three of the four changes measured nothing. The no-noderange path had no sub to call: its loop sat inside process_request, which opens /etc/hosts and takes a lock. Move that loop to add_all_hosts_content, which takes the hosts table rows and answers the node names, and leave the table read, donics and writeout in process_request. The domain carry-over between rows is kept as it was. makehosts_ipv6.t now drives each of the three remaining places with an IPv6 address and reads the host entries it produced. Each one fails on its own assertion when its address test is narrowed back to isIpv4addr. Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>