summaryrefslogtreecommitdiff
path: root/tests/unittests/test_datasource/test_smartos.py
diff options
context:
space:
mode:
authorMike Gerdts <mike.gerdts@joyent.com>2019-10-31 19:45:29 +0000
committerServer Team CI Bot <josh.powers+server-team-bot@canonical.com>2019-10-31 19:45:29 +0000
commite81389592a67bb54b889512928dcdf65f87ad436 (patch)
tree4f4c0a3ac5b18c40899624c7ad05a390fece7d36 /tests/unittests/test_datasource/test_smartos.py
parent45ea695f9b4fce180c662ab4211575d64912634e (diff)
downloadvyos-cloud-init-e81389592a67bb54b889512928dcdf65f87ad436.tar.gz
vyos-cloud-init-e81389592a67bb54b889512928dcdf65f87ad436.zip
DataSourceSmartOS: reconfigure network on each boot
In typical cases, SmartOS does not use DHCP for network configuration. As such, if the network configuration changes that is reflected in metadata and will be picked up during the next boot. LP: #1765801 Joyent: OS-6902 reconfigure network on each boot
Diffstat (limited to 'tests/unittests/test_datasource/test_smartos.py')
-rw-r--r--tests/unittests/test_datasource/test_smartos.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/unittests/test_datasource/test_smartos.py b/tests/unittests/test_datasource/test_smartos.py
index 42ac6971..d5b1c29c 100644
--- a/tests/unittests/test_datasource/test_smartos.py
+++ b/tests/unittests/test_datasource/test_smartos.py
@@ -1,5 +1,5 @@
# Copyright (C) 2013 Canonical Ltd.
-# Copyright (c) 2018, Joyent, Inc.
+# Copyright 2019 Joyent, Inc.
#
# Author: Ben Howard <ben.howard@canonical.com>
#
@@ -31,6 +31,7 @@ from cloudinit.sources.DataSourceSmartOS import (
convert_smartos_network_data as convert_net,
SMARTOS_ENV_KVM, SERIAL_DEVICE, get_smartos_environ,
identify_file)
+from cloudinit.event import EventType
import six
@@ -653,6 +654,12 @@ class TestSmartOSDataSource(FilesystemMockingTestCase):
self.assertEqual(dsrc.device_name_to_device('FOO'),
mydscfg['disk_aliases']['FOO'])
+ def test_reconfig_network_on_boot(self):
+ # Test to ensure that network is configured from metadata on each boot
+ dsrc = self._get_ds(mockdata=MOCK_RETURNS)
+ self.assertSetEqual(set([EventType.BOOT_NEW_INSTANCE, EventType.BOOT]),
+ dsrc.update_events['network'])
+
class TestIdentifyFile(CiTestCase):
"""Test the 'identify_file' utility."""