summaryrefslogtreecommitdiff
path: root/tests/vmtests/test_basic.py
AgeCommit message (Collapse)Author
2024-03-21py3.12: fix test deprecationsDan Bungert
Swap two unittest deprecated calls for their supported coutnerparts * s/assertRaisesRegexp/assertRaisesRegex/ * s/assertEquals/assertEqual/ Also fix whitespace lint issues created from doing the above.
2023-11-16vmtests: skip all failing tests to get the jobs green againFlorent 'Skia' Jacquet
2023-09-26Revert "vmtests: add mantic after jammy"Dan Bungert
This reverts commit abebab1e1e30a16d4be891a051060e81254ff0c5.
2023-09-20vmtests: add mantic after jammyDan Bungert
2023-09-20vmtests: add jammy after focalChad Smith
(cherry picked from commit 7c7c29b008128ee5476cfa82b24762c18a0d2fcc)
2023-09-20vmtests: remove hirsuteChad Smith
(cherry picked from commit 5acd262e37cd3f2ae2b6134bf568806bd2736b0e)
2023-09-20vmtests: remove impishChad Smith
(cherry picked from commit 48e5bc483e15d56b456fe629c8a9544cf61d8d64)
2022-02-24Remove CentOS 6 tests.Michael Hudson-Doyle
It's EOL, the required images are no longer in the MAAS image streams and at least one vmtest fails if you manage to run it somehow.
2021-08-10vmtests: s/Groovy/ImpishDan Bungert
* Use vmtest-{add,remove}-release to remove Groovy, and add Impish. * vmtest-{add,remove}-release: set default path
2021-01-14vmtest: add Hirsute release classes, tool to add vmtest classRyan Harper
Add a tool to generate new release classes based on a previous release, for example: ./tools/vmtest-add-release -p tests/vmtests \ --previous-release=focal --distro-release=hirsute User still needs to create the release class in tests/vmtests/releases.py
2020-07-29vmtests: add GroovyParide Legovini
2020-07-16Drop the Eoan vmtests (EOL)Paride Legovini
2020-06-23swaps: handle swapfiles on btrfsRyan Harper
Special care and handling are needed for creating swap files on top of btrfs filesystems. Curtin will attempt to disable btrfs CoW on the target file before attempting to fallocate/dd the file. - Btrfs swapfile requires target kernel 5.0+, older kernels cannot use.   https://btrfs.wiki.kernel.org/index.php/FAQ - Query target fstype to check if we can proceed with swap file   btrfs requires newer kernel, xfs cannot use fallocate - Update distro.parse_dpkg_version to handle additional formatting   including linux-image-generic, and versions with Epoch present. - Adjust TestBasic,TestScsiBasic to add a swapfile to the /btrfs target - Add the swap partition/file to TestBasic's fstab unittest - Fix test_swaps_used to use fstab data instead of storage config   since file-based swaps are created via curtin 'swap' config not   storage-config. - Add swap config key 'force', default is false - Add curtin feature flag, BTRFS_SWAPFILE LP: #1884161
2020-05-28vmtests: update skiptestsRyan Harper
- Drop skiptests for vlan issue, now fixed - Drop skiptest on Ubuntu ReuseESP tests - Add skiptest for Centos, new Bug #1881030 - Drop skip-by-date for CentosTestScsiBasic Bug #1859858 is fixed - Bump skip_by_date on tests with bcache by-uuid symlinks,   Bug #1861951 not fixed yet.
2020-04-27vmtest: basic/basic_scsi adjust collect/tests for unstable device namesRyan Harper
- For virtio-disks (TestBasic) use dname, except on centos66, use the byid serial name. - For scsi-disks (TestScsiBasic) use wwn everywhere LP: #1874100
2020-04-20vmtest: basic use dname to lookup disk with multiple partitionsRyan Harper
This handles unstable scsi device names (sdc/sdd) which shuffle around from time to time; instead look up the assigned name via the dname value. This should fix vmtest failures on BasicScsi on ppc64le/arm64.
2020-03-12vmtest: Fix test_basic.py to run on s390xRyan Harper
The TestBasic currently fails on s390x due to usage of virtio-disks and an "empty" virtio-scsi device controller. There is an existing bug in s390x firmware that does not like an "empty" virtio-scsi controller. Until that bug is fixed, skip TestBasic on s390x and instead make TestScsiBasic work. This requires capturing output of /dev/disk/by-path as s390x fstab entries prefer by-path as paths on s390x are stable[1]. 1. https://wiki.ubuntu.com/FSTAB LP: #1866663
2020-02-04vmtests: drop disco tests using a tool to automate the processRyan Harper
Remove disco tests, adding a new tool which can automate removal of tests that match the release name.
2020-01-29block_meta: use reliable fs_spec entries for block devicesRyan Harper
Entries in /etc/fstab currently use UUID= in almost all cases. This is not reliable in the face of LVM snapshots, multipath, and other scenarios where multiple block devices may have the same UUID values. Resolve this by following the recommendations in the Ubuntu Wiki[1] where we will use specific udev persistent block paths which embed a *device* uuid in the path (dm-uuid, md-uuid, etc). In addition to modifying the fs_spec value we write, also include a comment above each entry which includes a terse device path which may help users recogize a disk where a UUID will not. This brings curtin to parity with other Ubuntu installers which include: # /mnt was mounted on /dev/sdb1 during installation LP: #1851899
2020-01-16vmtests: skip Focal deploying Centos70 ScsiBasicRyan Harper
In Focal, there is a bug (#1859858) in udev which returns a truncated value for ID_SERIAL on some scsi devices; this does not break dname rules when the ephemeral environment matches the target system, however if Focal deploys Bionic or in this case Centos70, the udev in the target system produces a different ID_SERIAL value which prevents the dname rules from matching. Skip this test until we get a udev fix.
2020-01-09vmtests: Add Focal FossaRyan Harper
- Add the new release - Switch some old Cosmic cases to Disco - Add CentosXXFromFocal relbase - Bump Skip-by dates for lvmroot, MTU and VLAN issues
2019-10-24vmtest: Adjust TestScsiBasic to use dnames to find correct diskRyan Harper
The TestScsiBasic test has some assumptions on which SCSI device will have expected content. On PPC64, the PCI device enumeration is not as stable as it is on x86 resulting in test failures. This patch resolves this by leveraging the dname values and looking up the correct kernel name for a specific target dname.
2019-09-25vmtest: enable arm64Paride Legovini
* Call qemu with the correct -machine/-cpu options * Default to UEFI boot * Boot the Ubuntu "ga" arm64 kernel * Disable the unsupported configurations (e.g. CentOS tests) vmtest: bump the VM memory for Cosmic to 2GB
2019-09-25Make the vmtests/test_basic test suite run on ppc64elParide Legovini
Changes:  - On ppc64el inject a PReP partition to the storage configuration  - Expect a GPT partition table and not a DOS one on ppc64el  - Skip XenialGAi386TestBasic if target_arch != amd64  - Skip XenialGAi386TestZfsRoot if target_arch != amd64  - Skip XenialGAi386TestZfsRootFsType if target_arch != amd64  - Skip test_partition_is_zero on ppc64el (LP: #1843288)  - Skip all the CentOS tests if target_arch = ppc64el
2019-09-24vmtests: separate arch and target_arch in testsParide Legovini
In tests 'arch' is now the arch of the host system, while target_arch is the architecture the test targets. By default target_arch = arch. Modify find_arches() to return all the target arches which not excluded with arch_skip.
2019-07-29vmtest: drop Cosmic test casesRyan Harper
2019-06-25vmtests: drop skip_by_date decorators for bug 1813228Daniel Watkins
These are now passing, so we no longer need to skip them.
2019-06-05vmtest: add Centos66/Centos70 FromBionic release and re-add testsRyan Harper
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.
2019-05-16block: support multipath devices in lookup and partition_knameRyan Harper
- Add support for detecting multipath devices and members - Add handling to clear-holders for removing multipath partitions - Update block.lookup_disk to return multipath member devices - Add support to "hide" a multipath dm device while operating on a single path member. - vmtest: update xkvm to pass serial/wwn correctly for multipath udev rules - vmtest: update basic_scsi configuration and drop unused extra disk. LP: #1813228
2019-05-09vmtest: add eoan testsParide Legovini
2019-05-08vmtest: disable disco multipath testRyan Harper
Disco images now contain multipath packages and daemon enabled. This affects how partitions are found when the underlying disk is mpath enabled. This will be addressed in another branch, for now disable the tests affected until it lands.
2019-05-06vmtest: disable trusty, it's dead jimRyan Harper
Trusty is EOL now, we can drop Trusty in vmtest to recover some of that sweet, sweet CPU and IO time.
2019-04-01Add support for s390 DASD devicesRyan Harper
2018-11-29dname: persistent names based on serial or wwnRyan Harper
Currently /dev/disk/by-dname symlinks are not created if a device does not have a partition table or a super block. For devices which do have a serial or wwn number, curtin will append an additional rule to the disk rules file which includes both the partition table/superblock UUID as well as rule matching the device provided serial or wwn. This ensures that even if a block device is wiped that the dname will continue to function. Other changes: - add method to discover udev database value of a block device ID_SERIAL value. - refactor nvme vmtests to use 'serial' values - don't hardcode nvme serials based on their enumerated index - ensure we pass nvme serials to both install and boot phases - update disks_to_check for basic and nvme to ensure we have a dname for the disk itself LP: #1735839
2018-11-16vmtest: add disco testsJoshua Powers
2018-11-09block_meta: use wipe config when clearing partitionsRyan Harper
The partition handler in block_meta would wipe in "superblock" mode before creating a partition but this only clears 1MB at the start of the partition. Curtin needs to respect the wipe mode which may wipe the location of the device differently. Also: - Document pre-partitioning superblock wiping   - Add PReP GPT config to basic/basic_scsi test - Sync basic and basic_scsi partition config - collect ls -al on /dev/disk/by-partuuid LP: #1800153
2018-10-17vmtests: fix common collect scripts to not exit failure.Scott Moser
If collect scripts exit non-zero, then cloud-init in the booted system will complain that they have done so. This adds noise to logs. At this point, the only command in a long list that affects the exit code is the last one. At some point in the future we may have more systematic collection. At that point it might make sense to exit if the collection failed. For now, just exit 0.
2018-09-21Enable custom storage configuration for centos imagesRyan Harper
Add support for the majority of storage configurations including partitioning, lvm, raid, iscsi and combinations of these. Some storage configs are unsupported at this time:  Unsupported storage config options on Centos:   - bcache (no kernel support)   - zfs (no kernel support)   - jfs, ntfs, reiserfs (no kernel, userspace support) Curtin's built-in curthooks now support Centos in addition to Ubuntu. The built-in curthooks are now callable by in-image curthooks. This feature is announced by the presence of the feature flag, 'CENTOS_CURTHOOK_SUPPORT' Other notable features added: - tools/jenkins-runner now includes a test filtering ability which enables generating the list of tests to run by specifying attributes of the classes. For example to run all centos70 tests append: --filter=target_release=centos70 - curtin/distro.py includes distro specific methods, such as package install and distro version detection - util.target_path has now moved to curtin.paths module
2018-07-20tests: remove Ubuntu ArtfulJoshua Powers
Ubuntu Artful has reached EOL and as such this removes the Artful tests.
2018-06-27vmtests: always declare certain attributes and remove redundant tests.Scott Moser
Simplify some code in vmtests by making sure that tests each have release, distro, target_release, target_distro. Then remove some redundant test cases for > artful and debug use of 'btrfs inspect-internal'.
2018-06-27vmtests: Add Cosmic release to testsJoshua Powers
2018-05-17zfs: implement a supported check to handle i386Ryan Harper
The zfs kernel module is not available for i386 so curtin cannot expect that missing that module is fatal. Concentrate the various checks for when we load the zfs kernel module into the zfs python module. Add vmtest to exercise the i386 path. LP: #1768709
2018-04-19make_dname for bcache should use backing device uuidRyan Harper
bcache minor numbers are not stable across reboots which means the dname symlinks pointing to a bcacheN isn't going to be stable either. Instead, build a udev rule that links the backing device's bcache uuid to the assigned dname. Additionally also update the backing device 'label' sysfs attribute with the dname value. This does rely on changes to bcache-tools to trigger the rules, currently there is a kernel bug (LP: #1729145) which is pending, and a user-space workaround in bcache-tools (LP: #1728742). Either is sufficent for the updated rules to be effective. Some additional fixes found during this work command/curthooks.py - don't append .rule to rule files, they already have .rule examples/tests/mdadm_bcache_complex.yaml - removed, duplicate of mdadm_bcache.yaml
2018-01-19Make license headers and file footers consistent and simplify.Scott Moser
There is no actual code change here. The changes are a.) move LICENSE file to LICENSE-AGPLv3 b.) put short form of AGPL-v3 license in LICENSE file, and mention Copyright info there. c.) remove license headers in python or shell files. d.) put a single line header in all python or shell files. e.) put a single footer line in all python or shell files. There is a change here from "AGPLv3 or later" to just "AGPLv3".
2018-01-18vmtest: Drop Zesty releaseRyan Harper
Zesty is no longer supported as of 2018-01-13[1] 1. https://lists.ubuntu.com/archives/ubuntu-announce/2018-January/000227.html
2018-01-12vmtests: switch to MAAS v3 streams for images and kernelsRyan Harper
Switching to v3 streams enables testing of Xenial HWE and HWE-edge kernels and the squashfs root which MAAS 2.3 uses. - Add v3 streams URL - Introduce two attributes, ephemeral_ftype, target_ftype to determine which files are needed for the ephemeral environment and which for the target - Add kflavor and subarch filters to streams query and release classes to support kernel variants: ga, hwe, hwe-edge. We're currently only testing subarch 'generic' and ignoring 'low-latency' - When testing with hwe and hwe-edge, emit a kernel configuration to curtin to ensure we install the matching kernel in the target image - Make sure vmtests append collect scripts to the base class parameter so all tests run the BaseVM collect_scripts (dpkg-query) - Introduce new release classes, XenialGA, XenialHWE and XenialEdge Note, XenialGA replaces the general Xenial release class, and that not all test-cases run Xenial HWE/Edge kernels; most of the storage ones do. - Booting from a squashfs image requires some changes - publish the squashfs image and boot VMs with root=URL (except trusty) - utilize overlayfs to keep the ephemeral environment pristine and use the squashfs image as a the curtin install source. - Add some boot parameters to the ephemeral environment to enable networking, including DNS for package installation. - Use BOOTIF= parameter for multi-nic vmtests to ensure we only bring up one nic for ephemeral networking. Sometimes multiple nics would come online and then cause networking hiccups which prevented installs from completing. - Modify vmtest storage configurations for disks to all use a 'serial' attribute. Currently we use 'disk-X' as the serial value where X increments from 'a' -> 'z' as the test needs. - jenkins-runner now prints additional information about what images are found and available. - tools/launch - modify --append to allow multiple parameters to grow the array. - fix bug in --publish which prevented more than a single file being published - allow PUBURL to be expanded in root-arg - add a 'boot-image' parameter which is exported to the VM with a serial number to provide a consistent path to the device, /dev/disk/by-id/virtio-boot-disk - drop '2G' boot size parameter to boot disks, instead allow qemu-img to default to the size of backing image.
2017-11-28vmtests: Add Bionic release to tests and update classes.Scott Moser
bzr-revno: 545
2017-11-27merge from trunkRyan Harper
bzr-revno: 519.3.9
2017-11-22vmtests: Add Bionic release and update classesJoshua Powers
bzr-revno: 542.1.1
2017-11-03Drop Precise from vmtests, It's dead Jim (EOL)Ryan Harper
bzr-revno: 540.1.1