summaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
2014-01-08Significant re-working of the userdata handling and introduction ofBen Howard
vendordata. Vendordata is a datasource provided userdata-like blob that is parsed similiarly to userdata, execept at the user's pleasure. cloudinit/config/cc_scripts_vendor.py: added vendor script cloud config cloudinit/config/cc_vendor_scripts_per_boot.py: added vendor per boot cloud config cloudinit/config/cc_vendor_scripts_per_instance.py: added vendor per instance vendor cloud config cloudinit/config/cc_vendor_scripts_per_once.py: added per once vendor cloud config script doc/examples/cloud-config-vendor-data.txt: documentation of vendor-data examples doc/vendordata.txt: documentation of vendordata for vendors (RENAMED) tests/unittests/test_userdata.py => tests/unittests/test_userdata.py TO: tests/unittests/test_userdata.py => tests/unittests/test_data.py: userdata test cases are not expanded to confirm superiority over vendor data. bin/cloud-init: change instances of 'consume_userdata' to 'consume_data' cloudinit/handlers/cloud_config.py: Added vendor script handling to default cloud-config modules cloudinit/handlers/shell_script.py: Added ability to change the path key to support vendor provided 'vendor-scripts'. Defaults to 'script'. cloudinit/helpers.py: - Changed ConfigMerger to include handling of vendordata. - Changed helpers to include paths for vendordata. cloudinit/sources/__init__.py: Added functions for helping vendordata - get_vendordata_raw(): returns vendordata unprocessed - get_vendordata(): returns vendordata through userdata processor - has_vendordata(): indicator if vendordata is present - consume_vendordata(): datasource directive for indicating explict user approval of vendordata consumption. Defaults to 'false' cloudinit/stages.py: Re-jiggered for handling of vendordata - _initial_subdirs(): added vendor script definition - update(): added self._store_vendordata() - [ADDED] _store_vendordata(): store vendordata - _get_default_handlers(): modified to allow for filtering which handlers will run against vendordata - [ADDED] _do_handlers(): moved logic from consume_userdata to _do_handlers(). This allows _consume_vendordata() and _consume_userdata() to use the same code path. - [RENAMED] consume_userdata() to _consume_userdata() - [ADDED] _consume_vendordata() for handling vendordata - run after userdata to get user cloud-config - uses ConfigMerger to get the configuration from the instance perspective about whether or not to use vendordata - [ADDED] consume_data() to call _consume_{user,vendor}data cloudinit/util.py: - [ADDED] get_nested_option_as_list() used by cc_vendor* for getting a nested value from a dict and returned as a list - runparts(): added 'exe_prefix' for running exe with a prefix, used by cc_vendor* config/cloud.cfg: Added vendor script execution as default tests/unittests/test_runs/test_merge_run.py: changed consume_userdata() to consume_data() tests/unittests/test_runs/test_simple_run.py: changed consume_userdata() to consume_data()
2013-10-02Added ability to define disks via 'ephemeralX.Y'.Ben Howard
Modified cc_mounts to identify whether ephermalX is partitioned. Changed datasources for Azure and SmartOS to use 'ephemeralX.Y' format. Added disk remove functionally
2013-10-02examples/cloud-config-user-groups.txt doc fix, fix pep8Scott Moser
fix documentation of mkpasswd usage in doc/examples/cloud-config-user-groups.txt Also, Precise's version of pep8 insists on ordering of imports, but saucy's has not. So we had some incorrect ordering. This fixes './tools/run-pep8' on precise.
2013-10-02fix permission changesScott Moser
2013-10-01Reordered several imports in order for test suite to pass.Eric Nordlund
2013-09-27fix test to adjust for 'ephemeral0' being /dev/sdbScott Moser
2013-09-27fix tests small other changesScott Moser
Also * cloudinit/sources/DataSourceAzure.py: invalid xml in a file called 'ovfenv.xml' should raise BrokenAzureDatasource rather than NonAzureDataSource * cloudinit/sources/DataSourceSmartOS.py: cloudinit/sources/DataSourceAzure.py use 'ephemeral0' as the device name in builtin fs_setup * tests/unittests/test_datasource/test_azure.py: * always patch 'list_possible_azure_ds_devs' as it calls find_devs_with which calls blkid, and dramatically was slowing down tests on my system. * test_user_cfg_set_agent_command_plain: fix this test to not depend on specific format of yaml.dumps(). * test_userdata_arrives: add a test that user-data makes it through
2013-09-26Added support for formating the ephemeral disk on Windows Azure.Ben Howard
2013-09-19Fixes for the MP.Ben Howard
Changed cc_disk_setup to handle the file systems as a label, no longer passing "log" around. Tidied up the documentation to reflect the changes and made grammer, spelling and improved the content a little. Added disk_setup to the default modules list.
2013-09-11merge from trunkScott Moser
2013-09-11All fake util.find_devs_with set before try-finally sectionVlastimil Holer
2013-09-10some cleanups and changesScott Moser
* use util.subp from inside parse_shell_config, and adjust exception handling accordingly. * add 'switch_user_cmd' as a callback function to pass to parse_shell_config, which allows us to mock this to avoid 'sudo' when running test cases. Basically the test cases just return '[]' here. * fix some pylint * handle empty 'content' in parse_shell_config and remove the protection that was present.
2013-09-10Fix detection of ETHx_IP context variable, add test.Vlastimil Holer
2013-09-10Detect invalid system user for testVlastimil Holer
2013-09-10Configurable OpenNebula::parseuser. Seed search dir+dev merge. ↵Vlastimil Holer
Eat shell parser error output. Few tests for tests for get_data.
2013-09-09Add support for reading 'random_seed' from data source.Scott Moser
A new field in the metadata has emerged on openstack config drive, one that provides a way to seed the linux random generator. This adds a 'random_seed' config module that writes and that it to /dev/urandom. Also added is support for reading that data on azure via the hyper-v acpi table data. In config drive datasource, it rewrites parts of the on_boot code to use a little helper class.
2013-09-10Replace RE context.sh parser with Scott's rewrite of bash dumper. Upper case ↵Vlastimil Holer
context variable names.
2013-09-08Add test + remove jsonschema (for now)Joshua Harlow
2013-09-05PEP8 and Pylint fixes. Move context.sh "parser" into separateVlastimil Holer
function. Fix fetching user specified dsmode (from context). Rename context_sh->context. Reuse unittests.helpers.populate_dir.
2013-09-05Merged trunk lp:cloud-initVlastimil Holer
2013-09-04Fix RE matching context variables. Test cleanups.Vlastimil Holer
2013-09-04Apply parse.diff by Javier Fontan <jfontan@opennebula.org>Vlastimil Holer
2013-08-24changes to behavior on specifying keys.Scott Moser
The most likely end user operation (or at least a valid one) for base64 encoding would be to encode the user-data, but leave all other values as plaintext. In order to facilitate that, the user can simply add: b64-user-data=true to indicate that user-data is base64 encoded. Other changes here are to change the cloud-config and metadata keynames that are used. base64_all = boolean(True) base64_keys = [list, of, keys] Fixed up tests to accomodate.
2013-08-20Updated merge proposal with current treeBen Howard
2013-08-20Fixed no_base64_decode settingsBen Howard
2013-08-15fix setting of password for a user on azure.Scott Moser
If azure ovf data specified a password, then get that password passed through to useradd. Also updates the test case to verify that the value was encrypted correctly. LP: #1212723
2013-08-15pylint fixScott Moser
2013-08-15do not set 'password', but set 'passwd' to crypt'd valueScott Moser
'password' was the wrong key. It should have been setting the default user's "plain_text_password". Instead of doing that, though, we're encrypting the value and putting it in 'passwd', which will then be passed on to useradd. The key value in doing this is that the plain text password will not be stored in obj.pkl. (admittedly it is still in plain text in the ovf-env.xml file).
2013-08-14cc_growpart: prefer growpart over parted 'resizepart'Scott Moser
the resizepart code was not functional. We will re-favor it later under bug 1212492. For now, we'll just favor the 'growpart' resizer. Both will be found in Ubuntu cloud images. LP: #1212444
2013-08-14cc_growpart: prefer growpart over parted 'resizepart'Scott Moser
the resizepart code was not functional. We will re-favor it later under bug 1212492. For now, we'll just favor the 'growpart' resizer. Both will be found in Ubuntu cloud images. LP: #1212444
2013-08-06merge from trunkScott Moser
2013-08-06fix pep8 and pylint warningsScott Moser
2013-08-06remove unused importsScott Moser
2013-08-06add tests for apply_apt_configScott Moser
2013-07-30Added base64 support to SmartOS datasource.Ben Howard
Added documentation on SmartOS datasource.
2013-07-25minor azure cleanupScott Moser
2013-07-25azure: support bouncing interfaces to publish new hostnameScott Moser
See the added doc/sources/azure/README.rst for why this is necessary. Essentially, we now are doing the following in the get_data() method of azure datasource to publish this NewHostname: hostname NewHostName ifdown eth0; ifup eth0 LP: #1202758
2013-07-24tests: fix pep8 issueScott Moser
Move long lines out of the test_util.py file and into tests/data. no pep8 or pylint errors now.
2013-07-24add test case for mime gzipped message segmentsJoshua Harlow
2013-07-24Fix small prefix bug + jsonp tests.Joshua Harlow
Fix the wrong usage of the prefix removal array action by just using the new util function that does these actions correctly. Add in a couple of unit tests to verify the jsonp merging and usage works as expected.
2013-07-24add SmartOS datasource supporting Joyent cloudBen Howard
This adds a datasource designed to work on Joyent cloud (SmartOS).
2013-07-24Add test for mime gzipped message segments.Joshua Harlow
2013-07-23Changed get_serial to be fully parameterized and return the serialBen Howard
initialized. Added a mapping of attributes between cloud-init and smartos.
2013-07-23on azure datasource, grab use Deployment as the instance-idScott Moser
LP: #1204190
2013-07-18Added SmartOS datasource and unit tests.Ben Howard
2013-07-17merge from trunkScott Moser
2013-07-17Azure: make /var/lib/waagent with 0700 permsScott Moser
The walinux agent expects that the files it writes with 0644 (default umask) permissions are not globally readable. Since we were creating the directory for it, and using default umaks (0755), the files inside were readable to non-priviledged users.
2013-07-11test_builtin_handlers.py: fix pylintScott Moser
2013-07-10add waiting for files and reading of crt keysScott Moser
2013-07-09build up the 'wait_for' list including fingerprint.crt filesScott Moser