summaryrefslogtreecommitdiff
path: root/tests/unittests/test_datasource
AgeCommit message (Collapse)Author
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-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-10Replace RE context.sh parser with Scott's rewrite of bash dumper. Upper case ↵Vlastimil Holer
context variable names.
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-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-06fix pep8 and pylint warningsScott 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-24add SmartOS datasource supporting Joyent cloudBen Howard
This adds a datasource designed to work on Joyent cloud (SmartOS).
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-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-10add waiting for files and reading of crt keysScott Moser
2013-07-09build up the 'wait_for' list including fingerprint.crt filesScott Moser
2013-07-09fill out load_azure_ovf_pubkeysScott Moser
now if there are pubkeys, the cfg['_pubkeys'] entry will have a list of dicts where each dict has 'fingerprint' and 'path' entries. The next thing to do is to block waiting for the <fingerprint>.crt files to appear in /var/lib/waagent.
2013-07-09populate /var/lib/waagent with ovf-env.xmlScott Moser
this will copy the ovf-env.xml file that was found to the configured directory (default /var/lib/waagent)
2013-07-09better handling for user/passwordScott Moser
2013-07-09add some unit tests, fix things found by doing soScott Moser
2013-07-08fix test_nocloud testcaseScott Moser
2013-04-25fix testScott Moser
2013-04-02Apply pep8.patch by Javier Fontan <jfontan@opennebula.org>Vlastimil Holer
2013-03-26compatibility fixes for Fedora and RHELGreg Padgett
This patch fixes issues in Fedora 18 (and upcoming RHEL 7) which are present due to their use of systemd: - store locale configuration in /etc/locale.conf - store hostname in /etc/hostname - use a symlink for /etc/localtime (prior code would set the timezone but corrupt data in /usr/share/zoneinfo due to presence of symlink) It also contains fixes for issues unrelated to systemd adoption: - explicitly scan /dev/sr0 with blkid in order to get the optical drive in the blkid cache. This prevents an issue on systems running 2.6 kernels (such as RHEL 6) in which config disks on some devices won't be detected unless the device has previously been queried. (For reference, see https://patchwork.kernel.org/patch/1770241/) - append a newline when rewriting sysconfig files, as this is customary text configuration file formatting and is expected by some parsers (such as the ifcfg-rh plugin for NetworkManager)
2013-03-19merge from trunk at revno 799Scott Moser
2013-03-07pep8 and pylint fixesScott Moser
2013-02-23Get tests working and further adjustments.harlowja
2013-02-19Merged trunk lp:cloud-initVlastimil Holer
2013-02-19Test for more variable types in OpenNebula unit test.Vlastimil Holer
2013-02-19New unit tests for OpenNebula data source.Vlastimil Holer
2013-02-07more test cases for nocloud including one for config seedScott Moser
2013-02-07add test_nocloud unit tests, fix one issue foundScott Moser
2013-01-16DataSourceConfigDrive: consider CD rom as valid config-drive source.Scott Moser
previously, there was an attempt in the config drive source to limit the source device to a "full block device" rather than a partition. This was done by a simplistic approach of checking that the last character of the name was not a number. That was filtering out CD-rom devices (sr0). Now, we have a bit more sophisticated approach to that same problem. We filter out block devices that have a 'partition' entry in /sys/class/block/DEVICE_NAME/partition . LP: #1100545
2013-01-10Add a context manager function in test helpers.harlowja
This function can be used to ensure that mocker objects are restored and verified during usage if exceptions are thrown while the mock object is being used. Ensure it is used in the config drive test when multiple mock objects are being created and restored. LP: #1098430
2012-11-12config-drive-v2: support public keysScott Moser
This does a couple things: * separates out the 'normalize_public_keys' from the DataSource's get_public_ssh_keys * uses that from config-drive datasource * supports config drive v1 or v2 public-keys * adds a test. LP: #1077700
2012-10-27Helpful cleanups.harlowja
1. Remove the usage of the path.join function now that all code should be going through the util file methods (and they can be mocked out as needed). 2. Adjust all occurences of the above join function to either not use it or replace it with the standard os.path.join (which can also be mocked out as needed) 3. Fix pylint from complaining about the tests folder 'helpers.py' not being found 4. Add a pylintrc file that is used instead of the options hidden in the 'run_pylint' tool.
2012-10-23fix pep8/pylintScott Moser
2012-10-05Pylint cleanups.Joshua Harlow