<feed xmlns='http://www.w3.org/2005/Atom'>
<title>vyos-cloud-init.git/tests/unittests/test_handler, branch crux</title>
<subtitle> (mirror of https://github.com/marekm72/vyos-cloud-init.git)
</subtitle>
<id>https://git.amelek.net/marekm72/vyos-cloud-init.git/atom?h=crux</id>
<link rel='self' href='https://git.amelek.net/marekm72/vyos-cloud-init.git/atom?h=crux'/>
<link rel='alternate' type='text/html' href='https://git.amelek.net/marekm72/vyos-cloud-init.git/'/>
<updated>2018-12-06T18:26:32+00:00</updated>
<entry>
<title>write_files: add support for appending to files.</title>
<updated>2018-12-06T18:26:32+00:00</updated>
<author>
<name>James Baxter</name>
<email>j.w.baxter@gmail.com</email>
</author>
<published>2018-12-06T18:26:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/marekm72/vyos-cloud-init.git/commit/?id=a4007d063f96b82545aa678ef2cb472ea3b48b1e'/>
<id>urn:sha1:a4007d063f96b82545aa678ef2cb472ea3b48b1e</id>
<content type='text'>
Add 'append: true' to write_files entries to append 'content' to file
specified by 'path' key.  This modifies the file open mode to append.
</content>
</entry>
<entry>
<title>tests: fix incorrect order of mocks in test_handle_zfs_root.</title>
<updated>2018-11-28T18:23:33+00:00</updated>
<author>
<name>Scott Moser</name>
<email>smoser@ubuntu.com</email>
</author>
<published>2018-11-28T18:23:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/marekm72/vyos-cloud-init.git/commit/?id=4ce8a2858dffcb1f9518b50d884b341f68ac5e63'/>
<id>urn:sha1:4ce8a2858dffcb1f9518b50d884b341f68ac5e63</id>
<content type='text'>
The order of parameters to test_handle_zfs_root did not match
the order of the mocks applied.

Thanks to Jason Zions for pointing this out.
</content>
</entry>
<entry>
<title>resizefs: Prefix discovered devpath with '/dev/' when path does not exist</title>
<updated>2018-11-14T22:02:18+00:00</updated>
<author>
<name>Igor Galić</name>
<email>igalic@brainsware.at</email>
</author>
<published>2018-11-14T22:02:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/marekm72/vyos-cloud-init.git/commit/?id=a3812a4ab4eeb2aa185eb4a2de186cc60ddd7c03'/>
<id>urn:sha1:a3812a4ab4eeb2aa185eb4a2de186cc60ddd7c03</id>
<content type='text'>
In some environments, like FreeBSD, gpart can return the device basename
instead of the full path. If this discovered devpath does not exist and
is missing the '/dev/' prefix, add that prefix in an attempt to find the
device.
</content>
</entry>
<entry>
<title>lxd: adjust to snap installed lxd.</title>
<updated>2018-09-26T21:29:27+00:00</updated>
<author>
<name>Scott Moser</name>
<email>smoser@ubuntu.com</email>
</author>
<published>2018-09-26T21:29:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/marekm72/vyos-cloud-init.git/commit/?id=facb92c5b55f4d27ee971eaf49c580fbf92ac2c3'/>
<id>urn:sha1:facb92c5b55f4d27ee971eaf49c580fbf92ac2c3</id>
<content type='text'>
Relax expectation on path to lxc and lxd.  The deb path still does
install them in /usr/bin/ but that is overly pedantic.

Add a 'lxd waitready' (present since lxd 0.5) to wait until lxd
is ready before operating on it.
</content>
</entry>
<entry>
<title>tests: Add mock for util.get_hostname.</title>
<updated>2018-09-17T11:37:27+00:00</updated>
<author>
<name>Robert Schweikert</name>
<email>rjschwei@suse.com</email>
</author>
<published>2018-09-17T11:37:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/marekm72/vyos-cloud-init.git/commit/?id=37078046cb191234982d95ad4876af4ed8f862f4'/>
<id>urn:sha1:37078046cb191234982d95ad4876af4ed8f862f4</id>
<content type='text'>
At present the host network settings bleed into the test environment
causing the test test_handler_apt_source_v3 to fail if the host has a
domain setting other then localdomain.

LP: #1792799
</content>
</entry>
<entry>
<title>user-data: jinja template to render instance-data.json in cloud-config</title>
<updated>2018-09-11T17:31:46+00:00</updated>
<author>
<name>Chad Smith</name>
<email>chad.smith@canonical.com</email>
</author>
<published>2018-09-11T17:31:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/marekm72/vyos-cloud-init.git/commit/?id=c7555762f3a30190ce7726b4d013bc3e83c7e4b6'/>
<id>urn:sha1:c7555762f3a30190ce7726b4d013bc3e83c7e4b6</id>
<content type='text'>
Allow users to provide '## template: jinja' as the first line or their
#cloud-config or custom script user-data parts. When this header exists,
the cloud-config or script will be rendered as a jinja template.

All instance metadata keys and values present in
/run/cloud-init/instance-data.json will be available as jinja variables
for the template. This means any cloud-config module or script can
reference any standardized instance data in templates and scripts.

Additionally, any standardized instance-data.json keys scoped below a
'&lt;v#&gt;' key will be promoted as a top-level key for ease of reference in
templates. This means that '{{ local_hostname }}' is the same as using the
latest '{{ v#.local_hostname }}'.

Since instance-data is written to /run/cloud-init/instance-data.json, make
sure it is persisted across reboots when the cached datasource opject is
reloaded.

LP: #1791781
</content>
</entry>
<entry>
<title>tests: Disallow use of util.subp except for where needed.</title>
<updated>2018-09-05T16:02:25+00:00</updated>
<author>
<name>Scott Moser</name>
<email>smoser@ubuntu.com</email>
</author>
<published>2018-09-05T16:02:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/marekm72/vyos-cloud-init.git/commit/?id=a8dcad9ac62bb1d2a4f7489960395bad6cac9382'/>
<id>urn:sha1:a8dcad9ac62bb1d2a4f7489960395bad6cac9382</id>
<content type='text'>
In many cases, cloud-init uses 'util.subp' to run a subprocess.
This is not really desirable in our unit tests as it makes the tests
dependent upon existance of those utilities.

The change here is to modify the base test case class (CiTestCase) to
raise exception any time subp is called.  Then, fix all callers.
For cases where subp is necessary or actually desired, we can use it
via
  a.) context hander CiTestCase.allow_subp(value)
  b.) class level self.allowed_subp = value

