Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID:
 <TYSPR01MB62211EECB201FEFBB44EA565F0992@TYSPR01MB6221.apcprd01.prod.exchangelabs.com>
Date: Mon, 9 Sep 2024 14:46:22 +0000
From: Ryan Ward <rwardd@...look.com.au>
To: Rich Felker <dalias@...c.org>
CC: Szabolcs Nagy <nsz@...t70.net>, "musl@...ts.openwall.com"
	<musl@...ts.openwall.com>
Subject: Re: Adding dns/resolver tests to libc-test

> My intent was that you call enter_dns_test_ns from the test process
> itself, not from a separate wrapper to exec it. This is so you don't
> end up having a program in the tests dir that, when executed
> independently as root, clobbers the host system's resolv.conf or hosts
> file (which would be really really bad). By entering the namespace in
> the same process and testing for error, you can bail out before doing
> anything if the namespace setup failed. This also avoids the need to
> add extra control machinery to run the tests.

No problems, understood, I saw the exec call in the unshare-ns.c file 
and got confused. I have refactored the test attached, and added the 
unshare-ns.c file to the src/common/ directory in libc-test, and exposed
the enter_dns_test_ns method in the test.h header file. Is this an 
appropriate solution?

The attached res_query test tests for expected domain names, classes,
types and response data from given requests. I'm yet to implement TCP
or IPV6, and wanted to ask if v4/v6 should be in separate test files, 
as to ensure the test files aren't too long-winded. I've tried to structure
the test so it's as simple as specifying a domain name, and its expected RR 
data. The test just then iterates through the domains to test, the server returns
the hardcoded packets, and checks are performed.

Is this somewhat along the lines of what you are looking for?

Thanks,
rw

View attachment "resolv_query.c" of type "text/x-csrc" (9256 bytes)

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.