<feed xmlns='http://www.w3.org/2005/Atom'>
<title>vyos-cloud-init.git/tests/unittests/test_ec2_util.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-16T02:16:38+00:00</updated>
<entry>
<title>Adopt Black and isort (SC-700) (#1157)</title>
<updated>2021-12-16T02:16:38+00:00</updated>
<author>
<name>James Falcon</name>
<email>james.falcon@canonical.com</email>
</author>
<published>2021-12-16T02:16:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=bae9b11da9ed7dd0b16fe5adeaf4774b7cc628cf'/>
<id>urn:sha1:bae9b11da9ed7dd0b16fe5adeaf4774b7cc628cf</id>
<content type='text'>
Applied Black and isort, fixed any linting issues, updated tox.ini
and CI.
</content>
</entry>
<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>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/vyos/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>relocate tests/unittests/helpers.py to cloudinit/tests</title>
<updated>2017-09-05T17:03:59+00:00</updated>
<author>
<name>Lars Kellogg-Stedman</name>
<email>lars@redhat.com</email>
</author>
<published>2017-09-05T17:03:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=a3649e03206a3596131413956ea7ecc18790ec73'/>
<id>urn:sha1:a3649e03206a3596131413956ea7ecc18790ec73</id>
<content type='text'>
This moves the base test case classes into into cloudinit/tests and
updates all the corresponding imports.
</content>
</entry>
<entry>
<title>tests: No longer monkey patch httpretty for python 3.4.2</title>
<updated>2017-01-24T20:39:14+00:00</updated>
<author>
<name>Scott Moser</name>
<email>smoser@brickies.net</email>
</author>
<published>2017-01-24T16:37:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=8e9e47f2f06b4dcf017149699111e94ba7c1830b'/>
<id>urn:sha1:8e9e47f2f06b4dcf017149699111e94ba7c1830b</id>
<content type='text'>
No shipping ubuntu has a python 3.4 that is less than 3.4.2.
Remove this workaround to avoid unnecessary complexity.

This reverts 04a60cf949.
</content>
</entry>
<entry>
<title>EC2: Do not cache security credentials on disk</title>
<updated>2017-01-20T18:48:08+00:00</updated>
<author>
<name>Andrew Jorgensen</name>
<email>ajorgens@amazon.com</email>
</author>
<published>2016-11-01T14:54:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=b71592ce0e0a9f9f9f225315015ca57b312ad30d'/>
<id>urn:sha1:b71592ce0e0a9f9f9f225315015ca57b312ad30d</id>
<content type='text'>
On EC2, instance metadata can include credentials that remain valid for as
much as 6 hours. Reading these and allowing them to be pickled represents
a potential vulnerability if a snapshot of the disk is taken and shared as
part of an AMI.

This skips security-credentials when walking the meta-data tree.

LP: #1638312
Reviewed-by: Ian Weller &lt;iweller@amazon.com&gt;
Reviewed-by: Ben Cressey &lt;bcressey@amazon.com&gt;
Reported-by: Kyle Barnes &lt;barnesky@amazon.com&gt;
</content>
</entry>
<entry>
<title>LICENSE: Allow dual licensing GPL-3 or Apache 2.0</title>
<updated>2016-12-22T22:04:28+00:00</updated>
<author>
<name>Jon Grimm</name>
<email>jon.grimm@canonical.com</email>
</author>
<published>2016-11-22T23:09:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=b2a9f33616c806ae6e052520a8589113308f567c'/>
<id>urn:sha1:b2a9f33616c806ae6e052520a8589113308f567c</id>
<content type='text'>
This has been a recurring ask and we had initially just made the change to
the cloud-init 2.0 codebase.  As the current thinking is we'll just
continue to enhance the current codebase, its desirable to relicense to
match what we'd intended as part of the 2.0 plan here.

- put a brief description of license in LICENSE file
- put full license versions in LICENSE-GPLv3 and LICENSE-Apache2.0
- simplify the per-file header to reference LICENSE
- tox: ignore H102 (Apache License Header check)

Add license header to files that ship.
Reformat headers, make sure everything has vi: at end of file.

Non-shipping files do not need the copyright header,
but at the moment tests/ have it.
</content>
</entry>
<entry>
<title>run flake8 instead of pyflakes in tox.  expect tests/ to pass flake8.</title>
<updated>2016-05-12T20:43:11+00:00</updated>
<author>
<name>Scott Moser</name>
<email>smoser@ubuntu.com</email>
</author>
<published>2016-05-12T20:43:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=4ba4df2f00ab1763920280f76e2b4497898858af'/>
<id>urn:sha1:4ba4df2f00ab1763920280f76e2b4497898858af</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Fix hang caused by HTTPretty on Python 3.4.2.</title>
<updated>2015-03-04T12:29:29+00:00</updated>
<author>
<name>Daniel Watkins</name>
<email>daniel.watkins@canonical.com</email>
</author>
<published>2015-03-04T12:29:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=04a60cf949e085f06fa1f93b39a74b8d288f0e2e'/>
<id>urn:sha1:04a60cf949e085f06fa1f93b39a74b8d288f0e2e</id>
<content type='text'>
HTTPretty can causes hangs on Python 3.4.2 (and maybe Python 3.4.1), due
to a Python bug (fixed in Python 3.4.3).  This works around the problem
in the appropriate Python versions.

See https://github.com/gabrielfalcao/HTTPretty/pull/193 and
https://github.com/gabrielfalcao/HTTPretty/issues/221 for details.
</content>
</entry>
<entry>
<title>move towards user-data being binary</title>
<updated>2015-02-26T00:40:33+00:00</updated>
<author>
<name>Scott Moser</name>
<email>smoser@ubuntu.com</email>
</author>
<published>2015-02-26T00:40:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=8cd5d7b143f882d80d45b1c04bdde1949846d4f1'/>
<id>urn:sha1:8cd5d7b143f882d80d45b1c04bdde1949846d4f1</id>
<content type='text'>
UrlResponse: biggest change... make readurl return bytes, making user
             know what to do with it.
util: add load_tfile_or_url for loading text file or url
      as  read_file_or_url now returns bytes

ec2_utils: all meta-data is text, remove non-obvious string translations
DigitalOcean: adjust for ec2_utils

DataSourceGCE, DataSourceMAAS: user-data is binary other fields are text.
openstack.py: read paths without decoding to text.  This is ok as paths
              other than user-data are json, and load_json will handle

load_file still returns text, and that is what most things use.
</content>
</entry>
</feed>
