ChrootableTarget: restore resolv.conf after rename if copy fails
If the copy of resolv.conf after a rename of an in-target resolv.conf
fails we will end up removing the in-target resolv.conf. Fix this by
checking if we renamed and if so restore the file before we remove
the temporary directory that was holding the original resolv.conf.
util.ChrootableTarget: skip rename of resolv.conf if not present in target
A target OS may not include an /etc/resolv.conf. ChrootableTarget attempts
to move the in-chroot resolv.conf out of the way and copy in the host
resolv.conf. If the target image does not have /etc/resolv.conf then we
fail when we call os.rename. Avoid this error by only invoking the
rename if the target image has a resolv.conf.
Raising SkipTest in class definition breaks the test loader
resulting in tools/vmtest-sync-images failing. Remove skipTest
and leave the message as a comment.
vmtests: determine block name via dname when verifying volume groups
The LVM tests verify `pvs` output to check that a VG is composed of
the specified devices from the storage config. The current test
expected /dev/sda, /dev/sdb for certain VGs, however, sda/sdb kernel
names are not stable and sometimes we would fail to verify when the
order was swapped. Instead we now look up the dname, which is stable
to determine the kname of the specific disk at runtime and use that
to verify the VG is composed of the correct devices.
vmtest: add Centos66/Centos70 FromBionic release and re-add tests
Newer MAAS will use Bionic to deploy Centos and curtin until now
did not test this path. Critically, Centos66 has issues with ext4
features that are enabled by default in Bionic and newer, namely
'64bit' and 'metadata_csum'. These features break centos66 grub
probing which results in failed deployment, LP: #1775424.
Add additional Centos66/70 tests to verify installing from Bionic
is successful. For Centos66, we test the known workaround which is
to use 'ext3' as the root filesystem, and we introduce a test-case
which recreates the failure (test_simple.py:Centos66BionicTestSimple)
but leave it disabled by default.
block-discover: add cli/API for exporting existing storage to config
Curtin can now probe an existing system for block devices and convert that
information into a storage_config yaml document representing the devices,
partitions, filesystems, etc as they would be if created from scratch.
This cli and API depend upon probert for discovery and
curtin.storage_config.validate_config to generate valid configs.
Eoan images no longer contain 'route' and 'route6' from 'net-tools'
package. If the output is not present, rely on 'ip route show' and
'ip 6 route show' output instead.