Merge ~powersj/cloud-init:cii-kvm into cloud-init:master
| Status: | Merged |
|---|---|
| Approved by: | Scott Moser on 2017-09-15 |
| Approved revision: | 376168e251a1d4f2ee3643fed6092b8907f057ec |
| Merged at revision: | 376168e251a1d4f2ee3643fed6092b8907f057ec |
| Proposed branch: | ~powersj/cloud-init:cii-kvm |
| Merge into: | cloud-init:master |
| Diff against target: |
797 lines (+564/-7) 14 files modified
tests/cloud_tests/__main__.py (+4/-1) tests/cloud_tests/args.py (+2/-2) tests/cloud_tests/collect.py (+3/-0) tests/cloud_tests/config.py (+1/-0) tests/cloud_tests/images/nocloudkvm.py (+88/-0) tests/cloud_tests/instances/base.py (+1/-1) tests/cloud_tests/instances/nocloudkvm.py (+216/-0) tests/cloud_tests/platforms.yaml (+4/-0) tests/cloud_tests/platforms/__init__.py (+2/-0) tests/cloud_tests/platforms/nocloudkvm.py (+90/-0) tests/cloud_tests/releases.yaml (+18/-1) tests/cloud_tests/setup_image.py (+18/-2) tests/cloud_tests/snapshots/nocloudkvm.py (+74/-0) tests/cloud_tests/util.py (+43/-0) |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Scott Moser | Approve on 2017-09-14 | ||
| Server Team CI bot | continuous-integration | Approve on 2017-09-14 | |
| Chad Smith | 2017-07-18 | Approve on 2017-09-08 | |
|
Review via email:
|
|||
Commit Message
tests: Enable the NoCloud KVM platform
The NoCloud KVM platform includes:
* Downloads daily Ubuntu images using streams and store in
/srv/images
* Image customization, if required, is done using
mount-
* Launches KVM via the xkvm script, a wrapper around
qemu-system, and sets custom port for SSH
* Generation and inject an SSH (RSA 4096) key pair to use for
communication with the guest to collect test artifacts
* Add method to produce safe shell strings by base64 encoding
the command
Additional Changes:
* Set default backend to use LXD
* Verify not running script as root in order to prevent images
from becoming owned by root
* Removed extra quotes around that were added when collecting
the cloud-init version from the image
* Added info about each release as previously the lxd backend
was able to query that information from pylxd image info,
however, other backends will not be able to obtain the same
information as easily
Description of the Change
Testing completed:
# Smoke Test: single test on both platforms
python3 -m tests.cloud_tests run --verbose --platform nocloud-kvm --os-name xenial -t modules/locale
python3 -m tests.cloud_tests run --verbose --platform lxd --os-name xenial -t modules/locale
# Specify cloud-init deb to install
python3 -m tests.cloud_tests run --verbose --platform nocloud-kvm --os-name xenial -t modules/ntp --deb *.deb
python3 -m tests.cloud_tests run --verbose --platform lxd --os-name xenial -t modules/ntp --deb *.deb
# Specify repo to pull cloud-init from
python3 -m tests.cloud_tests run --verbose --platform nocloud-kvm --os-name artful -t modules/locale --repo "deb http://
python3 -m tests.cloud_tests run --verbose --platform lxd --os-name artful -t modules/locale --repo "deb http://
# Specify PPA to install from
python3 -m tests.cloud_tests run --verbose --platform nocloud-kvm --os-name xenial -t modules/locale --ppa ppa:cloud-
python3 -m tests.cloud_tests run --verbose --platform lxd --os-name xenial -t modules/locale --ppa ppa:cloud-
# Run nightly integration test on LTS and devel releases
python3 -m tests.cloud_tests run --verbose --platform lxd --os-name xenial --os-name artful
# Run KVM on Torkoal QA Slave
python3 -m tests.cloud_tests run --verbose --platform nocloud-kvm --os-name xenial -t modules/locale
# Build local tree and inject deb
# These are blocked right now due to build issues
python3 -m tests.cloud_tests tree_run --verbose --platform nocloud-kvm --os-name zesty -t modules/bootcmd
python3 -m tests.cloud_tests tree_run --verbose --platform lxd --os-name zesty -t modules/bootcmd
Note, not all existing tests work with the nocloud-kvm. This is because lxd runs with the root user, whereas nocloud-kvm runs as a normal 'ubuntu' user. Certain assumptions were made with lxd that do not apply to nocloud-kvm. As such updated test cases will come in a later merge.
FAILED: Continuous integration, rev:8625408dd16
https:/
Executed test runs:
SUCCESS: Checkout
SUCCESS: Unit & Style Tests
SUCCESS: Ubuntu LTS: Build
FAILED: Ubuntu LTS: Integration
Click here to trigger a rebuild:
https:/
PASSED: Continuous integration, rev:31be94b892c
https:/
Executed test runs:
SUCCESS: Checkout
SUCCESS: Unit & Style Tests
SUCCESS: Ubuntu LTS: Build
SUCCESS: Ubuntu LTS: Integration
SUCCESS: CentOS 6 & 7: Build & Test
IN_PROGRESS: Declarative: Post Actions
Click here to trigger a rebuild:
https:/
| Ryan Harper (raharper) wrote : | # |
Looks pretty solid. Just a few in-line comments/fixes
PASSED: Continuous integration, rev:42536229033
https:/
Executed test runs:
SUCCESS: Checkout
SUCCESS: Unit & Style Tests
SUCCESS: Ubuntu LTS: Build
SUCCESS: Ubuntu LTS: Integration
SUCCESS: MAAS Compatability Testing
IN_PROGRESS: Declarative: Post Actions
Click here to trigger a rebuild:
https:/
| Chad Smith (chad.smith) wrote : | # |
Looks good, initial comments and running through tests now.
| Chad Smith (chad.smith) wrote : | # |
Additionally, since you are importing paramiko, we probably need a dev dependency added to requirements-
| Joshua Powers (powersj) wrote : | # |
I have been leaving integration test requirements out of requirements-
PASSED: Continuous integration, rev:661af70598f
https:/
Executed test runs:
SUCCESS: Checkout
SUCCESS: Unit & Style Tests
SUCCESS: Ubuntu LTS: Build
SUCCESS: Ubuntu LTS: Integration
SUCCESS: MAAS Compatability Testing
IN_PROGRESS: Declarative: Post Actions
Click here to trigger a rebuild:
https:/
PASSED: Continuous integration, rev:80dd771ae2e
https:/
Executed test runs:
SUCCESS: Checkout
SUCCESS: Unit & Style Tests
SUCCESS: Ubuntu LTS: Build
SUCCESS: Ubuntu LTS: Integration
SUCCESS: MAAS Compatability Testing
IN_PROGRESS: Declarative: Post Actions
Click here to trigger a rebuild:
https:/
| Ryan Harper (raharper) wrote : | # |
There are quite a few with open() as fh: fh.read() chunks; if you're using cloudinit.util then you can just use util.load_file()
same for writing (util.write_file())
| Chad Smith (chad.smith) wrote : | # |
Thanks for working this josh. Here are a few more more comments. I'm still seeing spurious issues on my laptop trying to run this (I just hit an OOM as well) and NoValidConnecti
| Joshua Powers (powersj) wrote : | # |
Thanks for the reviews!
@chad.smith - It would be helpful to get your command line that you used where things failed or crashed.
For the record there are two design decisions that I want to clarify:
1) LXD still uses pylxd. I would like to change this over to mount-image-
2) I prefer to pass string commands around in functions versus having arrays of strings. It is far easier to develop when modifying a string than an array of strings. It also makes far more sense to have a command as a string, as an array is not a command. The function doing the processing can run shlex.
| Scott Moser (smoser) wrote : | # |
"It also makes far more sense to have a command as a string, as an array is not a command."
That is generally false.
A shell tokenizes a string based on some very complicated rules and turns it into an array which it then passes to execve(2).
If you ever have to pass a command that has a ", ', &, *, , # in it, then you'll end up wishing you could pass an array due to fighting the shell's interpretation.
we should do a better job in cloud-init in subp or this path of printing the command so you can cut and paste it than we do (not just printing the array), but that is fairly easily done.
i'll takea poke at fixing the shell stuff to proper arrays.
| Scott Moser (smoser) wrote : | # |
fyi, regarding mount-image-
https:/
:-(
| Scott Moser (smoser) wrote : | # |
To satisfy your desire to pass strings (which i agree are shorter)
we can make a requirement for (instance|
that does make simple usage simpler, i agree.
PASSED: Continuous integration, rev:6abf7c3fcce
https:/
Executed test runs:
SUCCESS: Checkout
SUCCESS: Unit & Style Tests
SUCCESS: Ubuntu LTS: Build
SUCCESS: Ubuntu LTS: Integration
SUCCESS: MAAS Compatability Testing
IN_PROGRESS: Declarative: Post Actions
Click here to trigger a rebuild:
https:/
PASSED: Continuous integration, rev:ee71778d942
https:/
Executed test runs:
SUCCESS: Checkout
SUCCESS: Unit & Style Tests
SUCCESS: Ubuntu LTS: Build
SUCCESS: Ubuntu LTS: Integration
SUCCESS: MAAS Compatability Testing
IN_PROGRESS: Declarative: Post Actions
Click here to trigger a rebuild:
https:/
| Scott Moser (smoser) wrote : | # |
I'm not opposed to the string changes, but it'd be nice if you did them in a separate mp.
see my suggestion to support strings in execute at
https:/
then you could do your string changes and then this, and it will look smaller.
| Joshua Powers (powersj) wrote : | # |
@smoser: few questions and answers below.
| Scott Moser (smoser) wrote : | # |
responded to comments from 09-08.
PASSED: Continuous integration, rev:f6397f8c2e7
https:/
Executed test runs:
SUCCESS: Checkout
SUCCESS: Unit & Style Tests
SUCCESS: Ubuntu LTS: Build
SUCCESS: Ubuntu LTS: Integration
SUCCESS: MAAS Compatability Testing
IN_PROGRESS: Declarative: Post Actions
Click here to trigger a rebuild:
https:/
FAILED: Continuous integration, rev:b7c7f3d1053
https:/
Executed test runs:
SUCCESS: Checkout
FAILED: Unit & Style Tests
Click here to trigger a rebuild:
https:/
PASSED: Continuous integration, rev:376168e251a
https:/
Executed test runs:
SUCCESS: Checkout
SUCCESS: Unit & Style Tests
SUCCESS: Ubuntu LTS: Build
SUCCESS: Ubuntu LTS: Integration
SUCCESS: MAAS Compatability Testing
IN_PROGRESS: Declarative: Post Actions
Click here to trigger a rebuild:
https:/
| Scott Moser (smoser) wrote : | # |
some comments...
I wont insist on any of these.
there is some cleanup that we need to do though.
| Scott Moser (smoser) wrote : | # |
I guess this is 'Approve' and we can fix things more later.


FAILED: Continuous integration, rev:273226e027b a483c3ae26787a2 975348ef6b07c5 /jenkins. ubuntu. com/server/ job/cloud- init-ci/ 52/
https:/
Executed test runs:
SUCCESS: Checkout
SUCCESS: Unit & Style Tests
SUCCESS: Ubuntu LTS: Build
FAILED: Ubuntu LTS: Integration
Click here to trigger a rebuild: /jenkins. ubuntu. com/server/ job/cloud- init-ci/ 52/rebuild
https:/