summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2013-05-16 01:22:29 +0000
committerGerrit Code Review <review@openstack.org>2013-05-16 01:22:29 +0000
commit005ded7710edd9e18e9857469ee8d8fb8f0ad595 (patch)
treea741c9361cda3ce9791237be0fe99c86b079d954 /tests
parentaa89d8b27a86abc1ba84133c655a49fa3ccda798 (diff)
parentea78eecbd275fa7466e56d6eb0dc7a3c60f5b640 (diff)
downloadoslo-005ded7710edd9e18e9857469ee8d8fb8f0ad595.tar.gz
oslo-005ded7710edd9e18e9857469ee8d8fb8f0ad595.tar.xz
oslo-005ded7710edd9e18e9857469ee8d8fb8f0ad595.zip
Merge "Update KillFilter to stop at '\0' for readlink() function."
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/test_rootwrap.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/unit/test_rootwrap.py b/tests/unit/test_rootwrap.py
index ea6ccbb..5a5d9ca 100644
--- a/tests/unit/test_rootwrap.py
+++ b/tests/unit/test_rootwrap.py
@@ -134,6 +134,18 @@ class RootwrapTestCase(utils.BaseTestCase):
self.stubs.Set(os, 'readlink', fake_readlink)
self.assertTrue(f.match(usercmd))
+ def test_KillFilter_upgraded_exe(self):
+ """Makes sure upgraded exe's are killed correctly"""
+ # See bug #1179793.
+ def fake_readlink(blah):
+ return '/bin/commandddddd\0\05190bfb2 (deleted)'
+
+ f = filters.KillFilter("root", "/bin/commandddddd")
+ usercmd = ['kill', 1234]
+
+ self.stubs.Set(os, 'readlink', fake_readlink)
+ self.assertTrue(f.match(usercmd))
+
def test_ReadFileFilter(self):
goodfn = '/good/file.name'
f = filters.ReadFileFilter(goodfn)