示例#1
0
def test_symlink_list(base_env_state_tree_root_dir):
    with pytest.helpers.temp_file("target", "data",
                                  base_env_state_tree_root_dir) as target:
        link = base_env_state_tree_root_dir / "link"
        link.symlink_to(str(target))
        ret = roots.symlink_list({"saltenv": "base"})
        assert ret == {"link": str(target)}
示例#2
0
文件: roots_test.py 项目: bryson/salt
 def test_symlink_list(self):
     with patch.dict(roots.__opts__, {'file_roots': self.master_opts['file_roots'],
                      'fileserver_ignoresymlinks': False,
                      'fileserver_followsymlinks': False,
                      'file_ignore_regex': False,
                      'file_ignore_glob': False}):
         ret = roots.symlink_list({'saltenv': 'base'})
         self.assertDictEqual(ret, {'dest_sym': 'source_sym'})
示例#3
0
 def test_symlink_list(self):
     with patch.dict(roots.__opts__, {'file_roots': self.master_opts['file_roots'],
                      'fileserver_ignoresymlinks': False,
                      'fileserver_followsymlinks': False,
                      'file_ignore_regex': False,
                      'file_ignore_glob': False}):
         ret = roots.symlink_list({'saltenv': 'base'})
         self.assertDictEqual(ret, {'dest_sym': 'source_sym'})
示例#4
0
 def test_symlink_list(self):
     source_sym = self.tmp_state_tree / "source_sym"
     source_sym.write_text("")
     dest_sym = self.tmp_state_tree / "dest_sym"
     dest_sym.symlink_to(str(source_sym))
     self.addCleanup(dest_sym.unlink)
     self.addCleanup(source_sym.unlink)
     ret = roots.symlink_list({"saltenv": "base"})
     self.assertDictEqual(ret, {"dest_sym": str(source_sym)})
示例#5
0
 def test_symlink_list(self):
     orig_file_roots = self.opts['file_roots']
     try:
         if self.test_symlink_list_file_roots:
             self.opts['file_roots'] = self.test_symlink_list_file_roots
         ret = roots.symlink_list({'saltenv': 'base'})
         self.assertDictEqual(ret, {'dest_sym': 'source_sym'})
     finally:
         if self.test_symlink_list_file_roots:
             self.opts['file_roots'] = orig_file_roots
示例#6
0
 def test_symlink_list(self):
     orig_file_roots = self.opts["file_roots"]
     try:
         if self.test_symlink_list_file_roots:
             self.opts["file_roots"] = self.test_symlink_list_file_roots
         ret = roots.symlink_list({"saltenv": "base"})
         self.assertDictEqual(ret, {"dest_sym": "source_sym"})
     finally:
         if self.test_symlink_list_file_roots:
             self.opts["file_roots"] = orig_file_roots
示例#7
0
 def test_symlink_list(self):
     source_sym = pathlib.Path(
         RUNTIME_VARS.TMP_BASEENV_STATE_TREE) / "source_sym"
     source_sym.write_text("")
     dest_sym = pathlib.Path(
         RUNTIME_VARS.TMP_BASEENV_STATE_TREE) / "dest_sym"
     dest_sym.symlink_to(str(source_sym))
     self.addCleanup(dest_sym.unlink)
     self.addCleanup(source_sym.unlink)
     ret = roots.symlink_list({"saltenv": "base"})
     self.assertDictEqual(ret, {"dest_sym": str(source_sym)})
示例#8
0
 def test_symlink_list(self):
     with patch.dict(
         roots.__opts__,
         {
             "file_roots": self.master_opts["file_roots"],
             "fileserver_ignoresymlinks": False,
             "fileserver_followsymlinks": False,
             "file_ignore_regex": False,
             "file_ignore_glob": False,
         },
     ):
         ret = roots.symlink_list({"saltenv": "base"})
         self.assertDictEqual(ret, {"dest_sym": "source_sym"})
示例#9
0
 def test_symlink_list(self):
     file_roots = self.test_symlink_list_file_roots \
         or self.opts['file_roots']
     ret = roots.symlink_list({'saltenv': 'base'})
     self.assertDictEqual(ret, {'dest_sym': 'source_sym'})