diff options
author | Maitreyee Saikia <msaikia@vmware.com> | 2017-12-08 10:10:40 -0700 |
---|---|---|
committer | Chad Smith <chad.smith@canonical.com> | 2017-12-08 10:15:00 -0700 |
commit | ce33e423cde806a0590fec635778d62836e1bd37 (patch) | |
tree | 630ee644a3c56be85d8e85050b317e53b6c459b7 /tests/unittests/test_vmware_config_file.py | |
parent | 05b2308aa7e30337c2a455b5d2c67871b233e25c (diff) | |
download | vyos-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.py | 7 |
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 |