Merge ~powersj/cloud-init:cii-fix-kvm-tests into cloud-init:master
| Status: | Merged |
|---|---|
| Merge reported by: | Scott Moser |
| Merged at revision: | 13e29b79db4efc46db725a793a3840b8832149c9 |
| Proposed branch: | ~powersj/cloud-init:cii-fix-kvm-tests |
| Merge into: | cloud-init:master |
| Diff against target: |
410 lines (+46/-75) 19 files modified
tests/cloud_tests/instances/base.py (+4/-1) tests/cloud_tests/instances/nocloudkvm.py (+1/-1) tests/cloud_tests/testcases/examples/run_commands.yaml (+2/-2) tests/cloud_tests/testcases/examples/writing_out_arbitrary_files.yaml (+9/-10) 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/seed_random_command.yaml (+2/-2) tests/cloud_tests/testcases/modules/seed_random_data.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 (+2/-5) tests/cloud_tests/testcases/modules/ssh_keys_provided.py (+0/-11) tests/cloud_tests/testcases/modules/ssh_keys_provided.yaml (+4/-10) tests/cloud_tests/testcases/modules/write_files.yaml (+9/-10) |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Server Team CI bot | continuous-integration | Approve on 2017-10-31 | |
| Chad Smith | 2017-10-03 | Approve on 2017-10-26 | |
|
Review via email:
|
|||
Commit Message
tests: Enable all tests for nocloud-kvm backend
The original testcases were written using the lxd backend only. This
commit enables the use of the nocloud-kvm backend for all testcases. The
primary changes revolve around 3 areas:
* Ensure all tests execute as root per spec via sudo
* Move from /root to /var/tmp or $HOME - with lxd we login as root by
default, but that is not the case with nocloud-kvm or other backends.
* Update ssh key auth user to not be root and either update or remove a
few key checks.
| Scott Moser (smoser) wrote : | # |
probably use of /tmp is dangerous.
maybe not.
https:/
| Chad Smith (chad.smith) wrote : | # |
Integration tests nocloud-kvm work well on a fresh artful install when I do the following:
sudo apt install python3-
sudo mkdir -i /srv/citest
sudo chown me:me /srv/citest
python3 -m tests.cloud_tests run -p nocloud-kvm --os-name artful --preserve-data -data-dir restults --verbose -deb cloud-init_
| Chad Smith (chad.smith) wrote : | # |
for tox -e citest to work this branch was missing a rebase I think on master to pull in bzr:lp:simplestreams
| Chad Smith (chad.smith) wrote : | # |
kvm run output
http://
| Scott Moser (smoser) wrote : | # |
At first I was not keen on the use of /var/tmp, as I knew that Ubuntu was carrying a patch to systemd upstream for that behavior, and figured that we were really just buying time before someone decided "oh lets remove /var/tmp/ also".
I dug a bit, patch [1] that does this is to fix Debian bug 675422 [2].
That bug references the FHS [3] which at least gives us a reasonable justification for
our use:
| The /var/tmp directory is made available for programs that require
| temporary files or directories that are preserved between system
| reboots. Therefore, data stored in /var/tmp is more persistent than
| data in /tmp.
| Files and directories located in /var/tmp must not be deleted when the
| system is booted. Although data stored in /var/tmp is typically deleted
| in a site-specific manner, it is recommended that deletions occur at a
| less frequent interval than /tmp.
So, it seems sane that /var/tmp can be used.
But for some use cases /run/my-dir is better (in that it is guaranteed
to *not* have stale data across a boot).
[1] https:/
[2] https:/
[3] http://
| Scott Moser (smoser) wrote : | # |
With regard to "not logged in as root by default", that is kind of wrong.
Any 'instance.
different would mean that the caller has to adjust their usage based on
the backend being used. That is kind of painful.
lets see if we can't just easily fix that.
| Joshua Powers (powersj) wrote : | # |
>lets see if we can't just easily fix that.
I looked a little bit at this, particularly at the tests/cloud_
I think this is better tackled by removing our method of pushing a script and then executing that script and instead of going to your proposed method of specifying what is collected, specifically:
# These files should be collected when we from the running instance
# at the end of boot. Anything ending in a '/' should include
# be recursive.
files:
- /run/cloud-init/
- /var/lib/cloud/
- /etc/passwd
# These are exectuted and the dictionary available to the test results.
collect_scripts:
hosts: [cat, /etc/hosts]
ps-a: [ps, -a]
At that point, we can handle the execution of by root then and there.
Thoughts? Is there an easy mechanism I have overlooked?
FAILED: Continuous integration, rev:6d9dd0da9b0
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:6d9dd0da9b0
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:806f48840ef
https:/
Executed test runs:
SUCCESS: Checkout
FAILED: Unit & Style Tests
Click here to trigger a rebuild:
https:/
PASSED: Continuous integration, rev:59d162eecd4
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 : | # |
tmpfile should look more like this:
def tmpfile(self):
path = "/tmp/%s-%04d" % (type(self)
return path
then we're good.
as is, the tmpfile name never changed, which is kind of not very tmpfile-like
PASSED: Continuous integration, rev:6c3c9fc43cd
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:13e29b79db4
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 : | # |
pushed a branch of mine to
https:/
which takes this and adds.
| Scott Moser (smoser) wrote : | # |
I've called this merged as my branch went in.
thanks josh.


PASSED: Continuous integration, rev:f1a66a42318 242811556b71e56 5ce54de2c6e177 /jenkins. ubuntu. com/server/ job/cloud- init-ci/ 374/
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/ 374/rebuild
https:/