Merge ~mgerdts/cloud-init:lp1746605 into cloud-init:master
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Scott Moser | ||||
Approved revision: | c24efa09f7a3bc00157eabd5761c307af7229d3a | ||||
Merge reported by: | Scott Moser | ||||
Merged at revision: | 4ed164592fe8cb15758cacf3cb3f8c7d5ab7c82e | ||||
Proposed branch: | ~mgerdts/cloud-init:lp1746605 | ||||
Merge into: | cloud-init:master | ||||
Diff against target: |
118 lines (+67/-2) 2 files modified
cloudinit/sources/DataSourceSmartOS.py (+2/-0) tests/unittests/test_datasource/test_smartos.py (+65/-2) |
||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Scott Moser | Approve | ||
Server Team CI bot | continuous-integration | Approve | |
Review via email: mp+343576@code.launchpad.net |
Commit message
DataSourceSmartOS: add locking of serial device.
cloud-init and mdata-get each have their own implementation of the
SmartOS metadata protocol. If cloud-init and other services that call
mdata-get are run concurrently, crosstalk on the serial port can cause
them both to become confused.
This change makes it so that cloud-init uses the same cooperative
locking scheme that's used by mdata-get, thus preventing cross-talk
between mdata-get and cloud-init.
For testing, a VM running on a SmartOS host and pyserial are required.
If the tests are run on a platform other than SmartOS, those that use a
real serial port are skipped. pyserial remains commented in
requirements.txt because most testers will not be running atop SmartOS.
LP: #1746605
The fix for bug #1667735 is a better fix for the retries that was originally part of this via
https:/ /code.launchpad .net/~mgerdts/ cloud-init/ +git/cloud- init/+merge/ 337271
This merge proposal obsoletes merge proposal 337271.
The change to DataSourceSmartOS is now quite small. The new tests will only run on VMs running on a SmartOS host and then only if they have write access to /dev/ttyS1. This test code includes Python 2.6 fixes offered by smoser as part of the previous merge proposal.
Proof that the new test runs under tox:
$ tox tests.unittests .test_datasourc e.test_ smartos. TestSerialConcu rrency cloud-init/ setup.py cloud-init/ .tox/dist/ cloud-init- 18.2.zip =2018.1. 18,chardet= =3.0.4, cloud-init= =18.2,configobj ==5.0.6, contextlib2= =0.5.5, coverage= =4.5.1, funcsigs= =1.0.2, functools32= =3.2.3. post2,httpretty ==0.8.14, idna==2. 6,Jinja2= =2.10,jsonpatch ==1.23, jsonpointer= =2.0,jsonschema ==2.6.0, linecache2= =1.0.0, MarkupSafe= =1.0,mock= =2.0.0, nose==1. 3.7,oauthlib= =2.0.7, pbr==4. 0.2,pkg- resources= =0.0.0, pyserial= =3.4,PyYAML= =3.12,requests= =2.18.4, six==1. 11.0,traceback2 ==1.4.0, unittest2= =1.1.0, urllib3= =1.22 '1425861219' .test_datasourc e.test_ smartos. TestSerialConcu rrency
GLOB sdist-make: /home/mgerdts/
py27 inst-nodeps: /home/mgerdts/
py27 installed: certifi=
py27 runtests: PYTHONHASHSEED=
py27 runtests: commands[0] | python -m nose tests.unittests
------- ------- ------- ------- ------- ------- ------- ------- ------- -------
Ran 0 tests in 0.000s
OK cloud-init/ .tox/dist/ cloud-init- 18.2.zip =2018.1. 18,chardet= =3.0.4, cloud-init= =18.2,configobj ==5.0.6, contextlib2= =0.5.5, coverage= =4.5.1, httpretty= =0.8.14, idna==2. 6,Jinja2= =2.10,jsonpatch ==1.23, jsonpointer= =2.0,jsonschema ==2.6.0, linecache2= =1.0.0, MarkupSafe= =1.0,mock= =2.0.0, nose==1. 3.7,nose- timer== 0.7.1,oauthlib= =2.0.7, pbr==4. 0.2,pkg- resources= =0.0.0, pyserial= =3.4,PyYAML= =3.12,requests= =2.18.4, six==1. 11.0,termcolor= =1.1.0, traceback2= =1.4.0, unittest2= =1.1.0, urllib3= =1.22 '1425861219' cloud-init/ .tox/py3/ bin/python -m nose --with-timer --timer-top-n 10 tests.unittests .test_datasourc e.test_ smartos. TestSerialConcu rrency .test_datasourc e.test_ smartos. TestSerialConcu rrency. test_all_ keys: 22.6319s ------- ------- ------- ------- ------- ------- ------- ------- -------
py3 inst-nodeps: /home/mgerdts/
py3 installed: certifi=
py3 runtests: PYTHONHASHSEED=
py3 runtests: commands[0] | /home/mgerdts/
.
[success] 100.00% tests.unittests
-------
Ran 1 test in 22.633s
OK cloud-init/ .tox/dist/ cloud-init- 18.2.zip =2018.1. 18,chardet= =3.0.4, cloud-init= =18.2,configobj ==5.0.6, flake8= =3.3.0, hacking= =0.13.0, idna==2. 6,Jinja2= =2.10,jsonpatch ==1.23, jsonpointer= =2.0,jsonschema ==2.6.0, MarkupSafe= =1.0,mccabe= =0.6.1, oauthlib= =2.0.7, pbr==4. 0.2,pep8= =1.5.7, pkg-resources= =0.0.0, pycodestyle= =2.3.1, pyflakes= =1.5.0, PyYAML= =3.12,requests= =2.18.4, six==1. 11.0,urllib3= =1.22 '1425861219' cloud-init/ .tox/flake8/ bin/python -m flake8 tests.unittests .test_datasourc e.test_ smartos. TestSerialConcu rrency cloud-init/ .tox/dist/ cloud-init- 18.2.zip =18.2,configobj ==5.0.6, contextlib2= =0.5.1, ...
flake8 inst-nodeps: /home/mgerdts/
flake8 installed: certifi=
flake8 runtests: PYTHONHASHSEED=
flake8 runtests: commands[0] | /home/mgerdts/
xenial inst-nodeps: /home/mgerdts/
xenial installed: cloud-init=