<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/openstack/ironic-python-agent.git/ironic_python_agent/tests/unit/test_utils.py, branch 3.2.0</title>
<subtitle>opendev.org: openstack/ironic-python-agent.git
</subtitle>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/openstack/ironic-python-agent.git/'/>
<entry>
<title>Improve the catching of calls to 'execute' related functions</title>
<updated>2017-10-23T15:44:23+00:00</updated>
<author>
<name>John L. Villalovos</name>
<email>john.l.villalovos@intel.com</email>
</author>
<published>2017-05-17T18:00:38+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/openstack/ironic-python-agent.git/commit/?id=ef838dd6bbb8d3c830a69ff2bf6a21b90b9adfaf'/>
<id>ef838dd6bbb8d3c830a69ff2bf6a21b90b9adfaf</id>
<content type='text'>
Improve the catching of calls to 'execute' related functions in unit
tests. Before we only caught calls to utils.execute(). Now we catch
calls to:

    ironic_lib.utils.execute()
    processutils.execute()
    subprocess.call()
    subprocess.check_call()
    subprocess.check_output()
    utils.execute()

Change-Id: If4720ebed00f15c2a19cb8badbe4dc3c808eeece
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Improve the catching of calls to 'execute' related functions in unit
tests. Before we only caught calls to utils.execute(). Now we catch
calls to:

    ironic_lib.utils.execute()
    processutils.execute()
    subprocess.call()
    subprocess.check_call()
    subprocess.check_output()
    utils.execute()

Change-Id: If4720ebed00f15c2a19cb8badbe4dc3c808eeece
</pre>
</div>
</content>
</entry>
<entry>
<title>Prevent tests' unmocked access to utils.execute()</title>
<updated>2017-05-15T00:48:43+00:00</updated>
<author>
<name>Julian Edwards</name>
<email>bigjools@gmail.com</email>
</author>
<published>2017-04-03T05:32:44+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/openstack/ironic-python-agent.git/commit/?id=f57cbccf8b146152eacd99787a7ccc1097b80055'/>
<id>f57cbccf8b146152eacd99787a7ccc1097b80055</id>
<content type='text'>
This change introduces a new base test class that mocks out
utils.execute and forces an exception if it gets called.
This has rooted out many tests that were doing this as a side effect of
calling other functions, doing things like modprobe and running iscsi
on the host's actual machine.

The tests are all now appropriately patched in places where this was
happening, and the new base class permanently prevents this from
accidentally happening again.

If you really want to call utils.execute() then you need to re-mock it
in your unit test.

Change-Id: Idf87d09a9c01a6bfe2767f8becabe65c02983518
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This change introduces a new base test class that mocks out
utils.execute and forces an exception if it gets called.
This has rooted out many tests that were doing this as a side effect of
calling other functions, doing things like modprobe and running iscsi
on the host's actual machine.

The tests are all now appropriately patched in places where this was
happening, and the new base class permanently prevents this from
accidentally happening again.

If you really want to call utils.execute() then you need to re-mock it
in your unit test.

Change-Id: Idf87d09a9c01a6bfe2767f8becabe65c02983518
</pre>
</div>
</content>
</entry>
<entry>
<title>Add missing 'autospec' argument to mock.patch</title>
<updated>2017-03-19T17:04:19+00:00</updated>
<author>
<name>John L. Villalovos</name>
<email>john.l.villalovos@intel.com</email>
</author>
<published>2017-03-19T15:30:25+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/openstack/ironic-python-agent.git/commit/?id=1695cb18c25f2afed27309fd4602dc91ba741864'/>
<id>1695cb18c25f2afed27309fd4602dc91ba741864</id>
<content type='text'>
Add missing 'autospec' keyword argument to mock.patch and
mock.patch.object calls. Use 'autospec=True' except for a few cases
where it fails because the mocked function is a @classmethod and it
doesn't work. In that case explicity set it to 'autospec=False'

Change-Id: I620dce91abaa4440e1803aeefb3e93c0b65d1419
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add missing 'autospec' keyword argument to mock.patch and
mock.patch.object calls. Use 'autospec=True' except for a few cases
where it fails because the mocked function is a @classmethod and it
doesn't work. In that case explicity set it to 'autospec=False'

