summaryrefslogtreecommitdiff
path: root/tests/unittests/test_datasource
AgeCommit message (Collapse)Author
2014-08-26fix(pep8): Fix various pep8 violations and version-lock pep8Jay Faulkner
Fixed all complaints from running "make pep8". Also version locked pep8 in test-requirements.txt to ensure that pep8 requirements don't change without an explicit commit.
2014-08-22ec2_utils.py: get_instance_metadata explicitly add trailing /Scott Moser
This change works around a bug in CloudStack's EC2 api implementation. That is filed upstream at [1]. The fix is safe for openstack and EC2 use cases as well. EC2 and OpenStacks' EC2 metadata service both return a list with access to either of: <url_base>/latest/meta-data <url_base>/latest/meta-data/ Additionally, the responses explicitly contain a trailing '/' for items that have a child. The ec2_utils code then just re-uses the trailng / there. Thus, only the top level request for 'meta-data/' needs the explicit fix. This also changes test cases. Those test cases failed without fixing them. If ever this regressed, those would fail again. -- [1] https://issues.apache.org/jira/browse/CLOUDSTACK-7405 LP: #1356855
2014-07-24merge from trunkScott Moser
2014-07-23fix httpretty based test cases if http_proxy is set.Scott Moser
previously this would fail: http_proxy=http://foo.bar make test now it will pass. This works around a bug where httpretty is not able to patch http operations if http_proxy is set. https://github.com/gabrielfalcao/HTTPretty/issues/122
2014-07-23moreDimitri John Ledkov
2014-07-23moreDimitri John Ledkov
2014-07-16Fix a few tests that have been failing in python 2.6Joshua Harlow
A few of the current tests have been continually failing in python 2.6 based systems, due to lack of unit test functions that are now added to ensure we can run the unit tests (and not have to ignore those failures) on python 2.6
2014-06-02SmartOS test: do not require existance of /dev/ttyS1.Scott Moser
LP: #1316597
2014-05-30CloudSigma: only poll on serial device after dmidecode check.Kiril Vladimiroff
On systems with a ttyS1 and nothing attached, the read attempts that the cloud sigma datasource would do would block. Also, Add timeouts for reading/writting from/to the serial console LP: #1316475
2014-05-30add vendordata support to cloudsigma datasourceScott Moser
LP: #1303986
2014-05-30Use dmidecode to detect if cloud-init runs in CloudSigma's infrastructureKiril Vladimiroff
2014-05-27Enable vendordata for CloudSigma (LP: #1303986)Ben Howard
2014-04-01pyflakes cleanupsScott Moser
2014-03-27change 'default' encoding to be "None"Scott Moser
Instead of just trying to see if userdata decodes as the indication that it should be encoded, the user must explicitly set this. The "just try it" will fail in the case where the user had other use of user-data and wanted a blob of data to go through unrecognized by cloud-init. In cases where there can be mistake in automatic behavior, and some users may be relaying on old behavior, its best to just require explicit use.
2014-03-25Added base64 decoding of user data for OpenNebula.Enol Fernandez
2014-03-04CloudSigma: support user-data being base64 encodedKiril Vladimiroff
This adds the ability to read a 'base64_fields' entry in the metadata, and if cloud-init-userdata is listed in that, then content will be base64 decoded first.
2014-02-27test_altcloud: fix altcloud tests when running on armScott Moser
Similar test-hack as the SmartOS one. Here we just pretend that we're running on x86_64 so as to avoid re-writing the tests to expect otherwise on arm.
2014-02-27AltCloud: fix test failures related to new arm-specific behaviorOleg Strikov
2014-02-26pep8 and pylintScott Moser
2014-02-26SmartOS: do not run on arm as dmidecode causes problemsScott Moser
See LP: #1243287 for more information, but the easiest thing to do here is just not run smartos on arm. LP: #1243287
2014-02-24test_smartos: remove bad test caseScott Moser
This test case isn't really valid any more as we've changed the way this works.
2014-02-19Read encoded with base64 user dataKiril Vladimiroff
This allows users of CloudSigma's VM to encode their user data with base64. In order to do that thet have to add the ``cloudinit-user-data`` field to the ``base64_fields``. The latter is a comma-separated field with all the meta fields whit base64 encoded values.
2014-02-13re-work vendor-data and smartosScott Moser
This reduces how much cloud-init is explicitly involved in what "vendor-data" could accomplish. The goal of vendor-data was to provide the vendor with a channel to run arbitrary code that accomodate for their specific platform. Much of those accomodations are currently being done in cloud-init. However, this now moves some of those things to default "vendor-data", instead of cloud-init proper. Basically, now we have an 'sdc:vendor-data' key in the metadata. If that does not exist, then cloud-init will use the default. The default, provides a boothook. That boothook writes a file into /var/lib/cloud/per-boot/ . That file will be both written on every boot and then executed at rc.local time frame (by 'scripts-per-boot'). It will then execute /var/lib/cloud/instance/data/user-script and /var/lib/cloud/instance/data/operator-script if they exist. So, the things that cloud-init is now doing outside of the default vendor-data that I would rather be done in vendor-data is: * managing the population of instance/data/user-script and instance/data/operator-script. These could very easily be done from the boothook, but doing them in cloud-init removes the necessity for having a 'mdata-get' command in the image (or some other way for the boothook script to query the datasource). * managing the LEGACY things.
2014-02-13merge from trunkScott Moser
2014-02-13Define default vendordata for SmartOS. In absence of a vendordata, use aBen Howard
default #cloud-config that writes per-boot script that fetches subsequent sdc:operator-scripts and executes it.
2014-02-13GCE: use dns name instead of IP addressVaidas Jablonskis
2014-02-13GCE: add unit tests, user-data support and few other fixesVaidas Jablonskis
2014-02-13merge from trunkScott Moser
2014-02-12Add CloudSigma data sourceKiril Vladimiroff
2014-02-10change behavior to only delete SharedConfig.xml.Scott Moser
2014-02-08Remove HEAD usage and other small adjustmentsJoshua Harlow
2014-02-07Add test for disabled dsmodeJoshua Harlow
2014-02-07Add a bunch of new testsJoshua Harlow
2014-02-07Remerged with trunkJoshua Harlow
2014-02-07Made new ovf-env.xml handling more robust. Test cases includedBen Howard
2014-02-01Don't forget the rest of the files!Joshua Harlow
2014-02-01Add a openstack specific datasourceJoshua Harlow
Openstack has a unique derivative datasource that is gaining usage. Previously the config drive datasource provided part of this functionality as well as the ec2 datasource, but since new functionality is being added to openstack is seems benefical to combine the used parts into one datasource just made for handling openstack deployments. This patch factors out the common logic shared between the config drive and the openstack metadata datasource and places that in a shared helper file and then creates a new openstack datasource that readers from the openstack metadata service and refactors the config drive datasource to use this common logic.
2014-01-29add 2 tests for vendordata Scott Moser
2014-01-24read_file_or_url: raise UrlError with 404 on ENOENTScott Moser
This makes it easier to call read_file_or_url and handle file or url errors. Now read_file_or_url will raise a UrlError in either case on errors.
2014-01-24Rebasing on trunkBen Howard
2014-01-24pylint and long line fixes.Scott Moser
This fixes up many long lines to be < 80 chars and some other pylint issues. pylint 1.1 (in trusty) is now complaining about the lazy logging, so I'll clean that up when I touch things.
2014-01-24Fixes for SmartOS datasource (LP: #1272115):Ben Howard
1. fixed conflation of user-data and cloud-init user-data. Cloud-init user-data is now namespaced as 'cloud-init:user-data'. 2. user-scripts are now fetched from the meta-data service each boot and executed as in the scripts directory 3. datacenter name is now namespaced as sdc:datacenter 4. user-scripts should be shebanged if there is no file magic
2014-01-23Skip retry and continued fetch of userdata when NOT_FOUNDJoshua Harlow
When a 404 http code comes back from the fetching of ec2 data, instead of retrying immediatly stop the fetching process and in the userdata fetching function handle this case as a special case of no userdata being fetched (an empty string in this case).
2014-01-23Consider partitions as sources for configdrive if labelled correctlyPaul Querna
This change removes the filtering of partitions from potential ConfigDrive sources, if the LABEL of the partition is set to "config-2". This is useful for a bare metal device. It may not have a separate device for ConfigDrive, but instead have a ConfigDrive available on a partition.
2014-01-17fix pep8 (trailing ';')Scott Moser
2014-01-16DataSourceOpenNebula:parse_shell_config skip 'SECONDS' var if seenScott Moser
SECONDS is a special variable in bash, it gets set to the time the shell has been alive. This would cause us to fail randomly (if the process happened to take more than 1 second, then SECONDS would be defined).
2014-01-09Allow a Config Drive source on a partition, if the label matches.Paul Querna
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-02fix permission changesScott Moser
2013-10-01Reordered several imports in order for test suite to pass.Eric Nordlund