summaryrefslogtreecommitdiff
path: root/tests/unittests
diff options
context:
space:
mode:
authorBen Howard <ben.howard@canonical.com>2014-01-24 14:20:54 -0700
committerBen Howard <ben.howard@canonical.com>2014-01-24 14:20:54 -0700
commit85d8ec03ea4dd01d37b141390d1ae5c7d10e7052 (patch)
treea97ddb7f71d00e857dd718b4004f52638736c299 /tests/unittests
parent7079fac4646380db1e064a433d7843473bda1542 (diff)
parent4919cd124e57e82ecfcdaa9bfcbc051c719708e6 (diff)
downloadvyos-cloud-init-85d8ec03ea4dd01d37b141390d1ae5c7d10e7052.tar.gz
vyos-cloud-init-85d8ec03ea4dd01d37b141390d1ae5c7d10e7052.zip
Rebasing on trunk
Diffstat (limited to 'tests/unittests')
-rw-r--r--tests/unittests/test_datasource/test_configdrive.py2
-rw-r--r--tests/unittests/test_datasource/test_maas.py3
-rw-r--r--tests/unittests/test_ec2_util.py8
3 files changed, 11 insertions, 2 deletions
diff --git a/tests/unittests/test_datasource/test_configdrive.py b/tests/unittests/test_datasource/test_configdrive.py
index 3c1e8add..1f4a0a0b 100644
--- a/tests/unittests/test_datasource/test_configdrive.py
+++ b/tests/unittests/test_datasource/test_configdrive.py
@@ -285,7 +285,7 @@ class TestConfigDriveDataSource(MockerTestCase):
self.assertEqual(["/dev/vdb", "/dev/zdd"],
ds.find_candidate_devs())
- # verify that partitions are considered, but only if they have a label.
+ # verify that partitions are considered, that have correct label.
devs_with_answers = {"TYPE=vfat": ["/dev/sda1"],
"TYPE=iso9660": [], "LABEL=config-2": ["/dev/vdb3"]}
self.assertEqual(["/dev/vdb3"],
diff --git a/tests/unittests/test_datasource/test_maas.py b/tests/unittests/test_datasource/test_maas.py
index 2007a6df..ebfb24da 100644
--- a/tests/unittests/test_datasource/test_maas.py
+++ b/tests/unittests/test_datasource/test_maas.py
@@ -119,7 +119,8 @@ class TestMAASDataSource(mocker.MockerTestCase):
mock_request(url, headers=None, timeout=mocker.ANY,
data=mocker.ANY, sec_between=mocker.ANY,
ssl_details=mocker.ANY, retries=mocker.ANY,
- headers_cb=my_headers_cb)
+ headers_cb=my_headers_cb,
+ exception_cb=mocker.ANY)
resp = valid.get(key)
self.mocker.result(util.StringResponse(resp))
self.mocker.replay()
diff --git a/tests/unittests/test_ec2_util.py b/tests/unittests/test_ec2_util.py
index dd588aca..957dc3f2 100644
--- a/tests/unittests/test_ec2_util.py
+++ b/tests/unittests/test_ec2_util.py
@@ -34,6 +34,14 @@ class TestEc2Util(helpers.TestCase):
self.assertEquals('', userdata)
@hp.activate
+ def test_userdata_fetch_fail_server_not_found(self):
+ hp.register_uri(hp.GET,
+ 'http://169.254.169.254/%s/user-data' % (self.VERSION),
+ status=404)
+ userdata = eu.get_instance_userdata(self.VERSION)
+ self.assertEquals('', userdata)
+
+ @hp.activate
def test_metadata_fetch_no_keys(self):
base_url = 'http://169.254.169.254/%s/meta-data' % (self.VERSION)
hp.register_uri(hp.GET, base_url, status=200,