Change-Id: I620dce91abaa4440e1803aeefb3e93c0b65d1419
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix logs encoding in py3</title>
<updated>2017-03-14T02:25:09+00:00</updated>
<author>
<name>zackchen</name>
<email>zackchen517@gmail.com</email>
</author>
<published>2017-02-28T09:55:26+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/openstack/ironic-python-agent.git/commit/?id=000eaa355472f63ae112cf1e1dcedc2c094ed5c1'/>
<id>000eaa355472f63ae112cf1e1dcedc2c094ed5c1</id>
<content type='text'>
Make sure that logs are encoded as text (not byte strings) in
python3 to allow theirs serialization in JSON.

Closes-Bug: #1668533

Change-Id: I3d0d87ca766146457d905f89c26331a415bd54f8
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Make sure that logs are encoded as text (not byte strings) in
python3 to allow theirs serialization in JSON.

Closes-Bug: #1668533

Change-Id: I3d0d87ca766146457d905f89c26331a415bd54f8
</pre>
</div>
</content>
</entry>
<entry>
<title>Use flake8-import-order</title>
<updated>2017-02-16T17:46:21+00:00</updated>
<author>
<name>John L. Villalovos</name>
<email>john.l.villalovos@intel.com</email>
</author>
<published>2017-02-16T17:46:08+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/openstack/ironic-python-agent.git/commit/?id=949f4f509e8b90eb5b5b0003929ae3fee76178da'/>
<id>949f4f509e8b90eb5b5b0003929ae3fee76178da</id>
<content type='text'>
Use the flake8 plugin flake8-import-order to check import ordering. It
can do it automatically and don't need reviewers to check it.

Change-Id: I946457e9079ce0b54c7fe0ad554d024a1c61dce0
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Use the flake8 plugin flake8-import-order to check import ordering. It
can do it automatically and don't need reviewers to check it.

Change-Id: I946457e9079ce0b54c7fe0ad554d024a1c61dce0
</pre>
</div>
</content>
</entry>
<entry>
<title>Configure and use SSL-related requests options</title>
<updated>2017-01-13T09:33:44+00:00</updated>
<author>
<name>Pavlo Shchelokovskyy</name>
<email>shchelokovskyy@gmail.com</email>
</author>
<published>2016-11-17T11:26:28+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/openstack/ironic-python-agent.git/commit/?id=fdd11b54a5e3d7a9ee89628baba2990e4e00abdd'/>
<id>fdd11b54a5e3d7a9ee89628baba2990e4e00abdd</id>
<content type='text'>
This patch adds standard SSL options to IPA config and makes use of them
when making HTTP requests.

For now, a single set of certificates is used when needed.
In the future configuration can be expanded to allow per-service
certificates.

Besides, the 'insecure' option (defaults to False) can be overridden
through kernel command line parameter 'ipa-insecure'.
This will allow running IPA in CI-like environments with self-signed SSL
certificates.

Change-Id: I259d9b3caa9ba1dc3d7382f375b8e086a5348d80
Closes-Bug: #1642515
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch adds standard SSL options to IPA config and makes use of them
when making HTTP requests.

For now, a single set of certificates is used when needed.
In the future configuration can be expanded to allow per-service
certificates.

Besides, the 'insecure' option (defaults to False) can be overridden
through kernel command line parameter 'ipa-insecure'.
This will allow running IPA in CI-like environments with self-signed SSL
certificates.

Change-Id: I259d9b3caa9ba1dc3d7382f375b8e086a5348d80
Closes-Bug: #1642515
</pre>
</div>
</content>
</entry>
<entry>
<title>Use oslo_serialization.base64 to follow OpenStack Python3</title>
<updated>2016-12-16T04:29:16+00:00</updated>
<author>
<name>Luong Anh Tuan</name>
<email>tuanla@vn.fujitsu.com</email>
</author>
<published>2016-12-15T06:21:53+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/openstack/ironic-python-agent.git/commit/?id=81780adef861d7a2be6b198589cecc059f0d01a7'/>
<id>81780adef861d7a2be6b198589cecc059f0d01a7</id>
<content type='text'>
This patch replaces python standard base64 library call to
oslo_serialization.base64 to follow OpenStack Python3 porting
standard [1].

Use base64 encoding takes 8-bit binary byte data and encodes it. On
Python3, A string is a sequence of Unicode characters thus base64 has
no idea what to do with Unicode data, it's not 8-bit[2]. We use
oslo_serialization.base64 for both python2 and python3.

[1] https://wiki.openstack.org/wiki/Python3
[2] http://stackoverflow.com/questions/8908287/base64-encoding-in-python-3

Change-Id: I1dafe878a71f37d223eaf58ea8e2e8c6b4422a14
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch replaces python standard base64 library call to
oslo_serialization.base64 to follow OpenStack Python3 porting
standard [1].

