diff options
author | Joshua Harlow <harlowja@yahoo-inc.com> | 2012-10-11 19:10:42 -0700 |
---|---|---|
committer | Joshua Harlow <harlowja@yahoo-inc.com> | 2012-10-11 19:10:42 -0700 |
commit | 3cf8b618f9efcdb2e9cca695c2930a2bf14d42ec (patch) | |
tree | 2c1449b8989f1015a222209afb9ec582350ab2a0 /tests/unittests | |
parent | 66f6d2d4fd1e8c1b397c9533ee0596d7b09e9824 (diff) | |
download | vyos-cloud-init-3cf8b618f9efcdb2e9cca695c2930a2bf14d42ec.tar.gz vyos-cloud-init-3cf8b618f9efcdb2e9cca695c2930a2bf14d42ec.zip |
Handle the case where the value contains shell
variables to be expanded which when using
pipes.quote will now not be expanded, so add
some checks to ensure that this case will still happen.
Diffstat (limited to 'tests/unittests')
-rw-r--r-- | tests/unittests/test_distros/test_sysconfig.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/tests/unittests/test_distros/test_sysconfig.py b/tests/unittests/test_distros/test_sysconfig.py index a07a251e..21e161ad 100644 --- a/tests/unittests/test_distros/test_sysconfig.py +++ b/tests/unittests/test_distros/test_sysconfig.py @@ -24,7 +24,7 @@ NETMASK0=255.255.255.0 # Inline comment LIST=$LOGROOT/incremental-list IPV6TO4_ROUTING='eth0-:0004::1/64 eth1-:0005::1/64' -ETHTOOL_OPTS='-K ${DEVICE} tso on; -G ${DEVICE} rx 256 tx 256' +ETHTOOL_OPTS="-K ${DEVICE} tso on; -G ${DEVICE} rx 256 tx 256" USEMD5=no''' conf = SysConf(contents.splitlines()) self.assertEquals(conf['HOSTNAME'], 'blahblah') @@ -32,7 +32,6 @@ USEMD5=no''' # Should be unquoted self.assertEquals(conf['ETHTOOL_OPTS'], ('-K ${DEVICE} tso on; ' '-G ${DEVICE} rx 256 tx 256')) - # This is harmless convertion self.assertEquals(contents, str(conf)) def test_parse_adjust(self): @@ -44,7 +43,7 @@ USEMD5=no''' conf['IPV6TO4_ROUTING'] = "blah \tblah" contents2 = str(conf).strip() # Should be requoted due to whitespace - self.assertRegexpMatches(contents2, r'IPV6TO4_ROUTING=["\']blah \tblah["\']') + self.assertRegexpMatches(contents2, r'IPV6TO4_ROUTING=[\']blah\s+blah[\']') def test_parse_no_adjust_shell(self): conf = SysConf(''.splitlines()) |