summaryrefslogtreecommitdiff
path: root/tests/unittests/test_vmware_config_file.py
diff options
context:
space:
mode:
authorMaitreyee Saikia <msaikia@vmware.com>2017-12-08 10:10:40 -0700
committerChad Smith <chad.smith@canonical.com>2017-12-08 10:15:00 -0700
commitce33e423cde806a0590fec635778d62836e1bd37 (patch)
tree630ee644a3c56be85d8e85050b317e53b6c459b7 /tests/unittests/test_vmware_config_file.py
parent05b2308aa7e30337c2a455b5d2c67871b233e25c (diff)
downloadvyos-cloud-init-ce33e423cde806a0590fec635778d62836e1bd37.tar.gz
vyos-cloud-init-ce33e423cde806a0590fec635778d62836e1bd37.zip
VMware: Support for user provided pre and post-customization scripts
In the VMware customization workflow, we have some options for the user to upload scripts for additional customization. Based on user request, those custom scripts can be either run before regular customization or after. For post customization scripts, we decide whether to run the scripts just after customization or post system reboot.
Diffstat (limited to 'tests/unittests/test_vmware_config_file.py')
-rw-r--r--tests/unittests/test_vmware_config_file.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/unittests/test_vmware_config_file.py b/tests/unittests/test_vmware_config_file.py
index 0f8cda95..036f6879 100644
--- a/tests/unittests/test_vmware_config_file.py
+++ b/tests/unittests/test_vmware_config_file.py
@@ -335,5 +335,12 @@ class TestVmwareConfigFile(CiTestCase):
self.assertEqual('255.255.0.0', subnet.get('netmask'),
'Subnet netmask')
+ def test_custom_script(self):
+ cf = ConfigFile("tests/data/vmware/cust-dhcp-2nic.cfg")
+ conf = Config(cf)
+ self.assertIsNone(conf.custom_script_name)
+ cf._insertKey("CUSTOM-SCRIPT|SCRIPT-NAME", "test-script")
+ conf = Config(cf)
+ self.assertEqual("test-script", conf.custom_script_name)
# vi: ts=4 expandtab