<feed xmlns='http://www.w3.org/2005/Atom'>
<title>vyos-cloud-init.git/tests/unittests/test_handler/test_handler_mounts.py, branch rolling</title>
<subtitle> (mirror of https://github.com/vyos/vyos-cloud-init.git)
</subtitle>
<id>https://git.amelek.net/vyos/vyos-cloud-init.git/atom?h=rolling</id>
<link rel='self' href='https://git.amelek.net/vyos/vyos-cloud-init.git/atom?h=rolling'/>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/'/>
<updated>2021-12-03T20:11:46+00:00</updated>
<entry>
<title>Reorganize unit test locations under tests/unittests (#1126)</title>
<updated>2021-12-03T20:11:46+00:00</updated>
<author>
<name>Brett Holman</name>
<email>bholman.devel@gmail.com</email>
</author>
<published>2021-12-03T20:11:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=039c40f9b3d88ee8158604bb18ca4bf2fb5d5e51'/>
<id>urn:sha1:039c40f9b3d88ee8158604bb18ca4bf2fb5d5e51</id>
<content type='text'>
This attempts to standardize unit test file location under test/unittests/
such that any source file located at cloudinit/path/to/file.py may have a
corresponding unit test file at test/unittests/path/to/test_file.py.

Noteworthy Comments:
====================
Four different duplicate test files existed:
test_{gpg,util,cc_mounts,cc_resolv_conf}.py
Each of these duplicate file pairs has been merged together. This is a
break in git history for these files.

The test suite appears to have a dependency on test order. Changing test
order causes some tests to fail. This should be rectified, but for now
some tests have been modified in
tests/unittests/config/test_set_passwords.py.

A helper class name starts with "Test" which causes pytest to try
executing it as a test case, which then throws warnings "due to Class
having __init__()".  Silence by changing the name of the class.

# helpers.py is imported in many test files, import paths change
cloudinit/tests/helpers.py -&gt; tests/unittests/helpers.py

# Move directories:
cloudinit/distros/tests -&gt; tests/unittests/distros
cloudinit/cmd/devel/tests -&gt; tests/unittests/cmd/devel
cloudinit/cmd/tests -&gt; tests/unittests/cmd/
cloudinit/sources/helpers/tests -&gt; tests/unittests/sources/helpers
cloudinit/sources/tests -&gt; tests/unittests/sources
cloudinit/net/tests -&gt; tests/unittests/net
cloudinit/config/tests -&gt; tests/unittests/config
cloudinit/analyze/tests/ -&gt; tests/unittests/analyze/

# Standardize tests already in tests/unittests/
test_datasource -&gt; sources
test_distros -&gt; distros
test_vmware -&gt; sources/vmware
test_handler -&gt; config        # this contains cloudconfig module tests
test_runs -&gt; runs</content>
</entry>
<entry>
<title>Implementing device_aliases as described in docs (#945)</title>
<updated>2021-08-03T16:08:26+00:00</updated>
<author>
<name>Mal Graty</name>
<email>mal.graty@googlemail.com</email>
</author>
<published>2021-08-03T16:08:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=758acf976f2cb67a85411467fa5fca2ea17a2283'/>
<id>urn:sha1:758acf976f2cb67a85411467fa5fca2ea17a2283</id>
<content type='text'>
Implement missing device_aliases feature

The device_aliases key has been documented as part of disk_setup for
years, however the feature was never implemented. This implements the
feature as documented allowing usercfg (rather than dsconfig) to create
a mapping of device names.

This is not to be confused with disk_aliases, a very similar map but
existing solely for use by datasources.

LP: #1867532</content>
</entry>
<entry>
<title>Detect kernel version before swap file creation (#428)</title>
<updated>2020-08-18T21:12:02+00:00</updated>
<author>
<name>Eduardo Otubo</name>
<email>otubo@redhat.com</email>
</author>
<published>2020-08-18T21:12:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=b749548a9eb43b34cce64f8688107645411abc8c'/>
<id>urn:sha1:b749548a9eb43b34cce64f8688107645411abc8c</id>
<content type='text'>
According to man page `man 8 swapon', "Preallocated swap files are
supported on XFS since Linux 4.18". This patch checks for kernel version
before attepting to create swapfile, using dd for XFS only on kernel
versions &lt;= 4.18 or btrfs.

Add new func util.kernel_version which returns a tuple of ints (major, minor)

Signed-off-by: Eduardo Otubo otubo@redhat.com</content>
</entry>
<entry>
<title>cc_mounts: handle missing fstab (#484)</title>
<updated>2020-07-10T13:08:44+00:00</updated>
<author>
<name>Ryan Harper</name>
<email>ryan.harper@canonical.com</email>
</author>
<published>2020-07-10T13:08:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=3d06abc2e0017436dadbf9c26fefa9f95368db9a'/>
<id>urn:sha1:3d06abc2e0017436dadbf9c26fefa9f95368db9a</id>
<content type='text'>
Do not fail if /etc/fstab is not present.  Some images, like container
rootfs may not include this file by default.

LP: #1886531</content>
</entry>
<entry>
<title>test: fix all flake8 E126 errors (#425)</title>
<updated>2020-06-10T14:39:29+00:00</updated>
<author>
<name>Joshua Powers</name>
<email>josh.powers@canonical.com</email>
</author>
<published>2020-06-10T14:39:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=f3bd42659efeed4b092ffcdfd5df7f24813f2d3e'/>
<id>urn:sha1:f3bd42659efeed4b092ffcdfd5df7f24813f2d3e</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Move subp into its own module. (#416)</title>
<updated>2020-06-08T16:49:12+00:00</updated>
<author>
<name>Scott Moser</name>
<email>smoser@brickies.net</email>
</author>
<published>2020-06-08T16:49:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=3c551f6ebc12f7729a2755c89b19b9000e27cc88'/>
<id>urn:sha1:3c551f6ebc12f7729a2755c89b19b9000e27cc88</id>
<content type='text'>
This was painful, but it finishes a TODO from cloudinit/subp.py.

It moves the following from util to subp:
  ProcessExecutionError
  subp
  which
  target_path

I moved subp_blob_in_tempfile into cc_chef, which is its only caller.
That saved us from having to deal with it using write_file
and temp_utils from subp (which does not import any cloudinit things now).

It is arguable that 'target_path' could be moved to a 'path_utils' or
something, but in order to use it from subp and also from utils,
we had to get it out of utils.</content>
</entry>
<entry>
<title>Add support for NFS/EFS mounts (#300)</title>
<updated>2020-04-02T22:08:02+00:00</updated>
<author>
<name>Andrew Beresford</name>
<email>andrew.beresford@investbook.co.uk</email>
</author>
<published>2020-04-02T22:08:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=723e2bc1ad14687a8d6846b9ca73620e4e4090b1'/>
<id>urn:sha1:723e2bc1ad14687a8d6846b9ca73620e4e4090b1</id>
<content type='text'>
The cc_mounts module does not support NFS mounts in the form of hostname:/ or hostname:/path.

This PR adds support for NFS-style paths in the fs_spec field.

LP: #1870370</content>
</entry>
<entry>
<title>cloudinit: remove ImportError handling for mock imports (#182)</title>
<updated>2020-01-23T21:32:01+00:00</updated>
<author>
<name>Daniel Watkins</name>
<email>oddbloke@ubuntu.com</email>
</author>
<published>2020-01-23T21:32:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=6b157aa60a10fa74374287f0ec0313255e0462b4'/>
<id>urn:sha1:6b157aa60a10fa74374287f0ec0313255e0462b4</id>
<content type='text'>
We only run on Python 3 now, so we can unambiguously expect
unittest.mock to exist.</content>
</entry>
<entry>
<title>Do not use fallocate in swap file creation on xfs. (#70)</title>
<updated>2020-01-23T16:41:48+00:00</updated>
<author>
<name>Eduardo Otubo</name>
<email>otubo@redhat.com</email>
</author>
<published>2020-01-23T16:41:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=6603706eec1c39d9d591c8ffa0ef7171b74d84d6'/>
<id>urn:sha1:6603706eec1c39d9d591c8ffa0ef7171b74d84d6</id>
<content type='text'>
When creating a swap file on an xfs filesystem, fallocate cannot be used.
Doing so results in failure of swapon and a message like:
 swapon: swapfile has holes

The solution here is to maintain a list (currently containing only XFS)
of filesystems where fallocate cannot be used. The, on those fileystems
use the slower but functional 'dd' method.

Signed-off-by: Eduardo Otubo &lt;otubo@redhat.com&gt;
Co-authored-by: Adam Dobrawy &lt;naczelnik@jawnosc.tk&gt;
Co-authored-by:  Scott Moser &lt;smoser@brickies.net&gt;
Co-authored-by: Daniel Watkins &lt;daniel@daniel-watkins.co.uk&gt;

LP: #1781781</content>
</entry>
<entry>
<title>cc_mounts: check if mount -a on no-change fstab path</title>
<updated>2019-05-08T22:47:07+00:00</updated>
<author>
<name>Jason Zions (MSFT)</name>
<email>jasonzio@microsoft.com</email>
</author>
<published>2019-05-08T22:47:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=acc25d8d7d603313059ac35b4253b504efc560a9'/>
<id>urn:sha1:acc25d8d7d603313059ac35b4253b504efc560a9</id>
<content type='text'>
Under some circumstances, cc_disk_setup may reformat volumes which
already appear in /etc/fstab (e.g. Azure ephemeral drive is reformatted
from NTFS to ext4 after service-heal). Normally, cc_mounts only calls
mount -a if it altered /etc/fstab. With this change cc_mounts will read
/proc/mounts and verify if configured mounts are already mounted and if
not raise flag to request a mount -a.  This handles the case where no
changes to fstab occur but a mount -a is required due to change in
underlying device which prevented the .mount unit from running until
after disk was reformatted.

LP: #1825596
</content>
</entry>
</feed>
