示例#1
0
    def test_file_list_emptydirs(self):
        if integration.TMP_STATE_TREE not in self.master_opts['file_roots'][
                'base']:
            self.skipTest(
                'This test fails when using tests/runtests.py. salt-runtests will be available soon.'
            )

        empty_dir = os.path.join(integration.TMP_STATE_TREE, 'empty_dir')
        if not os.path.isdir(empty_dir):
            # There's no use creating the empty-directory ourselves at this
            # point, the minions have already synced, it wouldn't get pushed to
            # them
            self.skipTest(
                'This test fails when using tests/runtests.py. salt-runtests will be available soon.'
            )

        with patch.dict(
                roots.__opts__, {
                    'cachedir': self.master_opts['cachedir'],
                    'file_roots': self.master_opts['file_roots'],
                    'fileserver_ignoresymlinks': False,
                    'fileserver_followsymlinks': False,
                    'file_ignore_regex': False,
                    'file_ignore_glob': False
                }):
            ret = roots.file_list_emptydirs({'saltenv': 'base'})
            self.assertIn('empty_dir', ret)
示例#2
0
 def test_file_list_emptydirs(self):
     empty_dir = self.tmp_state_tree / "empty_dir"
     if not empty_dir.is_dir():
         empty_dir.mkdir()
     self.addCleanup(salt.utils.files.rm_rf, str(empty_dir))
     ret = roots.file_list_emptydirs({"saltenv": "base"})
     self.assertIn("empty_dir", ret)
示例#3
0
 def test_file_list_emptydirs(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.file_list_emptydirs({'saltenv': 'base'})
         self.assertIn('empty_dir', ret)
示例#4
0
文件: roots_test.py 项目: tligda/salt
 def test_file_list_emptydirs(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.file_list_emptydirs({'saltenv': 'base'})
         self.assertIn('empty_dir', ret)
示例#5
0
 def test_file_list_emptydirs(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.file_list_emptydirs({"saltenv": "base"})
         self.assertIn("empty_dir", ret)
示例#6
0
 def test_file_list_emptydirs(self):
     if integration.TMP_STATE_TREE not in self.master_opts['file_roots'][
             'base']:
         self.skipTest(
             'This test fails when using tests/runtests.py. salt-runtests will be available soon.'
         )
     with patch.dict(
             roots.__opts__, {
                 'cachedir': self.master_opts['cachedir'],
                 'file_roots': self.master_opts['file_roots'],
                 'fileserver_ignoresymlinks': False,
                 'fileserver_followsymlinks': False,
                 'file_ignore_regex': False,
                 'file_ignore_glob': False
             }):
         ret = roots.file_list_emptydirs({'saltenv': 'base'})
         self.assertIn('empty_dir', ret)
示例#7
0
文件: roots_test.py 项目: bryson/salt
    def test_file_list_emptydirs(self):
        if integration.TMP_STATE_TREE not in self.master_opts['file_roots']['base']:
            self.skipTest('This test fails when using tests/runtests.py. salt-runtests will be available soon.')

        empty_dir = os.path.join(integration.TMP_STATE_TREE, 'empty_dir')
        if not os.path.isdir(empty_dir):
            # There's no use creating the empty-directory ourselves at this
            # point, the minions have already synced, it wouldn't get pushed to
            # them
            self.skipTest('This test fails when using tests/runtests.py. salt-runtests will be available soon.')

        with patch.dict(roots.__opts__, {'cachedir': self.master_opts['cachedir'],
                                         'file_roots': self.master_opts['file_roots'],
                                         'fileserver_ignoresymlinks': False,
                                         'fileserver_followsymlinks': False,
                                         'file_ignore_regex': False,
                                         'file_ignore_glob': False}):
            ret = roots.file_list_emptydirs({'saltenv': 'base'})
            self.assertIn('empty_dir', ret)
示例#8
0
 def test_file_list_emptydirs(self):
     ret = roots.file_list_emptydirs({'saltenv': 'base'})
     self.assertIn('empty_dir', ret)
示例#9
0
 def test_file_list_emptydirs(self):
     ret = roots.file_list_emptydirs({"saltenv": "base"})
     self.assertIn("empty_dir", ret)