summaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
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).
2015-09-08 power_state: support 'condition' argumentScott Moser
if 'condition' is provided to config in power_state, then consult it before powering off. This allows the user to shut down only if a condition is met, and leave the system in a debuggable state otherwise. An example is as simple as: power_state: mode: poweroff condition: ['sh', '-c', '[ -f /disable-poweroff ]']
2015-09-08NoCloud: fix consumption of vendor-dataScott Moser
the content of vendordata was was being assigned to vendordata, rather than vendordata_raw. The result was that it is not processed for includes or part handlers or other things as it is in other datasources. LP: #1493453
2015-09-02fix test_as_dictScott Moser
2015-08-31events: add timestamp and origin, support file postingScott Moser
This adds 'timestamp' and 'origin' to events. The timestamp is simply that, a floating point timestamp of when the event occurred. The origin indicates the source / reporter of this. It is useful to have a single endpoint with multiple different things reporting to it. For example, MAAS will configure cloud-init and curtin to report to the same endpoint and then it can differenciate who made the post. Admittedly, they could use multiple endpoints, but this this seems sane. Also, add support for posting files at the close of an event. This is utilized in curtin to post a log file when the install is done. files are posted on success or fail of the event.
2015-08-31split 'events' portion of reporting into separate fileScott Moser
this just separates events from other things that could conceivably be reported.
2015-08-07reporting: fix logging reproter and testsScott Moser
2015-08-07hopefully fix DataSourceMAASScott Moser
2015-08-06sync with cloudinit 2.0 for registry and reportingScott Moser
2015-08-04sync tests backScott Moser
2015-08-04fix pep8Scott Moser
2015-08-02fix tests from syncScott Moser
change ReportStack to ReportEventStack change default ReportEventStack to be status.SUCCESS instead of None
2015-07-30tests passScott Moser
2015-07-28pull from 2.0 trunk @ a433358bbcf4e8a771b80cae34468409ed5a811dScott Moser
2015-07-28rsyslog: skip empty or None in remotes formatScott Moser
This allows user to specify the following to overwrite a previously declared entry without warnings. rsyslog: {'remotes': {'foo': None}}
2015-07-28remove 'syslog' module (its been moved to rsyslog)Scott Moser
2015-07-28must declare proto of '@'Scott Moser
2015-07-28add trailing newline only if necessaryScott Moser
2015-07-28fix bug in remotes_to_rsyslog_cfg, add testScott Moser
2015-07-28add support for 'remotes'Scott Moser
2015-07-27merge from trunkScott Moser
2015-07-27add rsyslog testsScott Moser
reasonable test of reworked rsyslog module
2015-07-24commit initial re-work/re-implementation of syslog configScott Moser
2015-07-22mounts: support reliably detecting and using Azure ephemeral disksScott Moser
Azure's ephemeral disks are not guaranteed to be assigned the same name by the kernel every boot. This causes problems on ~2% of Azure instances, and can be fixed by using udev rules to give us a deterministic path to mount; this patch introduces those udev rules and modifies the Azure data source to use them. Changes to a couple of config modules were also required. In some places, they just needed to learn to dereference symlinks. In cc_mounts this wasn't sufficient because the dereferenced device would have been put in /etc/fstab (rather defeating the point of using the udev rules in the first place). A fairly hefty refactor was required to separate "is this a valid block device?" from "what shall I put in fstab?". LP: #1411582
2015-07-22Make full data source available to code that handles mirror selection.Daniel Watkins
2015-07-21fix 'make pyflakes'Scott Moser
2015-07-21tests: fix TestHandlerHandlePart testsScott Moser
these tests were previously passing, but doing so erroneously. I believe that an update to mock caused them to start failing. I've updated the tests now. The simple change is replacing 'assert_called_with_once' with 'assert_called_once_with'. The second set of changes is seemingly a correction of the following tests expectations: test_normal_version_2 : was not expecting to get frequency passed into handle_part, but should have been. test_no_handle_when_modfreq_once: was expecting to have handle_part called even though the test implies otherwise. test_exception_is_caught: this test just looked broken. Now, we're testing that the part handler is called and that no exception is raised past handle_part
2015-07-21Use /dev/disk devices for Azure ephemeral disk.Daniel Watkins
The ephemeral disk will not necessarily be assigned the same name at each boot (LP: #1411582), so we use some udev rules to ensure we always get the right one.
2015-07-21Refactor cc_mounts.sanitize_devname to make it easier to modify.Daniel Watkins
2015-07-06Return a sensible value for DataSourceGCE.availability_zone.Daniel Watkins
2015-07-06Reduce repetition in GCE data source tests.Daniel Watkins
2015-06-16Use wget to fetch CloudStack passwords.Daniel Watkins
Different versions of the CloudStack password server respond differently; wget handles these nicely for us, so it's easier to just use wget. LP: #1440263, #1464253
2015-06-10Add a cloud-init plugin for helping users register and subscribe their ↵Daniel Watkins
RHEL-based systems. This patch adds a cloud-init plugin for helping users register and subscribe their RHEL based systems. As inputs, it can take: - user and password OR activation key and org | requires on of the two pair - auto-attach: True or False | optional - service-level: <string> | optional - add-pool [list, of, pool, ids] | optional - enable-repos [list, of, yum, repos, to, enable] | optional - disable-repos [list, of, yum, repos, to, disable] | optional You can also pass the following to influence your registration via rhsm.conf: - rhsm-baseurl | optional - server-hostname | optional
2015-06-03add tests for systemd detectionLars Kellogg-Stedman
This adds the following tests in test_distros.test_generic: - test_systemd_in_use Test the situation in which /run/systemd/system exists. - test_systemd_not_in_use Test the situation in which /run/systemd/system does not exists. - test_systemd_symlink This tests the situation in which /run/systemd/system exists but is a *symlink* to a directory, which according to sd_booted() should return false.
2015-06-03transform paths in functions taking more than a single argumentLars Kellogg-Stedman
Patch FilesystemMockingTestcase.patchOS to support methods taking more than a single path argument. This is required in order to properly mock `os.symlink`, which takes two path arguments.
2015-05-29Corrected spelling error on variable nameBrent Baude
2015-05-27Updated files with upstream review comments thanks to Dan and ScottBrent Baude
2015-05-22AZURE: Redact on-disk user password in /var/lib/ovf-env.xmlBen Howard
The fabric provides the user password in plain text via the CDROM, and cloud-init has previously wrote the ovf-env.xml in /var/lib/waagent with the password in plain text. This change redacts the password.
2015-05-21This commit consists of three things based on feedback from smosher:Brent Baude
cc_rh_subscription: Use of self.log.info limited, uses the util.subp for subprocesses, removed full path for subscription-manager cloud-config-rh_subscription.txt: A heavily commented example file on how to use rh_subscription and its main keys test_rh_subscription.py: a set of unittests for rh_subscription
2015-05-15temporarily disasble test if no bin/cloud-initScott Moser
the tests of bin/cloud-init would fail in a package build environment. so, temporariliy skip them in that environment.
2015-05-15pep8 fixesScott Moser
2015-05-15Azure: remove dependency on walinux-agentScott Moser
This takes away our dependency on walinux-agent, by providing a builtin path for doing cloud-init had delegated to it. Currently the default is to still use the old path, but adding this code in will allow us to move to the new code path with more confidence.
2015-05-14read_seeded: fix reed_seeded after regressionScott Moser
read_seeded was assuming a Response object back from load_tfile_or_url but load_tfile_or_url was returning string. since the only other user of this was a test, move load_tfile_or_url to a test, and just do the right thing in read_seeded. LP: #1455233
2015-05-08Fix retrying.Daniel Watkins
2015-05-08Reintroduce original code path.Daniel Watkins
2015-05-08Move our walinuxagent implementation to a single function call.Daniel Watkins
2015-05-08Stop using Python 3 only tempfile.TemporaryDirectory (but lose free cleanup).Daniel Watkins
2015-05-08Split WALinuxAgentShim code out to separate file.Daniel Watkins
2015-05-08Make find_endpoint a staticmethod to clean up top-level namespace.Daniel Watkins