~curtin-dev/curtin/bionic

« back to all changes in this revision

Viewing changes to tests/vmtests/test_centos_basic.py

  • Committer: Scott Moser
  • Date: 2017-08-03 19:51:16 UTC
  • mfrom: (1.1.50)
  • Revision ID: smoser@ubuntu.com-20170803195116-0xc6onji18peerm5
* New upstream snapshot.
  - tests: Add CiTestCase common parent for all curtin tests.
  - vmtests: Remove force flag for centos curthooks
  - tools/jenkins-runner: improve tgtd cleanup logic
  - tests: Drop EOL Wily Vivid and Yakkety tests.
  - Disable yum plugins when installing packages, update ca-certs for https
  - Rename centos_network_curthooks -> centos_apply_network_config.
  - tests: in centos_defaults use write_files for grub serial.
  - write_files: write files after extract, change write_files signature.
  - pass network configuration through to target for ubuntu and centos
  - tests: disable yakkety tests.
  - tools/launch: automatically pass on proxy settings to curtin
  - Add top level 'proxy' to config, deprecate top level http_proxy.
  - tools/curtainer: fix to enable deb-src for -proposed.
  - Use unshare to put chroot commands in own pid namespace.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
from . import VMBaseClass
2
2
from .releases import centos_base_vm_classes as relbase
 
3
from .test_network import TestNetworkBaseTestsAbs
3
4
 
4
5
import textwrap
5
6
 
9
10
    __test__ = False
10
11
    conf_file = "examples/tests/centos_basic.yaml"
11
12
    extra_kern_args = "BOOTIF=eth0-52:54:00:12:34:00"
 
13
    # XXX: command | tee output is required for Centos under SELinux
 
14
    # http://danwalsh.livejournal.com/22860.html
12
15
    collect_scripts = [textwrap.dedent(
13
16
        """
14
17
        cd OUTPUT_COLLECT_D
15
18
        cat /etc/fstab > fstab
 
19
        rpm -qa | cat >rpm_qa
 
20
        ifconfig -a | cat >ifconfig_a
 
21
        ip a | cat >ip_a
 
22
        cp -a /etc/sysconfig/network-scripts .
 
23
        cp -a /var/log/messages .
 
24
        cp -a /var/log/cloud-init* .
 
25
        cp -a /var/lib/cloud ./var_lib_cloud
 
26
        cp -a /run/cloud-init ./run_cloud-init
16
27
        """)]
17
28
    fstab_expected = {
18
29
        'LABEL=cloudimg-rootfs': '/',
40
51
    # FIXME: test is disabled because the grub config script in target
41
52
    #        specifies drive using hd(1,0) syntax, which breaks when the
42
53
    #        installation medium is removed. other than this, the install works
 
54
 
 
55
 
 
56
class CentosTestBasicNetworkAbs(TestNetworkBaseTestsAbs):
 
57
    conf_file = "examples/tests/centos_basic.yaml"
 
58
    extra_kern_args = "BOOTIF=eth0-52:54:00:12:34:00"
 
59
    collect_scripts = TestNetworkBaseTestsAbs.collect_scripts + [
 
60
        textwrap.dedent("""
 
61
            cd OUTPUT_COLLECT_D
 
62
            cp -a /etc/sysconfig/network-scripts .
 
63
            cp -a /var/log/cloud-init* .
 
64
            cp -a /var/lib/cloud ./var_lib_cloud
 
65
            cp -a /run/cloud-init ./run_cloud-init
 
66
        """)]
 
67
 
 
68
    def test_etc_network_interfaces(self):
 
69
        pass
 
70
 
 
71
    def test_etc_resolvconf(self):
 
72
        pass
 
73
 
 
74
 
 
75
class Centos70BasicNetworkFromXenialTestBasic(relbase.centos70fromxenial,
 
76
                                              CentosTestBasicNetworkAbs):
 
77
    __test__ = True