summaryrefslogtreecommitdiff
path: root/tests/utils/test_shell_util.py
diff options
context:
space:
mode:
authorDaniel Watkins <daniel.watkins@canonical.com>2016-09-13 16:11:47 +0100
committerusd-importer <ubuntu-server@lists.ubuntu.com>2016-09-14 10:39:12 +0000
commit5009a9d0f3606fc08a80ec0d59076d8dc48d2f25 (patch)
treead67eef74c5208178950db6ee28195e2137fa713 /tests/utils/test_shell_util.py
parent0f7cef5b52162d1ebb31a738bd8fc9febe1fbda6 (diff)
downloadvyos-walinuxagent-5009a9d0f3606fc08a80ec0d59076d8dc48d2f25.tar.gz
vyos-walinuxagent-5009a9d0f3606fc08a80ec0d59076d8dc48d2f25.zip
Import patches-unapplied version 2.1.5-0ubuntu1 to ubuntu/yakkety-proposed
Imported using git-ubuntu import. Changelog parent: 0f7cef5b52162d1ebb31a738bd8fc9febe1fbda6 New changelog entries: * New upstream release (LP: #1603581) - d/patches/disable-auto-update.patch: - The new version introduces auto-updating of the agent to its latest version via an internal mechanism; disable this - d/patches/fix_shebangs.patch: - Dropped in favour of the dh_python3 --shebang option. - Refreshed d/patches/disable_udev_overrides.patch
Diffstat (limited to 'tests/utils/test_shell_util.py')
-rw-r--r--tests/utils/test_shell_util.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/utils/test_shell_util.py b/tests/utils/test_shell_util.py
index aa89121..57e6c33 100644
--- a/tests/utils/test_shell_util.py
+++ b/tests/utils/test_shell_util.py
@@ -15,15 +15,12 @@
#
# Requires Python 2.4+ and Openssl 1.0+
#
-# Implements parts of RFC 2131, 1541, 1497 and
-# http://msdn.microsoft.com/en-us/library/cc227282%28PROT.10%29.aspx
-# http://msdn.microsoft.com/en-us/library/cc227259%28PROT.13%29.aspx
from tests.tools import *
import uuid
import unittest
import os
-import azurelinuxagent.utils.shellutil as shellutil
+import azurelinuxagent.common.utils.shellutil as shellutil
import test
class TestrunCmd(AgentTestCase):
@@ -38,5 +35,10 @@ class TestrunCmd(AgentTestCase):
err = shellutil.run_get_output(u"ls 我")
self.assertNotEquals(0, err[0])
+ def test_shellquote(self):
+ self.assertEqual("\'foo\'", shellutil.quote("foo"))
+ self.assertEqual("\'foo bar\'", shellutil.quote("foo bar"))
+ self.assertEqual("'foo'\\''bar'", shellutil.quote("foo\'bar"))
+
if __name__ == '__main__':
unittest.main()