summaryrefslogtreecommitdiff
path: root/tests/vmtests/test_preserve_partition_wipe_vg.py
blob: 5bf48c77f4140b8b3e8b81e56f4f94a782177e95 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# This file is part of curtin. See LICENSE file for copyright and license info.

from . import VMBaseClass
from .releases import base_vm_classes as relbase

import textwrap


class TestPreserveWipeLvm(VMBaseClass):
    """ Test that curtin can reuse a partition that was previously in lvm. """
    conf_file = "examples/tests/preserve-partition-wipe-vg.yaml"
    extra_disks = ['20G']
    uefi = False
    extra_collect_scripts = [textwrap.dedent("""
        cd OUTPUT_COLLECT_D
        ls /opt > ls-opt
        exit 0
        """)]

    def test_existing_exists(self):
        self.assertIn('existing', self.load_collect_file('ls-opt'))


class BionicTestPreserveWipeLvm(relbase.bionic, TestPreserveWipeLvm):
    __test__ = True


class FocalTestPreserveWipeLvm(relbase.focal, TestPreserveWipeLvm):
    __test__ = True


class TestPreserveWipeLvmSimple(VMBaseClass):
    conf_file = "examples/tests/preserve-partition-wipe-vg-simple.yaml"
    uefi = False
    extra_collect_scripts = [textwrap.dedent("""
        cd OUTPUT_COLLECT_D
        ls /opt > ls-opt
        exit 0
        """)]


class BionicTestPreserveWipeLvmSimple(relbase.bionic,
                                      TestPreserveWipeLvmSimple):
    __test__ = True


class FocalTestPreserveWipeLvmSimple(relbase.focal, TestPreserveWipeLvmSimple):
    __test__ = True


# vi: ts=4 expandtab syntax=python