summaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
2013-03-07pep8 and pylint fixesScott Moser
2013-03-05pep8, pylint, make resize_devices return more usefulScott Moser
resize_devices now contains what action occurred for each entry.
2013-03-05remove 'log' passing. call growpart with --dry-run first.Scott Moser
growrun --dry-run will exit 1 if it wouldn't do anything. so call it, check for '1' and if no change, then just return.
2013-03-05change default (no 'growpart' in config) to use 'auto' and '/'Scott Moser
2013-03-04test of resize, a couple small fixesScott Moser
2013-03-04add the unit test, fix a few issuesScott Moser
2013-03-01change parser.parse 'default_opts' to 'options'Scott Moser
Now, parser.parse specifies options that override any options found, rather than just being default options. There could still potentially be a user for default_options, but since we're not using them anywhere, I've dropped it. The difference is that in setting up the root user, we're now insisting that all keys that go in there have the key_prefix, even if the key content had other options. I think this is actually the commit that fixes LP: #1136343.
2013-03-01add some unit tests, fix an issue or twoScott Moser
* drop the parsing of options into csv, as we were only exploding them back. That can only result in error. Just do minimal parsing. * change the parsing of key lines to: if entry is valid: * use it else try taking off options: if good, use it else fail
2013-03-01skip unit test due to LP: #1124384Scott Moser
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-24Merge the old user style with the distro provided config.harlowja
When the old user: style entry is found, don't forget that we need to use the distro settings that are provided but override the name with the new name, this is now accomplished by merging them together in the correct order (using the standard cloud-init merging algo).
2013-01-18Adjust how the legacy user: XYZ config alters the normalized user listJoshua Harlow
Previously if a legacy user: XYZ entry was found, XYZ would not automatically be promoted to the default user but would instead just be added on as a new entry to the normalized user list. It appears the behavior that is wanted is for the XYZ entry to be added on as the default user (thus overriding a distro provided default user), which better matches how the code previous worked. LP: #1100920
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-12-17tell upstart to reload configuration after writing an upstart jobScott Moser
Invoking 'initctl reload-configuration' is only required if inotify does not work. overlayroot does not support inotify. So, we just call initctl always, which wont hurt anything. LP: #1080841
2012-12-01make sure no blank lines before cloud-init entry in ca-certificates.confScott Moser
when /etc/ca-certificates.conf is read by update-ca-certificates lines after a blank line get ignored. Here, ensure that there are no blank lines, and no duplicate entries for cloud-init are added. LP: #1077020
2012-11-20pep8 and pylintScott Moser
2012-11-14Cleanup the tests slightly.Joshua Harlow
2012-11-14Add the string sudoers rule test case as well.Joshua Harlow
2012-11-14Add a test to make sure this doesn't happen again.Joshua Harlow
2012-11-13Create a utility testcase class that fixes some of the 2.6 missing piecesJoshua Harlow
- Add a helper testcase class that can add additional features into the unit test class as we need for features that are useful to have which starts with features that are missing including assertIn and assertNotIn LP: #1078473
2012-11-13implement power_state with tests.Scott Moser
2012-11-13replace 'with self.assertRaises(Exception):' with different formScott Moser
I'm guessing that with self.assertRaises(Exception): something here is an acceptable form in a newer or older python. But my python (2.7.3-0ubuntu7) doesn't like it. Interestingly, python unittest doc says: | Changed in version 2.7: Added the ability to use assertRaises() as | a context manager.
2012-11-12Pylint and pep8 cleanups.Joshua Harlow
2012-11-12Rebased with HEAD and resolved conflicts.Joshua Harlow
2012-11-12test_handler_yum_add_repo: fix broken testScott Moser
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-11-10whitespace / indentation cleanupsScott Moser
These changes were pulled out of the previous merge (cc_yum_add_repo) as they were unrelated there. Re-applying them here.
2012-11-10add yum_add_repo configuration moduleScott Moser
Add in a configuration module that can write out the yum.repo format for those that want to hook into different repos for installing.
2012-11-101 pep8 and 1 pylint fixScott Moser
2012-11-10revert unrelated whitespace changes that creeped in.Scott Moser
2012-11-10sync with trunkScott Moser
2012-11-10Sudoers.d creation cleanups + tests.Joshua Harlow
2012-11-09Fix the merging of group configuration.Joshua Harlow
2012-11-09Fix the merging of group configurationJoshua Harlow
when that group configuration is a dict => members. LP: #1077245
2012-11-09Merge the yaml/cloud config examples checking tool.Joshua Harlow
2012-11-09Fix the fqdn/hostname case for rhel and ubuntuJoshua Harlow
where rhel uses the fqdn for its config while ubuntu uses the short hostname.
2012-11-08Forgot the test!Joshua Harlow
2012-11-08Ensure that at needed stages the local variablesJoshua Harlow
of the init class are reset so that when they are regenerated that they will use the updated data instead of using previous data (since they weren't reset). LP: #1076811
2012-11-07Add a makefile yaml checking targetJoshua Harlow
and fix the cases where the cc yaml is not correct.
2012-11-071. Rebased with trunkJoshua Harlow
2. Added example cloud-config 3. Added functioning test for yum config
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-23use only util methods for reading/loading/appending/peekingScott Moser
Use only util methods for reading/loading/appending/peeking at files since it is likely soon that we will add a new way of adjusting the root of files read, also it is useful for debugging to track what is being read/written in a central fashion.
2012-10-23Add helpers for wrapping file operationsScott Moser
Add a new example test that will patch utils and os functions so that they can be 'retargeted' to a temporary directory, which allows us the ability to run a full set of cloud-init stages. Neat things: 1. All cloud-init code is unchanged (as long as it goes through the utils functions for most functionality) 2. Allows for a natural way to setup a temporary directory then patch the new directory as the new 'root' and then run cloud-init stages and then check the contents of what was placed as desired. Note: This is now exposing what I think was just an issue in ./tools/run-pylint. ./tools/run-pylint ./tests/unittests/test_filters/test_launch_index.py and ./tools/run-pylint ./tests/unittests/test_simple_run was always failing, but now I'm seeing errors. need to fix that. any tests that 'import helper' have issues.
2012-10-23fix pep8/pylintScott Moser
2012-10-23move default user info out of code and into configScott Moser
Remove the need to have 'default_user' and 'default_user_groups' groups be hard coded into the distro class, instead let that set of configuration be located in the config file where it should be specified instead.
2012-10-11Add some more sysconfig tests + pylint cleanups.Joshua Harlow
2012-10-11Handle the case where the value contains shellJoshua Harlow
variables to be expanded which when using pipes.quote will now not be expanded, so add some checks to ensure that this case will still happen.
2012-10-11Update to use pipes.quote to ensure that Joshua Harlow
variables adjusted in sysconfig files are properly quoted for there common use case, that being sourced into shell scripts.