diff options
author | Scott Moser <smoser@ubuntu.com> | 2012-03-06 17:10:52 -0500 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2012-03-06 17:10:52 -0500 |
commit | 27ad683638a30e202a0def71485fade430976856 (patch) | |
tree | 514ea8a309a0a8e09c9bf1e837f6a851eb284f40 /tests/unittests/test_datasource | |
parent | 0e2e852bb448553479e68e91896419f3e06a6a19 (diff) | |
download | vyos-cloud-init-27ad683638a30e202a0def71485fade430976856.tar.gz vyos-cloud-init-27ad683638a30e202a0def71485fade430976856.zip |
file for user-data should be 'user-data' (including the '-')
Diffstat (limited to 'tests/unittests/test_datasource')
-rw-r--r-- | tests/unittests/test_datasource/test_maas.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/unittests/test_datasource/test_maas.py b/tests/unittests/test_datasource/test_maas.py index 22374415..dc8964d3 100644 --- a/tests/unittests/test_datasource/test_maas.py +++ b/tests/unittests/test_datasource/test_maas.py @@ -26,33 +26,33 @@ class TestMaasDataSource(TestCase): """Verify a valid seeddir is read as such""" data = {'instance-id': 'i-valid01', 'hostname': 'valid01-hostname', - 'userdata': 'valid01-userdata'} + 'user-data': 'valid01-userdata'} my_d = os.path.join(self.tmp, "valid") populate_dir(my_d, data) (userdata, metadata) = read_maas_seed_dir(my_d) - self.assertEqual(userdata, data['userdata']) + self.assertEqual(userdata, data['user-data']) for key in ('instance-id', 'hostname'): self.assertEqual(data[key], metadata[key]) # verify that 'userdata' is not returned as part of the metadata - self.assertFalse(('userdata' in metadata)) + self.assertFalse(('user-data' in metadata)) def test_seed_dir_valid_extra(self): """Verify extra files do not affect seed_dir validity """ data = {'instance-id': 'i-valid-extra', 'hostname': 'valid-extra-hostname', - 'userdata': 'valid-extra-userdata', 'foo': 'bar'} + 'user-data': 'valid-extra-userdata', 'foo': 'bar'} my_d = os.path.join(self.tmp, "valid_extra") populate_dir(my_d, data) (userdata, metadata) = read_maas_seed_dir(my_d) - self.assertEqual(userdata, data['userdata']) + self.assertEqual(userdata, data['user-data']) for key in ('instance-id', 'hostname'): self.assertEqual(data[key], metadata[key]) @@ -63,14 +63,14 @@ class TestMaasDataSource(TestCase): """Verify that invalid seed_dir raises MaasSeedDirMalformed""" valid = {'instance-id': 'i-instanceid', - 'hostname': 'test-hostname', 'userdata': ''} + 'hostname': 'test-hostname', 'user-data': ''} my_based = os.path.join(self.tmp, "valid_extra") # missing 'userdata' file my_d = "%s-01" % my_based invalid_data = copy(valid) - del invalid_data['userdata'] + del invalid_data['user-data'] populate_dir(my_d, invalid_data) self.assertRaises(MaasSeedDirMalformed, read_maas_seed_dir, my_d) |