[libvirt] [PATCH v5 8/9] nss: Introduce a test

Martin Kletzander mkletzan at redhat.com
Fri Mar 18 14:12:14 UTC 2016


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 at 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 ;)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20160318/bff75d99/attachment-0001.sig>


More information about the libvir-list mailing list