~smoser/ubuntu/vivid/cloud-init/snappy

« back to all changes in this revision

Viewing changes to tests/unittests/test_runs/test_simple_run.py

  • Committer: Scott Moser
  • Date: 2015-02-27 20:55:58 UTC
  • mfrom: (355.2.8 vivid)
  • Revision ID: smoser@ubuntu.com-20150227205558-glrwdgxqkaz6zyxa
* Merge with vivid at 0.7.7~bzr1067-0ubuntu1
* New upstream snapshot.
  * fix broken consumption of gzipped user-data (LP: #1424900)
  * functional user-data on Azure again (LP: #1423972)
  * CloudStack: support fetching password from virtual router (LP: #1422388)
* New upstream snapshot.
  * Fix for ascii decode in DataSourceAzure (LP: #1422993).
* New upstream snapshot.
  * support for gpt partitioning, utilized in Azure [Daniel Watkins]
  * fix bug in exception handling in mount_cb.
* New upstream snapshot.
  * move to python3 (LP: #1247132)
  * systemd: run cloud-init before systemd-user-sessions.service
  * Use the GCE short hostname. (LP: #1383794)
  * Enable user-data encoding support for GCE. (LP: #1404311)
  * Update to use a newer and better OMNIBUS_URL
  * Be more tolerant of 'ssh_authorized_keys' types
  * Fix parse_ssh_config failing in ssh_util.py
  * Increase the robustness/configurability of the chef module.
  * retain trailing newline from template files when using
    jinja2 (LP: #1355343)
  * fix broken output handling (LP: #1387340)
  * digital ocean datasource
  * update url in config drive documentation
  * freebsd: enable correct behavior on Ec2.
  * freebsd: Use the proper virtio FreeBSD network interface name.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
import os
 
2
import shutil
 
3
import tempfile
2
4
 
3
5
from .. import helpers
4
6
 
5
 
from cloudinit.settings import (PER_INSTANCE)
 
7
from cloudinit.settings import PER_INSTANCE
6
8
from cloudinit import stages
7
9
from cloudinit import util
8
10
 
9
11
 
10
12
class TestSimpleRun(helpers.FilesystemMockingTestCase):
11
13
    def _patchIn(self, root):
12
 
        self.restore()
13
14
        self.patchOS(root)
14
15
        self.patchUtils(root)
15
16
 
16
17
    def _pp_root(self, root, repatch=True):
17
 
        self.restore()
18
18
        for (dirpath, dirnames, filenames) in os.walk(root):
19
19
            print(dirpath)
20
20
            for f in filenames:
33
33
            self._patchIn(root)
34
34
 
35
35
    def test_none_ds(self):
36
 
        new_root = self.makeDir()
 
36
        new_root = tempfile.mkdtemp()
 
37
        self.addCleanup(shutil.rmtree, new_root)
37
38
        self.replicateTestRoot('simple_ubuntu', new_root)
38
39
        cfg = {
39
40
            'datasource_list': ['None'],
41
42
                {
42
43
                    'path': '/etc/blah.ini',
43
44
                    'content': 'blah',
44
 
                    'permissions': 0755,
 
45
                    'permissions': 0o755,
45
46
                },
46
47
            ],
47
48
            'cloud_init_modules': ['write-files'],