summaryrefslogtreecommitdiffstats
path: root/nova/tests
diff options
context:
space:
mode:
authorVishvananda Ishaya <vishvananda@gmail.com>2012-02-03 15:44:29 -0800
committerVishvananda Ishaya <vishvananda@gmail.com>2012-02-07 17:05:30 -0800
commit4ce6645f08fffa194f76e5d4105bfb77b6c8cd14 (patch)
treea2caf83fcb309a1f2027d8b6cb2c5aeb460a761a /nova/tests
parentb0a708f67407256a449414a000b070752e51dba2 (diff)
Makes sure killfilter doesn't raise ValueError
* Fixes bug 926412 * Includes failing test Change-Id: Ie0105ff777575d6dd794ce5b5e08545fb54ecf8b
Diffstat (limited to 'nova/tests')
-rw-r--r--nova/tests/test_nova_rootwrap.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/nova/tests/test_nova_rootwrap.py b/nova/tests/test_nova_rootwrap.py
index 38cce3b35..6905bfdc6 100644
--- a/nova/tests/test_nova_rootwrap.py
+++ b/nova/tests/test_nova_rootwrap.py
@@ -93,6 +93,16 @@ class RootwrapTestCase(test.TestCase):
# Providing -9 signal should work
self.assertTrue(f.match(usercmd))
+ def test_KillFilter_no_raise(self):
+ """Makes sure ValueError from bug 926412 is gone"""
+ f = filters.KillFilter("/bin/kill", "root", [""])
+ # Providing anything other than kill should be False
+ usercmd = ['notkill', 999999]
+ self.assertFalse(f.match(usercmd))
+ # Providing something that is not a pid should be False
+ usercmd = ['kill', 'notapid']
+ self.assertFalse(f.match(usercmd))
+
def test_ReadFileFilter(self):
goodfn = '/good/file.name'
f = filters.ReadFileFilter(goodfn)