[LTP] [PATCH v3] network/lib6/getaddrinfo01: rewrite with the new API + use static hostnames

Petr Vorel pvorel@suse.cz
Tue Jun 1 12:09:09 CEST 2021


Hi Alexey,

> The test is now independent of various machine settings
> regarding the test host name as it adds predefined names
> and aliases to /etc/hosts file and restores it to its
> original state after completing the test.

> This should fix the following failures:
> * when gethostname() returns an alias name that doesn't
>   match canonical name;
> * No AAAA record for the returned name from gethostname().

> Addresses and names added to /etc/hosts are more or less
> unique, so that there are no conflicts with the existing
> configuration.

> Also most of the duplicate code is now gone.
...
> -	tst_resm(TPASS, "getaddrinfo IPv6 SOCK_STREAM/IPPROTO_UDP hints");
> +	if (access(host_file, W_OK))
I guess we don't have to bother with R_OK|W_OK (required R_OK for SAFE_CP()),
as no sane system would have disabled read permission on hosts file.

Reviewed-by: Petr Vorel <pvorel@suse.cz>

Thanks!

Kind regards,
Petr


More information about the ltp mailing list