On Tue, Mar 15, 2016 at 06:05:55PM +0100, Michal Privoznik wrote:
A small test to see how is the nss module working.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
cfg.mk | 2 +-
tests/Makefile.am | 18 ++++
tests/nssdata/virbr0.status | 20 +++++
tests/nssdata/virbr1.status | 20 +++++
tests/nssmock.c | 140 +++++++++++++++++++++++++++++
tests/nsstest.c | 208 ++++++++++++++++++++++++++++++++++++++++++++
6 files changed, 407 insertions(+), 1 deletion(-)
create mode 100644 tests/nssdata/virbr0.status
create mode 100644 tests/nssdata/virbr1.status
create mode 100644 tests/nssmock.c
create mode 100644 tests/nsstest.c
[...]
+ if (resolved.h_addrtype == AF_INET) {
+ /* For some reason, virSocketAddrSetIPv4Addr does htonl() conversion.
+ * But the data we already have is in network order. */
+ virSocketAddrSetIPv4Addr(&sa, ntohl(*((uint32_t *) *addrList)));
I would rather we didn't call at all instead of twice, but that's
something we can change later on. We can live with that for now ;)