Both cases the value is a list of acceptable executable names that
will be called (essentially argv[0]).

Some cleanups in AltCloud were done as the code was being updated.
</content>
</entry>
<entry>
<title>lxd: Delete default network and detach device if lxd-init created them.</title>
<updated>2018-06-16T02:00:15+00:00</updated>
<author>
<name>Scott Moser</name>
<email>smoser@ubuntu.com</email>
</author>
<published>2018-06-16T02:00:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/marekm72/vyos-cloud-init.git/commit/?id=4ce6720104ec92d8d7c5aa993bf7ec405a2f53db'/>
<id>urn:sha1:4ce6720104ec92d8d7c5aa993bf7ec405a2f53db</id>
<content type='text'>
Newer versions (3.0.1+) of lxd create the 'lxdbr0' network when
'lxd init --auto' is invoked.

When cloud-init is given a network configuration to pass on to
lxc and that config had no name specified or 'lxdbr0', then cloud-init
would fail to create the network as it already exists.

Similarly, we need to remove the device from the default profile
so that the attach code can work.

Also, add a _lxc method and use it to make sure we're getting the
--force-local flag everywhere.

LP: #1776958
</content>
</entry>
<entry>
<title>tests: Avoid using https in httpretty, improve HttPretty test case.</title>
<updated>2018-05-23T20:04:42+00:00</updated>
<author>
<name>Scott Moser</name>
<email>smoser@ubuntu.com</email>
</author>
<published>2018-05-23T20:04:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/marekm72/vyos-cloud-init.git/commit/?id=12799d96f85e210c8e1216a3b06d8a98468fedd7'/>
<id>urn:sha1:12799d96f85e210c8e1216a3b06d8a98468fedd7</id>
<content type='text'>
On OpenSuSE 42.3, we would get errors running
tests/unittests/test_handler/test_handler_chef.py
 - test_myhttps_nonet raises a UnmockedError
   No mocking was registered, and real connections are not allowed
 - test_myhttps_net raises SSLError
   ("bad handshake: SysCallError(32, 'EPIPE')",)

This fixes the errors by just using http instead of https.

Also it modifies the HttprettyTestCase to do the httpretty activate
and deactivate itself in setUp and tearDown.  Then we don't have to
decorate individual test_ methods.  Also, we set
   httpretty.HTTPretty.allow_net_connect = False
Test cases here should not reach out to a network resource.

LP: #1771659
</content>
</entry>
<entry>
<title>yaml_load/schema: Add invalid line and column nums to error message</title>
<updated>2018-05-23T19:56:16+00:00</updated>
<author>
<name>Chad Smith</name>
<email>chad.smith@canonical.com</email>
</author>
<published>2018-05-23T19:56:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/marekm72/vyos-cloud-init.git/commit/?id=3b28bdc616f3e7f4d6b419629dc7b9efc3ae8d1e'/>
<id>urn:sha1:3b28bdc616f3e7f4d6b419629dc7b9efc3ae8d1e</id>
<content type='text'>
Yaml tracebacks are generally hard to read for average users. Add a bit of
logic to util.yaml_load and schema validation to look for
YAMLError.context_marker or problem_marker line and column counts.

No longer log the full exceeption traceback from the yaml_load error,
instead just LOG.warning for the specific error and point to the offending
line and column where the problem exists.
</content>
</entry>
</feed>
