Пример #1
0
 def test_modfacl__group_w_multiple_args(self):
     linux_acl.modfacl(*(self.group_acl + self.files))
     self.cmdrun.assert_called_once_with(
         "setfacl -m " + " ".join([self.group_acl_cmd] + self.quoted_files),
         python_shell=False,
         raise_err=False,
     )
Пример #2
0
 def test_modfacl_raise_err(self):
     mock = MagicMock(side_effect=CommandExecutionError("Custom err"))
     with patch.dict(linux_acl.__salt__, {"cmd.run": mock}):
         with self.assertRaises(CommandExecutionError) as excinfo:
             linux_acl.modfacl(*(self.user_acl + self.files),
                               raise_err=True)
         self.assertEqual(excinfo.exception.strerror, "Custom err")
Пример #3
0
 def test_modfacl__recursive_w_multiple_args(self):
     linux_acl.modfacl(*(self.user_acl + self.files), recursive=True)
     self.cmdrun.assert_called_once_with(
         'setfacl -R -m ' +
         ' '.join([self.user_acl_cmd] + self.quoted_files),
         python_shell=False,
         raise_err=False)
Пример #4
0
 def test_modfacl__g_w_single_arg(self):
     linux_acl.modfacl(*(self.g_acl + [self.file]))
     self.cmdrun.assert_called_once_with(
         "setfacl -m " + " ".join([self.group_acl_cmd, self.quoted_file]),
         python_shell=False,
         raise_err=False,
     )
Пример #5
0
 def test_modfacl__default_user_w_single_arg(self):
     linux_acl.modfacl(*(self.default_user_acl + [self.file]))
     self.cmdrun.assert_called_once_with(
         'setfacl -m ' +
         ' '.join([self.default_user_acl_cmd, self.quoted_file]),
         python_shell=False,
         raise_err=False)
Пример #6
0
 def test_modfacl__d_u_w_multiple_args(self):
     linux_acl.modfacl(*(self.d_u_acl + self.files))
     self.cmdrun.assert_called_once_with(
         'setfacl -m ' +
         ' '.join([self.default_user_acl_cmd] + self.quoted_files),
         python_shell=False,
         raise_err=False)
Пример #7
0
 def test_modfacl__group_w_single_arg(self):
     linux_acl.modfacl(*(self.group_acl + [self.file]))
     self.cmdrun.assert_called_once_with(
         'setfacl -m ' + ' '.join([self.group_acl_cmd, self.quoted_file]),
         python_shell=False)
Пример #8
0
 def test_modfacl__g_w_multiple_args(self):
     linux_acl.modfacl(*(self.g_acl + self.files))
     self.cmdrun.assert_called_once_with(
         'setfacl -m ' + ' '.join([self.group_acl_cmd] + self.quoted_files),
         python_shell=False)
Пример #9
0
 def test_modfacl__g_w_single_arg(self):
     linux_acl.modfacl(*(self.g_acl + [self.file]))
     self.cmdrun.assert_called_once_with(
         'setfacl -m ' + ' '.join([self.group_acl_cmd, self.file]))
Пример #10
0
 def test_modfacl__user_w_multiple_args(self):
     linux_acl.modfacl(*(self.user_acl + self.files))
     self.cmdrun.assert_called_once_with('setfacl -m ' +
                                         ' '.join([self.user_acl_cmd] +
                                                  self.files))
Пример #11
0
 def test_modfacl__d_u_w_single_arg(self):
     linux_acl.modfacl(*(self.d_u_acl + [self.file]))
     self.cmdrun.assert_called_once_with(
         'setfacl -m ' + ' '.join([self.default_user_acl_cmd, self.file]))
Пример #12
0
 def test_modfacl__group_w_multiple_args(self):
     linux_acl.modfacl(*(self.group_acl + self.files))
     self.cmdrun.assert_called_once_with('setfacl -m ' + ' '.join([self.group_acl_cmd] + self.files), python_shell=False)
Пример #13
0
 def test_modfacl__group_w_single_arg(self):
     linux_acl.modfacl(*(self.group_acl + [self.file]))
     self.cmdrun.assert_called_once_with('setfacl -m ' + ' '.join([self.group_acl_cmd, self.file]), python_shell=False)
Пример #14
0
 def test_modfacl__recursive_w_multiple_args(self):
     linux_acl.modfacl(*(self.user_acl + self.files), recursive=True)
     self.cmdrun.assert_called_once_with('setfacl -R -m ' + ' '.join([self.user_acl_cmd] + self.files), python_shell=False)