summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/unittests/test_datasource/test_common.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/tests/unittests/test_datasource/test_common.py b/tests/unittests/test_datasource/test_common.py
index 61a7a762..4ab5d471 100644
--- a/tests/unittests/test_datasource/test_common.py
+++ b/tests/unittests/test_datasource/test_common.py
@@ -4,6 +4,7 @@ from cloudinit import settings
from cloudinit import sources
from cloudinit import type_utils
from cloudinit.sources import (
+ DataSource,
DataSourceAliYun as AliYun,
DataSourceAltCloud as AltCloud,
DataSourceAzure as Azure,
@@ -23,6 +24,7 @@ from cloudinit.sources import (
DataSourceOpenStack as OpenStack,
DataSourceOracle as Oracle,
DataSourceOVF as OVF,
+ DataSourceRbxCloud as RbxCloud,
DataSourceScaleway as Scaleway,
DataSourceSmartOS as SmartOS,
)
@@ -44,6 +46,7 @@ DEFAULT_LOCAL = [
SmartOS.DataSourceSmartOS,
Ec2.DataSourceEc2Local,
OpenStack.DataSourceOpenStackLocal,
+ RbxCloud.DataSourceRbxCloud,
Scaleway.DataSourceScaleway,
]
@@ -86,7 +89,6 @@ class ExpectedDataSources(test_helpers.TestCase):
class TestDataSourceInvariants(test_helpers.TestCase):
-
def test_data_sources_have_valid_network_config_sources(self):
for ds in DEFAULT_LOCAL + DEFAULT_NETWORK:
for cfg_src in ds.network_config_sources:
@@ -95,5 +97,14 @@ class TestDataSourceInvariants(test_helpers.TestCase):
self.assertTrue(hasattr(sources.NetworkConfigSource, cfg_src),
fail_msg)
+ def test_expected_dsname_defined(self):
+ for ds in DEFAULT_LOCAL + DEFAULT_NETWORK:
+ fail_msg = (
+ '{} has an invalid / missing dsname property: {}'.format(
+ str(ds), str(ds.dsname)
+ )
+ )
+ self.assertNotEqual(ds.dsname, DataSource.dsname, fail_msg)
+ self.assertIsNotNone(ds.dsname)
# vi: ts=4 expandtab