On Tue, Feb 28, 2012 at 10:16 AM, Laine Stump <laine@laine.org> wrote:
On 02/28/2012 12:56 PM, hiren panchasara wrote:


On Mon, Feb 27, 2012 at 6:08 PM, Laine Stump <laine@laine.org> wrote:
What I understand is, when "dumpxml em0" is called, if em0 is an ethernet interface whose address has been provided by dhcp, the o/p *must* look like [1] and if address is statically allocated, o/p *must* look like [2]. Please correct me if that is not accurate.
Thanks Laine!

As I mentioned earlier, we are trying to make netcf work with FreeBSD (https://github.com/seanbruno/fbsd-netcf). We have decided not to use augeas, so we need to do all xml handling our own with libxml2/libxslt. Because of that we need to do a lot of if/else handling for different possibilities of interface configuration.

My question is, is there a way (besides interface.rng) to verify whether our dumpxml is working correctly?


This won't tell you if it correctly represents the config as it is on disk, but it will tell you if it follows the RNG:

   xmllint --relaxng interface.rng --noout somefile.xml

(where somefile.xml contains the output of dumpxml)

This will help.

Thank you,
Hiren