def test_remove_module_arguments_two(self): old_rule = PamdRule.rulefromstring('session [success=1 default=ignore] pam_succeed_if.so service in crond quiet use_uid') new_rule = PamdRule.rulefromstring('session [success=1 default=ignore] pam_succeed_if.so in quiet use_uid') args_to_remove = ['service', 'crond'] remove_module_arguments(self.pamd, old_rule, args_to_remove) self.assertIn(str(new_rule).rstrip(), str(self.pamd)) self.assertNotIn(str(old_rule).rstrip(), str(self.pamd))
def test_remove_module_arguments_two(self): old_rule = PamdRule.rulefromstring('session [success=1 default=ignore] pam_succeed_if.so service in crond quiet use_uid') new_rule = PamdRule.rulefromstring('session [success=1 default=ignore] pam_succeed_if.so in quiet use_uid') args_to_remove = ['service', 'crond'] remove_module_arguments(self.pamd, old_rule, args_to_remove) self.assertIn(str(new_rule).rstrip(), str(self.pamd)) self.assertNotIn(str(old_rule).rstrip(), str(self.pamd))
def test_remove_module_arguments_one(self): old_rule = PamdRule.rulefromstring('auth sufficient pam_unix.so nullok try_first_pass') new_rule = PamdRule.rulefromstring('auth sufficient pam_unix.so try_first_pass') args_to_remove = ['nullok'] remove_module_arguments(self.pamd, old_rule, args_to_remove) self.assertIn(str(new_rule).rstrip(), str(self.pamd)) self.assertNotIn(str(old_rule).rstrip(), str(self.pamd))
def test_remove_module_arguments_one(self): old_rule = PamdRule.rulefromstring('auth sufficient pam_unix.so nullok try_first_pass') new_rule = PamdRule.rulefromstring('auth sufficient pam_unix.so try_first_pass') args_to_remove = ['nullok'] remove_module_arguments(self.pamd, old_rule, args_to_remove) self.assertIn(str(new_rule).rstrip(), str(self.pamd)) self.assertNotIn(str(old_rule).rstrip(), str(self.pamd))