Пример #1
0
 def test_missing_command(self):
     valid_but_missing = ["foo_bar_not_exist"]
     invalid = ["foo_bar_not_exist_and_not_matched"]
     filtermatch = wrapper.match_filter(self.filters, valid_but_missing)
     self.assertTrue(filtermatch is not None)
     filtermatch = wrapper.match_filter(self.filters, invalid)
     self.assertTrue(filtermatch is None)
Пример #2
0
 def test_RegExpFilter_match(self):
     usercmd = ["ls", "/root"]
     filtermatch = wrapper.match_filter(self.filters, usercmd)
     self.assertFalse(filtermatch is None)
     self.assertEqual(filtermatch.get_command(usercmd),
         ["/bin/ls", "/root"])
Пример #3
0
 def test_RegExpFilter_reject(self):
     usercmd = ["ls", "root"]
     filtermatch = wrapper.match_filter(self.filters, usercmd)
     self.assertTrue(filtermatch is None)
Пример #4
0
 def test_skips(self):
     # Check that all filters are skipped and that the last matches
     usercmd = ["cat", "/"]
     filtermatch = wrapper.match_filter(self.filters, usercmd)
     self.assertTrue(filtermatch is self.filters[-1])