summaryrefslogtreecommitdiff
path: root/tests/unittests
AgeCommit message (Collapse)Author
2016-05-11convert test_apt_source_ppa to use a mocked util.subpChristian Ehrhardt
2016-05-11fix specification of keyidChristian Ehrhardt
2016-05-11test test_apt_source_key with mocked util.subpChristian Ehrhardt
2016-05-10use proper asserRaises for try catchChristian Ehrhardt
2016-05-10provide valid matcher for ppa so that apt-add-repository is triggeredChristian Ehrhardt
2016-05-10add test_apt_source_key for sources with a keyid to importChristian Ehrhardt
2016-05-10add test_apt_source_ppa (failing for now)Christian Ehrhardt
2016-05-10split into basic and replacement testChristian Ehrhardt
2016-05-10basic apt_source testChristian Ehrhardt
2016-04-29Paths: fix instance path if datasource's id has a '/'.Scott Moser
If the datasource's instance id contained a '/' then the instance_id path would not be as expected under /var/lib/cloud/instances/instance_id. LP: #1575938
2016-04-15support and render control=manual on initramfs network devicesScott Moser
when reading the initramfs configurewd devices and turning them into network config, we change to not have 'auto' control (or allow=auto). The reason for this is that if the device was still up: a.) it would try to bring it up again (due to bug 1570142) b.) it would be brought down. 'b' is problematic if there is an iscsi or network root filesystem. Note, that ifupdown does now support 'no-auto-down' which means that the nic should not be brought down on 'ifdown -a'. LP: #1568637
2016-04-13chef: straighten out validation_cert and validation_keyScott Moser
Now, validation_key is always a path to a file, as it is in chef's client.rb syntax. validation_cert is always the *content* of that file that should be written. However, if validation_cert is the string "system", then we do not write that value, but rather assume the file exists. LP: #1568940
2016-04-12rh_subscription: only check subscription if configuredScott Moser
The rh_subscription config module would attempt to connect to the RHN servers even when no config is provided. Now, instead check to make sure that valid config is provided first. That consists of username and password or a activation key. LP: #1536706
2016-04-12chef: straighten out validation_cert and validation_keyScott Moser
Now, validation_key is always a path to a file, as it is in chef's client.rb syntax. validation_cert is always the *content* of that file that should be written. However, if validation_cert is the string "system", then we do not write that value, but rather assume the file exists. LP: #1568940
2016-04-11Add tests for lxd-bridgeStéphane Graber
2016-04-06Ensure that a resolve conf object is written as a string.Scott Moser
Instead of passing the raw object and expecting the write_file to work automatically make sure we explicitly pass the string version of it so that the write_file routine can correctly encode/decode it as needed. LP: #1479988
2016-04-06fix tests and hopefully actually workScott Moser
2016-04-05write_files: fix decompression of contentScott Moser
When provided with gzipped data, an exception would be raised because of a conversion to string. This fixes the issue and adds a test for write_files. LP: #1565638
2016-03-24support reading network config from kernel command lineScott Moser
This adds support for suppling network configuration on the kernel command line in 2 ways: a.) kernel command line includes 'network-config=<base64>' value of that parameter is base64 encoded json (or yaml) it is taken as network config yaml. In order to save space on kernel command line, it can be base64 encoded gzipped json also. b.) ip= paired with files authored by klibc's ipconfig tool When network devices are brought up in the initramfs, klibc's ipconfig tool writes files are named /run/net-<DEVNAME>.conf. The best documentation available on that tool is /usr/share/doc/libklibc/README.ipconfig.gz. Also changes util.get_cmdline() to return the command line of pid 1 if it is in a container. That is to make it consistent with The systemd generator, and allow passing a command line to lxd, as lxd does not mask /proc/cmdline.
2016-03-24add comments and improve error messagesScott Moser
2016-03-24add suport for base64 encoded gzipped text on command lineScott Moser
add tests to show this functional.
2016-03-23one more toxScott Moser
2016-03-23add unit testScott Moser
2016-03-23unittest: fix bad json test with ConfigDriveRyan Harper
Introduced a new path in configdrive, openstack/2015-10-15/, needed to add bogus data in that path as well to ensure config reader didn't find good data when testing for exception thrown.
2016-03-23configdata: parse and convert openstack network_data json to network_configRyan Harper
2016-03-22write to 50-cloud-init.cfg and write systemd.link rules.Scott Moser
2016-03-14change return value for dmi data of all \xff to be ""Scott Moser
Previously we returned a string of "." the same length as the dmi field. That seems confusing to the user as "." would seem like a valid response when in fact this value should not be considered valid. So now, in this case, return empty string.
2016-03-14change return value for dmi data of all \xff to be ""Scott Moser
Previously we returned a string of "." the same length as the dmi field. That seems confusing to the user as "." would seem like a valid response when in fact this value should not be considered valid. So now, in this case, return empty string.
2016-03-10dmi data: fix failure of reading dmi data for unset dmi valuesScott Moser
it is not uncommon to find dmi data in /sys full of 'ff'. utf-8 decoding of those would fail, causing warning and stacktrace. Return '.' instead of \xff. This is what dmidecode would return. $ dmidecode --string system-product-name
2016-03-10dmi data: fix failure of reading dmi data for unset dmi valuesScott Moser
it is not uncommon to find dmi data in /sys full of 'ff'. utf-8 decoding of those would fail, causing warning and stacktrace. Return '.' instead of \xff. This maps to what dmidecode would return $ dmidecode --string system-product-name .................................
2016-03-07No longer run pollinate by default in seed_randomScott Moser
The user can still choose to run pollinate here to seed their random data. And in an environment with network datasource, that would be expected to work. However, we do not want to run it any more from cloud-init because a.) pollinate's own init system jobs should get it ran before ssh, which is the primary purpose of wanting cloud-init to run it. b.) with a local datasource, there is no network guarantee when init_modules run, so pollinate -q would often cause issues then. c.) cloud-init would run pollinate and log the failure causing many cloud-init specific failures that it could do nothing about. LP: #1554152
2016-03-04pep8: update formatting to pass pep8 1.4.6 (trusty) and 1.6.2 (xenial)Ryan Harper
make check fails in a trusty sbuild due to different rules on older pep8. Fix formatting to pass in older and newer pep8.
2016-03-04Apply pep8, pyflakes fixes for python2 and 3Scott Moser
Update make check target to run pep8 and run pyflakes or pyflakes3 depending on the value of 'PYVER'. This way the python3 build environment does not need python2 and vice versa. Also have make check run the 'yaml' test. tox: have tox run pep8 in the pyflakes
2016-03-03Apply pep8, pyflakes fixes for python2 and 3 Ryan Harper
Update make check target to use pep8, pyflakes, pyflakes3.
2016-03-03Fix pyflake/pyflake3 errorsRyan Harper
Now we can run make check to assess pep8, pyflakes for python2 or 3 And execute unittests via nosetests (2 and 3).
2016-03-03Update pep8 runner and fix pep8 issuesRyan Harper
2016-03-03fix lxd module to not do anything unless config providedScott Moser
2016-03-03run pyflakes in more places, fix falloutScott Moser
this makes 'make' run pyflakes, so failures there will stop a build. also adds it to tox.
2016-03-01Add Image Customization Parser for VMware vSphere Hypervisor Support.Scott Moser
This is the first changeset submitted as a part of project to add cloud-init support for VMware vSphere Hypervisor. This changeset contains _only_ the changes for a simple python parser for a Image Customization Specification file pushed by VMware vSphere hypervisor into the guest VMs. In a later changeset, will be submitting another patch to actually detect the underlying VMware vSphere hypervisor and do the necessary customization.
2016-03-01lxd: general fix after testingScott Moser
A few changes: a.) change to using '--name=value' rather than '--name' 'value' b.) make sure only strings are passed to command (useful for storage_create_loop: which is likely an integer) c.) document simple working example d.) support installing zfs if not present and storage_backedn has it.
2016-02-25merge with trunkScott Moser
2016-02-16 - Used proper 4 space indentations for config_nic.py and nic.pySankar Tanguturi
- Implemented the 'search_file' function using 'os.walk()' - Fixed few variable names. - Removed size() function in config_file.py - Updated the test_config_file.py to use len() instead of .size()
2016-02-16Handle escaped quotes in WALinuxAgentShim.find_endpointScott Moser
LP: #1488891
2016-02-08 - Added new Unittests for VMware support.Sankar Tanguturi
2016-02-04Merge from trunk and resolve text conflict in ChangeLogWesley Wiedenmeier
2016-02-04Use mock in test_handler_lxd.py and add test for lxd installationWesley Wiedenmeier
2016-02-04SmartOS: Add support for Joyent LX-Brand Zones (LP: #1540965)Robert Jennings
LX-brand zones on Joyent's SmartOS use a different metadata source (socket file) than the KVM-based SmartOS virtualization (serial port). This patch adds support for recognizing the different flavors of virtualization on SmartOS and setting up a metadata source file object. After the file object is created, the rest of the code for the datasource LP: #1540965
2016-02-03lxd: add support for setting up lxd using 'lxd init'Wesley Wiedenmeier
If lxd key is present in cfg, then run 'lxd init' with values from the 'init' entry in lxd configuration as flags.
2015-10-30Use DMI data to find Azure instance IDs.Daniel Watkins
This replaces the use of SharedConfig.xml in both the walinuxagent case, and the case where we communicate with the Azure fabric ourselves.
2015-10-14AZURE: support extracting SSH key values from ovf-env.xmlBen Howard
Azure has or will be offering shortly the ability to directly define the SSH key value instead of a fingerprint in the ovf-env.xml file. This patch favors defined SSH keys over the fingerprint method (LP: #1506244).