[PATCH master] Add tests for network --device missing and --device=link

Chris Lumens clumens at redhat.com
Wed Jun 3 18:39:43 UTC 2015


> These are only for one one NIC available.

If you need the ability to set up more than one NIC, we should be able
to allow that by passing additional --network= options to virt-install.
It shouldn't be much work to set that up - probably pretty similar to
the disk stuff.  It just hasn't been needed yet, so I haven't done
anything for it.

> I am wondering what resources we'll need to run kickstart
> tests if only for this issue (and for one NIC case only) I created
> seven tests. Which made me think whether unit tests wouldn't be
> more appropriate here. They would be harder to write.
> And we also want to check that the ks ifcfg file is not only generated
> but also not overwritten by dracut ifcfg file. And in one of the tests
> we want to check that ksdevice is honored as default --device (actually
> Jiri has a patch making this work), so perhaps really integration tests.

I think in your tests here, you need to add more stuff to the %post to
check more stuff on the system.  For instance, you are checking for the
existence of ifcfg-* files, but not really the content.  Is there
something in those files that can be checked to verify anaconda did what
you wanted it to do?

I think you're right in that some may make sense more as unit tests in
pyanaconda_tests/network_tests.py, but there's definite value in also
testing at the level you are doing now - does the network get set up
correctly after having gone all the way through the installation
process?  That's different than just testing network.py, because
something else could have screwed up.  So, I probably wouldn't worry
about converting these into unit tests unless they test something very
narrow.

Finally, I think Jiri already covered the hostname part, right?

- Chris


More information about the anaconda-patches mailing list