Merge ~smoser/cloud-init:cleanup/cii-cleanup into cloud-init:master
| Status: | Merged |
|---|---|
| Approved by: | Scott Moser on 2017-11-06 |
| Approved revision: | 7897d64b94fd3aa6d119d533f808f2f11d6ecd6a |
| Merged at revision: | 8622491c29f30862a1a1d7ad2cba023981acc8ce |
| Proposed branch: | ~smoser/cloud-init:cleanup/cii-cleanup |
| Merge into: | cloud-init:master |
| Diff against target: |
1197 lines (+348/-333) 25 files modified
tests/cloud_tests/collect.py (+16/-2) tests/cloud_tests/images/base.py (+3/-16) tests/cloud_tests/images/lxd.py (+18/-14) tests/cloud_tests/images/nocloudkvm.py (+18/-24) tests/cloud_tests/instances/base.py (+4/-77) tests/cloud_tests/instances/lxd.py (+56/-48) tests/cloud_tests/instances/nocloudkvm.py (+52/-91) tests/cloud_tests/testcases/examples/run_commands.yaml (+2/-2) tests/cloud_tests/testcases/modules/keys_to_console.py (+4/-4) tests/cloud_tests/testcases/modules/runcmd.yaml (+2/-2) tests/cloud_tests/testcases/modules/set_hostname.py (+3/-1) tests/cloud_tests/testcases/modules/set_hostname.yaml (+2/-1) tests/cloud_tests/testcases/modules/set_hostname_fqdn.py (+7/-3) tests/cloud_tests/testcases/modules/set_hostname_fqdn.yaml (+2/-2) tests/cloud_tests/testcases/modules/set_password_expire.py (+1/-1) tests/cloud_tests/testcases/modules/set_password_expire.yaml (+2/-0) tests/cloud_tests/testcases/modules/set_password_list.yaml (+1/-0) tests/cloud_tests/testcases/modules/set_password_list_string.yaml (+1/-0) tests/cloud_tests/testcases/modules/ssh_auth_key_fingerprints_disable.py (+0/-8) tests/cloud_tests/testcases/modules/ssh_auth_key_fingerprints_disable.yaml (+0/-1) tests/cloud_tests/testcases/modules/ssh_keys_generate.py (+0/-5) tests/cloud_tests/testcases/modules/ssh_keys_generate.yaml (+0/-6) tests/cloud_tests/testcases/modules/ssh_keys_provided.py (+0/-11) tests/cloud_tests/testcases/modules/ssh_keys_provided.yaml (+0/-6) tests/cloud_tests/util.py (+154/-8) |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Joshua Powers (community) | Approve on 2017-11-06 | ||
| Chad Smith | 2017-10-31 | Approve on 2017-11-06 | |
| Server Team CI bot | continuous-integration | Needs Fixing on 2017-11-06 | |
|
Review via email:
|
|||
Commit Message
tests: integration test cleanup and full pass of nocloud-kvm.
Integration test harness changes:
* Enable collection of console log in nocloud-kvm and lxd.
* Collect the console log to results for all test runs.
* change 'tmpfile' to pick name locally instead of using 'mktemp'.
* drop the 'instance' attribute from nocloud-kvm Image and
demote LXDImage.instance to a private attribute.
This is because Images do not actually have instances.
(LXDImage internally uses a booted system to modify the image).
* Add 'TargetBase' as a superclass of Image and Instance providing
implementations of execute, read_data, write_data, pull_file,
and push_file. These all depend on an implementation of _execute.
* Improve '_execute' implementations to support accepting stdin.
* execute supports 'rcs=False' meaning 'do not raise exception'.
* Drop support for pylxd < 2.2. older versions cannot determine
exit code of 'execute', which makes them unusable.
* make NoCloudKVMInsta
some changes so that 'hostname' could be reverse-looked up in order
to avoid sudo taking a long time (~20 seconds).
Test changes here:
* do not use /tmp, but rather /var/tmp (LP: #1707222)
* make keys_to_console assertions more strict.
* change user test cases to always add default (ubuntu) user
so that nocloud-kvm's execute which operates over ssh can work.
Description of the Change
Lots of things here.
following onto Josh's branch from
https:/
read commit message for ididivudal things until i write a better commit message.
PASSED: Continuous integration, rev:4ce1002cb59
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:773013c4f05
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:3f395a74479
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 : | # |
I'm not sure I understand the dropping of instance property from the NoCloud KVM class vs. the LXD one.
| Scott Moser (smoser) wrote : | # |
> I'm not sure I understand the dropping of instance property from the NoCloud
> KVM class vs. the LXD one.
An Image does not have an instance associated with it.
An 'Image' is something you can manipulate the contents of (execute,
write_file, read_file) but is not booted. Imagine it being a .img file
that you can mount-image-
Currently the lxd Image is something that has to be booted in order to
provide those operations. It uses an actual lxd.Instance to do that.
There is nothing specifically wrong about this, and may well be how
we have to do things on some platforms.
My goal on lxd though would be to replace that with 'lxd-pstart' (or
lxd-pstart like function). That way there is no 'cleaning' required
as there are no side-effects of the original boot.
I believe that its name and "important look" made Josh believe he needed
to implement .instance in nocloudkvm's Image. So, I demoted the .instance
to be private.
- 8973cb2... by Scott Moser on 2017-11-01
- 989b215... by Scott Moser on 2017-11-01
| Ryan Harper (raharper) wrote : | # |
On Wed, Nov 1, 2017 at 1:45 PM, Scott Moser <email address hidden>
wrote:
> > I'm not sure I understand the dropping of instance property from the
> NoCloud
> > KVM class vs. the LXD one.
>
> An Image does not have an instance associated with it.
>
> An 'Image' is something you can manipulate the contents of (execute,
> write_file, read_file) but is not booted. Imagine it being a .img file
> that you can mount-image-
>
> Currently the lxd Image is something that has to be booted in order to
> provide those operations. It uses an actual lxd.Instance to do that.
> There is nothing specifically wrong about this, and may well be how
> we have to do things on some platforms.
>
OK, IIUC, since NoCloud uses mount-image-
the image without the need for an "instance" of it (aka, booted).
> --
> https:/
> init/+merge/333059
> Your team cloud-init commiters is requested to review the proposed merge
> of ~smoser/
>
> _______
> Mailing list: https:/
> Post to : <email address hidden>
> Unsubscribe : https:/
> More help : https:/
>
| Ryan Harper (raharper) wrote : | # |
One more round on the @property structure, see inline.
PASSED: Continuous integration, rev:989b2154a38
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:/
- b6409c0... by Scott Moser on 2017-11-01
- f385dc4... by Scott Moser on 2017-11-01
FAILED: Continuous integration, rev:b4f6b54f3c3
https:/
Executed test runs:
SUCCESS: Checkout
FAILED: Unit & Style Tests
Click here to trigger a rebuild:
https:/
- dd3b6c0... by Scott Moser on 2017-11-02
FAILED: Continuous integration, rev:ac32c998307
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:/
FAILED: Continuous integration, rev:d4b5f240c6c
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:/
FAILED: Continuous integration, rev:5f6aa3bc02f
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:/
- 3de1be3... by Scott Moser on 2017-11-02
- dbb2a8e... by Scott Moser on 2017-11-02
- 9b4fbdf... by Scott Moser on 2017-11-02
PASSED: Continuous integration, rev:3de1be31b1b
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:7d1c5e8092e
https:/
Executed test runs:
SUCCESS: Checkout
FAILED: Unit & Style Tests
Click here to trigger a rebuild:
https:/
FAILED: Continuous integration, rev:9b4fbdf073c
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:9b4fbdf073c
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:/
- 5d38855... by Scott Moser on 2017-11-02
PASSED: Continuous integration, rev:5d38855c625
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:/
| Joshua Powers (powersj) wrote : | # |
I cannot get the nocloud-kvm datasource to even run with the following commit:
$ git rev-parse HEAD
5d38855c6254d82
One comment below about a debug message and should the commit message more verbosely call out the new TargetBased class?
* PASS - lxd run xenial
* PASS - lxd tree_run xenial
* FAIL - nocloud-kvm run xenial
* FAIL - nocloud-kvm run artful
* FAIL - nocloud-kvm tree_run artful
nocloud-kvm failure:
2017-11-03 18:14:58,081 - tests.cloud_tests - ERROR - stage part: script file_gzip encountered error: [Errno None] Unable to connect to port 47557 on 127.0.0.1
2017-11-03 18:14:58,081 - tests.cloud_tests - ERROR - traceback:
File "/tmp/cloud-
call()
File "/tmp/cloud-
description
File "/tmp/cloud-
stdin=script, description=
File "/tmp/cloud-
out, err, rc = self._execute(
File "/tmp/cloud-
return self.ssh(['sudo'] + env_args + list(command), stdin=stdin)
File "/tmp/cloud-
client = self._ssh_connect()
File "/tmp/cloud-
banner_
File "/usr/lib/
raise NoValidConnecti
| Scott Moser (smoser) wrote : | # |
Can you paste a full log of what you did ?
This works fine for me on diglett. here is what I did:
$ tox-venv citest python3 -m tests.cloud_tests run --platform=
a-dir=results.
- ec53bbb... by Scott Moser on 2017-11-03
- 397ae68... by Scott Moser on 2017-11-03
PASSED: Continuous integration, rev:397ae68232a
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 : | # |
Per the issue JoshPowers brought up on Friday, sudo times out after 20 seconds on the kvm instances due to the inability to resolve the 'ubuntu' hostname. That 20 second timeout affects every single instance.execute which runs 'sudo'.
I think smoser & rharper brought up the possible solution to
1. reuse ssh connection
2. Possibly add ubuntu to /etc/hosts so we don't hit DNS resolution errors for nocloud.
Here is a patch which takes smoser's ssh connection caching/reuse + my changes to update etc_hosts on nocloudkvm images
http://
| Chad Smith (chad.smith) wrote : | # |
After applying the above patch I see all collect artifact calls returning quickly instead of being affected by the sudo timeout
| Chad Smith (chad.smith) wrote : | # |
..... haven't run through the full test suite though. it seems some tests are still hitting a timeout at 20 seconds on each collect artifact call. not sure if that's because we've reset the hostname in those tests :/
- 15549a3... by Scott Moser on 2017-11-06
- 7897d64... by Scott Moser on 2017-11-06
- d85fabb... by Scott Moser on 2017-11-06
| Chad Smith (chad.smith) wrote : | # |
Let's make that a proper cut-n-paste
http://
FAILED: Continuous integration, rev:2c6ac709bf4
https:/
Executed test runs:
SUCCESS: Checkout
FAILED: Unit & Style Tests
Click here to trigger a rebuild:
https:/
PASSED: Continuous integration, rev:b5aea7d2986
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:33d646d4a95
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:/
| Scott Moser (smoser) wrote : | # |
Josh,
Could you re-review?
I think I addressed your issues, making execute show the description.
FAILED: Continuous integration, rev:7897d64b94f
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:/
| Chad Smith (chad.smith) wrote : | # |
Performance is all good on my side now that your brickeies A-records are registered. I no longer see 20 second timeouts between collect calls. Minor nits inline. Let's land this and iterate on ec2.
| Chad Smith (chad.smith) wrote : | # |
... once ci passes and torkoal is fixed.
| Scott Moser (smoser) wrote : | # |
Bah. I saw your approved and didn't read your comments. Sorry for setting presumptuous.
On November 6, 2017 4:42:33 PM EST, Chad Smith <email address hidden> wrote:
>... once ci passes and torkoal is fixed.
>--
>https:/
>You are the owner of ~smoser/


PASSED: Continuous integration, rev:e8f618c9c72 e723e66f63eaaaf afb9d392b15593 /jenkins. ubuntu. com/server/ job/cloud- init-ci/ 456/
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: /jenkins. ubuntu. com/server/ job/cloud- init-ci/ 456/rebuild
https:/