Use base64 encoding takes 8-bit binary byte data and encodes it. On
Python3, A string is a sequence of Unicode characters thus base64 has
no idea what to do with Unicode data, it's not 8-bit[2]. We use
oslo_serialization.base64 for both python2 and python3.

[1] https://wiki.openstack.org/wiki/Python3
[2] http://stackoverflow.com/questions/8908287/base64-encoding-in-python-3

Change-Id: I1dafe878a71f37d223eaf58ea8e2e8c6b4422a14
</pre>
</div>
</content>
</entry>
<entry>
<title>Use ironic_lib's execute()</title>
<updated>2016-07-27T20:28:43+00:00</updated>
<author>
<name>Ruby Loo</name>
<email>ruby.loo@intel.com</email>
</author>
<published>2016-07-27T20:28:43+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/openstack/ironic-python-agent.git/commit/?id=81ca8a87443a47ece86801b3212e8404d279d2c0'/>
<id>81ca8a87443a47ece86801b3212e8404d279d2c0</id>
<content type='text'>
Use ironic_lib's execute() instead of copying that code.

Change-Id: If40c2da5423d0f90cc6661f8cdf2bec9567e1f7d
Partial-Bug: #1587199
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Use ironic_lib's execute() instead of copying that code.

Change-Id: If40c2da5423d0f90cc6661f8cdf2bec9567e1f7d
Partial-Bug: #1587199
</pre>
</div>
</content>
</entry>
<entry>
<title>Replace the ps options when collecting logs</title>
<updated>2016-07-07T13:19:42+00:00</updated>
<author>
<name>Lucas Alvares Gomes</name>
<email>lucasagomes@gmail.com</email>
</author>
<published>2016-07-07T12:38:45+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/openstack/ironic-python-agent.git/commit/?id=f26f90260340b1846d1422ec71ab22255230a394'/>
<id>f26f90260340b1846d1422ec71ab22255230a394</id>
<content type='text'>
This patch is replacing the "-ax" options of the ps command when
collecting the logs to "au". The "-x" option is not supported by the
BusyBox in the TinyIPA ramdisk.

Closes-Bug: #1599839
Change-Id: Id0c86db6aa16c63550890e1cd488994025f5dd68
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch is replacing the "-ax" options of the ps command when
collecting the logs to "au". The "-x" option is not supported by the
BusyBox in the TinyIPA ramdisk.

Closes-Bug: #1599839
Change-Id: Id0c86db6aa16c63550890e1cd488994025f5dd68
</pre>
</div>
</content>
</entry>
<entry>
<title>Add a log extension</title>
<updated>2016-06-28T16:02:11+00:00</updated>
<author>
<name>Lucas Alvares Gomes</name>
<email>lucasagomes@gmail.com</email>
</author>
<published>2016-05-30T16:39:13+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/openstack/ironic-python-agent.git/commit/?id=af81914ce7309b23edcccc030d40f59f98fc258e'/>
<id>af81914ce7309b23edcccc030d40f59f98fc258e</id>
<content type='text'>
The log extension is responsible for retrieving logs from the system,
if journalctl is present the logs will come from it, otherwise we
fallback to getting the logs from the /var/log directory + dmesg logs.

In the coreos ramdisk, we need to bind mount /run/log in the container
so the IPA service can have access to the journal.

For the tinyIPA ramdisk, the logs from IPA are now being redirected to
/var/logs/ironic-python-agent.log instead of only going to the default
stdout.

Inspector now shares the same method of collecting logs, extending its
capabilities for non-systemd systems.

Partial-Bug: #1587143
Change-Id: Ie507e2e5c58cffa255bbfb2fa5ffb95cb98ed8c4
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The log extension is responsible for retrieving logs from the system,
if journalctl is present the logs will come from it, otherwise we
fallback to getting the logs from the /var/log directory + dmesg logs.

In the coreos ramdisk, we need to bind mount /run/log in the container
so the IPA service can have access to the journal.

For the tinyIPA ramdisk, the logs from IPA are now being redirected to
/var/logs/ironic-python-agent.log instead of only going to the default
stdout.

Inspector now shares the same method of collecting logs, extending its
capabilities for non-systemd systems.

Partial-Bug: #1587143
Change-Id: Ie507e2e5c58cffa255bbfb2fa5ffb95cb98ed8c4
</pre>
</div>
</content>
</entry>
</feed>
