diff options
author | Xiaofeng Wang <xiaofengw@vmware.com> | 2019-10-17 15:18:44 +0000 |
---|---|---|
committer | Server Team CI Bot <josh.powers+server-team-bot@canonical.com> | 2019-10-17 15:18:44 +0000 |
commit | ecb501b84338f078be18c38c68c3ce87fed3584b (patch) | |
tree | 0861c97c0fcf444b4035795055f18cef161273e8 /tests/unittests/test_vmware | |
parent | a86829d32284ea4842f13035442b1a5127997018 (diff) | |
download | vyos-cloud-init-ecb501b84338f078be18c38c68c3ce87fed3584b.tar.gz vyos-cloud-init-ecb501b84338f078be18c38c68c3ce87fed3584b.zip |
guestcust_util: handle special characters in config file
Handle the special characters when reading VM Tools configure file.
For example, the key and value may contain _, - and . etc.
Diffstat (limited to 'tests/unittests/test_vmware')
-rw-r--r-- | tests/unittests/test_vmware/test_guestcust_util.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/unittests/test_vmware/test_guestcust_util.py b/tests/unittests/test_vmware/test_guestcust_util.py index b8fa9942..b175a998 100644 --- a/tests/unittests/test_vmware/test_guestcust_util.py +++ b/tests/unittests/test_vmware/test_guestcust_util.py @@ -62,4 +62,11 @@ class TestGuestCustUtil(CiTestCase): get_tools_config('section', 'key', 'defaultVal'), 'Bar=Wark') + # value contains specific characters + with mock.patch.object(util, 'subp', + return_value=('[a] b.c_d=e-f', b'')): + self.assertEqual( + get_tools_config('section', 'key', 'defaultVal'), + 'e-f') + # vi: ts=4 expandtab |