summaryrefslogtreecommitdiff
path: root/tests/unittests/test_datasource/test_cloudsigma.py
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2016-12-07 19:17:03 +0100
committerScott Moser <smoser@ubuntu.com>2016-12-11 20:56:23 -0500
commita9d41de47a58d967ae3fd6a7749f8143a14424d3 (patch)
tree49a0922dfe7ee7d8224e5e10bd5171008c8cf9f8 /tests/unittests/test_datasource/test_cloudsigma.py
parentcbf93eb4ae9fba0797ab4ae7d62bc0d64611fa7e (diff)
downloadvyos-cloud-init-a9d41de47a58d967ae3fd6a7749f8143a14424d3.tar.gz
vyos-cloud-init-a9d41de47a58d967ae3fd6a7749f8143a14424d3.zip
CloudSigma: Fix bug where datasource was not loaded in local search.
CloudSigma would not get any datasources loaded during cloud-init local. Thus, when the network datasource was removed, *no* CloudSigma datasources would be loaded. LP: #1648380
Diffstat (limited to 'tests/unittests/test_datasource/test_cloudsigma.py')
-rw-r--r--tests/unittests/test_datasource/test_cloudsigma.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/unittests/test_datasource/test_cloudsigma.py b/tests/unittests/test_datasource/test_cloudsigma.py
index 2a42ce0c..a1d59c65 100644
--- a/tests/unittests/test_datasource/test_cloudsigma.py
+++ b/tests/unittests/test_datasource/test_cloudsigma.py
@@ -3,6 +3,7 @@
import copy
from cloudinit.cs_utils import Cepko
+from cloudinit import sources
from cloudinit.sources import DataSourceCloudSigma
from .. import helpers as test_helpers
@@ -97,3 +98,17 @@ class DataSourceCloudSigmaTest(test_helpers.TestCase):
self.datasource.get_data()
self.assertIsNone(self.datasource.vendordata_raw)
+
+
+class DsLoads(test_helpers.TestCase):
+ def test_get_datasource_list_returns_in_local(self):
+ deps = (sources.DEP_FILESYSTEM,)
+ ds_list = DataSourceCloudSigma.get_datasource_list(deps)
+ self.assertEqual(ds_list,
+ [DataSourceCloudSigma.DataSourceCloudSigma])
+
+ def test_list_sources_finds_ds(self):
+ found = sources.list_sources(
+ ['CloudSigma'], (sources.DEP_FILESYSTEM,), ['cloudinit.sources'])
+ self.assertEqual([DataSourceCloudSigma.DataSourceCloudSigma],
+ found)