summaryrefslogtreecommitdiff
path: root/tests/unittests/test_datasource/test_vultr.py
diff options
context:
space:
mode:
authoreb3095 <45504889+eb3095@users.noreply.github.com>2021-09-24 09:57:33 -0400
committerGitHub <noreply@github.com>2021-09-24 08:57:33 -0500
commit244af3f4971c8f89c741aa90306f0fb1b4459940 (patch)
tree9d4cbe459aff2496cb0ce726065fb5dc2c923b2d /tests/unittests/test_datasource/test_vultr.py
parent24a15e9cd3acd7c93efe9755b98897ee8c0476c7 (diff)
downloadvyos-cloud-init-244af3f4971c8f89c741aa90306f0fb1b4459940.tar.gz
vyos-cloud-init-244af3f4971c8f89c741aa90306f0fb1b4459940.zip
Cleanup Vultr support (#987)
Offload Vultr's vendordata assembly to the backend, correct vendordata storage and parsing, allow passing critical data via the useragent, better networking configuration for additional interfaces.
Diffstat (limited to 'tests/unittests/test_datasource/test_vultr.py')
-rw-r--r--tests/unittests/test_datasource/test_vultr.py30
1 files changed, 12 insertions, 18 deletions
diff --git a/tests/unittests/test_datasource/test_vultr.py b/tests/unittests/test_datasource/test_vultr.py
index bbea2aa3..63235009 100644
--- a/tests/unittests/test_datasource/test_vultr.py
+++ b/tests/unittests/test_datasource/test_vultr.py
@@ -64,10 +64,8 @@ VULTR_V1_1 = {
'raid1-script': '',
'user-data': [
],
- 'vendor-data': {
- 'vendor-script': '',
- 'ethtool-script': '',
- 'config': {
+ 'vendor-data': [
+ {
'package_upgrade': 'true',
'disable_root': 0,
'ssh_pwauth': 1,
@@ -83,7 +81,7 @@ VULTR_V1_1 = {
}
}
}
- }
+ ]
}
VULTR_V1_2 = {
@@ -155,11 +153,8 @@ VULTR_V1_2 = {
'user-data': [
],
- 'vendor-data': {
- 'vendor-script': '',
- 'ethtool-script': '',
- 'raid1-script': '',
- 'config': {
+ 'vendor-data': [
+ {
'package_upgrade': 'true',
'disable_root': 0,
'ssh_pwauth': 1,
@@ -175,7 +170,7 @@ VULTR_V1_2 = {
}
}
}
- }
+ ]
}
SSH_KEYS_1 = [
@@ -217,7 +212,7 @@ EXPECTED_VULTR_NETWORK_1 = {
'accept-ra': 1,
'subnets': [
{'type': 'dhcp', 'control': 'auto'},
- {'type': 'dhcp6', 'control': 'auto'}
+ {'type': 'ipv6_slaac', 'control': 'auto'}
],
}
]
@@ -237,14 +232,13 @@ EXPECTED_VULTR_NETWORK_2 = {
'accept-ra': 1,
'subnets': [
{'type': 'dhcp', 'control': 'auto'},
- {'type': 'dhcp6', 'control': 'auto'}
+ {'type': 'ipv6_slaac', 'control': 'auto'}
],
},
{
'name': 'eth1',
'type': 'physical',
'mac_address': '5a:00:03:1b:4e:ca',
- 'accept-ra': 1,
'subnets': [
{
"type": "static",
@@ -270,12 +264,12 @@ class TestDataSourceVultr(CiTestCase):
super(TestDataSourceVultr, self).setUp()
# Stored as a dict to make it easier to maintain
- raw1 = json.dumps(VULTR_V1_1['vendor-data']['config'])
- raw2 = json.dumps(VULTR_V1_2['vendor-data']['config'])
+ raw1 = json.dumps(VULTR_V1_1['vendor-data'][0])
+ raw2 = json.dumps(VULTR_V1_2['vendor-data'][0])
# Make expected format
- VULTR_V1_1['vendor-data']['config'] = raw1
- VULTR_V1_2['vendor-data']['config'] = raw2
+ VULTR_V1_1['vendor-data'] = [raw1]
+ VULTR_V1_2['vendor-data'] = [raw2]
self.tmp = self.tmp_dir()