~curtin-dev/curtin/trunk

« back to all changes in this revision

Viewing changes to tests/vmtests/test_raid5_bcache.py

  • Committer: Ryan Harper
  • Date: 2016-08-29 21:06:46 UTC
  • mfrom: (416.4.28 trunk.more-ipv6)
  • Revision ID: ryan.harper@canonical.com-20160829210646-1f9pv8r691iggedz
curtin/net: overhaul of eni rendering to handle mixed ipv4/ipv6 configs

To ensure complete ipv4/ipv6 support for advanced and stacked
configurations update how curtin.net renders /etc/network/interfaces for
different releases (precise -> yakkety). ifupdown has subtle issues with
various networking features and curtin needs to ensure consistent
behavior.

- Propery handle emitting the 'auto' control tag for stacked interfaces,
  like vlans over bonds
- Workaround LP:1609367 by rendering ifupdown hooks to handle the various
  cases. This works generically in all ubuntu releases 
- Add vmtests for mtu settings
- Drop the use of ipv4 alias interfaces (eth0:1, eth0:2) and instead just
  add additional e/n/i stanzas. ifupdown already uses iproute2's /sbin/ip
  which supports adding additional ip addresses to an interface without the
  use of the v4-only interface alias structure. This provides consistent
  behavior for all types of interfaces (physical, vlan, bonds, and stacked
  interfaces) across all releases. Two side-effects: 1) users can no longer
  `ifdown eth0:1` to remove a single ip address from an interface; if down
  eth0 will take _all_ ip addresses on that interface. 2) ifconfig output
  only shows *one* ipv4 address, so users will need to use /sbin/ip addr
  show <interface> to see all ip addresses assigned to an interface.
- Add vmtests for alias settings
- Restructure all of the common network testcases into a single class
  TestNetworkTestBaseAbs, all varients testing network inherit from this
  class and override only the config file and any special case test-cases
  and file collection
- Global replace of testcase use of 'with open' and instead use
  load_collect_file()
  - Fix falsepositive uefi and multipath test this replacement exposed.
- Add ip_a_to_dict parser for `/sbin/ip a` output
  - drop ifconfig_a parser

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
from .releases import base_vm_classes as relbase
3
3
 
4
4
import textwrap
5
 
import os
6
5
 
7
6
 
8
7
class TestMdadmAbs(VMBaseClass):
55
54
 
56
55
    def test_bcache_status(self):
57
56
        bcache_cset_uuid = None
58
 
        fname = os.path.join(self.td.collect, "bcache_super_vda2")
59
 
        with open(fname, "r") as fp:
60
 
            for line in fp.read().splitlines():
61
 
                if line != "" and line.split()[0] == "cset.uuid":
62
 
                    bcache_cset_uuid = line.split()[-1].rstrip()
 
57
        for line in self.load_collect_file("bcache_super_vda2").splitlines():
 
58
            if line != "" and line.split()[0] == "cset.uuid":
 
59
                bcache_cset_uuid = line.split()[-1].rstrip()
63
60
        self.assertIsNotNone(bcache_cset_uuid)
64
 
        with open(os.path.join(self.td.collect, "bcache_ls"), "r") as fp:
65
 
            self.assertTrue(bcache_cset_uuid in fp.read().splitlines())
 
61
        self.assertTrue(bcache_cset_uuid in
 
62
                        self.load_collect_file("bcache_ls").splitlines())
66
63
 
67
64
    def test_bcache_cachemode(self):
68
65
        self.check_file_regex("bcache_cache_mode", r"\[writeback\]")